/* Find a free SLCAN channel, and link in this `tty' line. */
-static struct slcan *slc_alloc(dev_t line, char forcednum)
+static struct slcan *slc_alloc(dev_t line)
{
int i;
int sel = -1;
}
}
- /* Check if the user specified an exact interface to use */
- if (forcednum) {
- sel = forcednum - '0';
- score = 0;
- i = sel;
- dev = slcan_devs[i];
- }
-
if (sel >= 0) {
i = sel;
dev = slcan_devs[i];
- if ((score > 1) && (dev)) {
+ if (score > 1) {
sl = netdev_priv(dev);
sl->flags &= (1 << SLF_INUSE);
return sl;
/* OK. Find a free SLCAN channel to use. */
err = -ENFILE;
-
- /* Look to see if the user has requested a specific channel
- * to be used (encoded as '0' plus the interface number requested in
- * the otherwise unused swtch termios variable )
- * stty swtch 'channel' device
- * where 'channel' is '0' to maxdevs (0)
- * where device is the name of the serial device (/dev/ttyUSB0)
- */
- if ((SWTC_CHAR(tty)>='0') && (SWTC_CHAR(tty)<'0'+maxdev)){
- sl = slc_alloc(tty_devnum(tty),SWTC_CHAR(tty));
- } else {
- /* OK. Find a free SLCAN channel to use. */
- sl = slc_alloc(tty_devnum(tty),0);
- }
-
+ sl = slc_alloc(tty_devnum(tty));
if (sl == NULL)
goto err_exit;