aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia/ipwireless/tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/pcmcia/ipwireless/tty.c')
-rw-r--r--drivers/char/pcmcia/ipwireless/tty.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/char/pcmcia/ipwireless/tty.c b/drivers/char/pcmcia/ipwireless/tty.c
index 2bb7874a6899..1a2c2c3b068f 100644
--- a/drivers/char/pcmcia/ipwireless/tty.c
+++ b/drivers/char/pcmcia/ipwireless/tty.c
@@ -487,7 +487,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty, struct file *file,
487 return tty_mode_ioctl(linux_tty, file, cmd , arg); 487 return tty_mode_ioctl(linux_tty, file, cmd , arg);
488} 488}
489 489
490static int add_tty(dev_node_t *nodesp, int j, 490static int add_tty(int j,
491 struct ipw_hardware *hardware, 491 struct ipw_hardware *hardware,
492 struct ipw_network *network, int channel_idx, 492 struct ipw_network *network, int channel_idx,
493 int secondary_channel_idx, int tty_type) 493 int secondary_channel_idx, int tty_type)
@@ -510,19 +510,13 @@ static int add_tty(dev_node_t *nodesp, int j,
510 ipwireless_associate_network_tty(network, 510 ipwireless_associate_network_tty(network,
511 secondary_channel_idx, 511 secondary_channel_idx,
512 ttys[j]); 512 ttys[j]);
513 if (nodesp != NULL) {
514 sprintf(nodesp->dev_name, "ttyIPWp%d", j);
515 nodesp->major = ipw_tty_driver->major;
516 nodesp->minor = j + ipw_tty_driver->minor_start;
517 }
518 if (get_tty(j + ipw_tty_driver->minor_start) == ttys[j]) 513 if (get_tty(j + ipw_tty_driver->minor_start) == ttys[j])
519 report_registering(ttys[j]); 514 report_registering(ttys[j]);
520 return 0; 515 return 0;
521} 516}
522 517
523struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hardware, 518struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hardware,
524 struct ipw_network *network, 519 struct ipw_network *network)
525 dev_node_t *nodes)
526{ 520{
527 int i, j; 521 int i, j;
528 522
@@ -539,26 +533,23 @@ struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hardware,
539 if (allfree) { 533 if (allfree) {
540 j = i; 534 j = i;
541 535
542 if (add_tty(&nodes[0], j, hardware, network, 536 if (add_tty(j, hardware, network,
543 IPW_CHANNEL_DIALLER, IPW_CHANNEL_RAS, 537 IPW_CHANNEL_DIALLER, IPW_CHANNEL_RAS,
544 TTYTYPE_MODEM)) 538 TTYTYPE_MODEM))
545 return NULL; 539 return NULL;
546 540
547 j += IPWIRELESS_PCMCIA_MINOR_RANGE; 541 j += IPWIRELESS_PCMCIA_MINOR_RANGE;
548 if (add_tty(&nodes[1], j, hardware, network, 542 if (add_tty(j, hardware, network,
549 IPW_CHANNEL_DIALLER, -1, 543 IPW_CHANNEL_DIALLER, -1,
550 TTYTYPE_MONITOR)) 544 TTYTYPE_MONITOR))
551 return NULL; 545 return NULL;
552 546
553 j += IPWIRELESS_PCMCIA_MINOR_RANGE; 547 j += IPWIRELESS_PCMCIA_MINOR_RANGE;
554 if (add_tty(NULL, j, hardware, network, 548 if (add_tty(j, hardware, network,
555 IPW_CHANNEL_RAS, -1, 549 IPW_CHANNEL_RAS, -1,
556 TTYTYPE_RAS_RAW)) 550 TTYTYPE_RAS_RAW))
557 return NULL; 551 return NULL;
558 552
559 nodes[0].next = &nodes[1];
560 nodes[1].next = NULL;
561
562 return ttys[i]; 553 return ttys[i];
563 } 554 }
564 } 555 }