Lines Matching +full:pc +full:- +full:ack

1 // SPDX-License-Identifier: GPL-2.0-or-later
4 /* This driver is for parallel port with 5-bit cable (LapLink (R) cable). */
8 * Tanabe Hiroyasu <hiro@sanpo.t.u-tokyo.ac.jp>
17 * parport-sharing awareness code by Philip Blundell.
25 * - Module initialization.
26 * - MTU fix.
27 * - Make sure other end is OK, before sending a packet.
28 * - Fix immediate timer problem.
31 * - Changed {enable,disable}_irq handling to make it work
51 * # ifconfig plip[0-2] arp
53 static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n";
62 count-low octet
63 count-high octet
71 The cable used is a de facto standard parallel null cable -- sold as
72 a "LapLink" cable by various places. You'll need a 12-conductor cable to
74 SLCTIN 17 - 17
75 GROUND 25 - 25
76 D0->ERROR 2 - 15 15 - 2
77 D1->SLCT 3 - 13 13 - 3
78 D2->PAPOUT 4 - 12 12 - 4
79 D3->ACK 5 - 10 10 - 5
80 D4->BUSY 6 - 11 11 - 6
125 #define ENABLE(irq) if (irq != -1) enable_irq(irq)
126 #define DISABLE(irq) if (irq != -1) disable_irq(irq)
227 if (dev->irq != -1) in enable_parport_interrupts()
230 ((struct net_local *)netdev_priv(dev))->pardev->port; in enable_parport_interrupts()
231 port->ops->enable_irq (port); in enable_parport_interrupts()
237 if (dev->irq != -1) in disable_parport_interrupts()
240 ((struct net_local *)netdev_priv(dev))->pardev->port; in disable_parport_interrupts()
241 port->ops->disable_irq (port); in disable_parport_interrupts()
248 ((struct net_local *)netdev_priv(dev))->pardev->port; in write_data()
250 port->ops->write_data (port, data); in write_data()
256 ((struct net_local *)netdev_priv(dev))->pardev->port; in read_status()
258 return port->ops->read_status (port); in read_status()
294 dev->tx_queue_len = 10; in plip_init_netdev()
295 dev->flags = IFF_POINTOPOINT|IFF_NOARP; in plip_init_netdev()
298 dev->netdev_ops = &plip_netdev_ops; in plip_init_netdev()
299 dev->header_ops = &plip_header_ops; in plip_init_netdev()
302 nl->port_owner = 0; in plip_init_netdev()
305 nl->trigger = PLIP_TRIGGER_WAIT; in plip_init_netdev()
306 nl->nibble = PLIP_NIBBLE_WAIT; in plip_init_netdev()
309 INIT_WORK(&nl->immediate, plip_bh); in plip_init_netdev()
310 INIT_DELAYED_WORK(&nl->deferred, plip_kick_bh); in plip_init_netdev()
312 if (dev->irq == -1) in plip_init_netdev()
313 INIT_DELAYED_WORK(&nl->timer, plip_timer_bh); in plip_init_netdev()
315 spin_lock_init(&nl->lock); in plip_init_netdev()
327 if (nl->is_deferred) in plip_kick_bh()
328 schedule_work(&nl->immediate); in plip_kick_bh()
369 struct plip_local *snd = &nl->snd_data; in plip_bh()
370 struct plip_local *rcv = &nl->rcv_data; in plip_bh()
374 nl->is_deferred = 0; in plip_bh()
375 f = connection_state_table[nl->connection]; in plip_bh()
376 if ((r = (*f)(nl->dev, nl, snd, rcv)) != OK && in plip_bh()
377 (r = plip_bh_timeout_error(nl->dev, nl, snd, rcv, r)) != OK) { in plip_bh()
378 nl->is_deferred = 1; in plip_bh()
379 schedule_delayed_work(&nl->deferred, 1); in plip_bh()
389 if (!(atomic_read (&nl->kill_timer))) { in plip_timer_bh()
390 plip_interrupt (nl->dev); in plip_timer_bh()
392 schedule_delayed_work(&nl->timer, 1); in plip_timer_bh()
395 complete(&nl->killed_timer_cmp); in plip_timer_bh()
409 * extra disable_irq() was a no-op. Now it became mortal - it's in plip_bh_timeout_error()
410 * unbalanced and thus we'll never re-enable IRQ (until rmmod plip, in plip_bh_timeout_error()
415 spin_lock_irq(&nl->lock); in plip_bh_timeout_error()
416 if (nl->connection == PLIP_CN_SEND) { in plip_bh_timeout_error()
419 nl->timeout_count++; in plip_bh_timeout_error()
420 if ((error == HS_TIMEOUT && nl->timeout_count <= 10) || in plip_bh_timeout_error()
421 nl->timeout_count <= 3) { in plip_bh_timeout_error()
422 spin_unlock_irq(&nl->lock); in plip_bh_timeout_error()
428 dev->name, snd->state, c0); in plip_bh_timeout_error()
431 dev->stats.tx_errors++; in plip_bh_timeout_error()
432 dev->stats.tx_aborted_errors++; in plip_bh_timeout_error()
433 } else if (nl->connection == PLIP_CN_RECEIVE) { in plip_bh_timeout_error()
434 if (rcv->state == PLIP_PK_TRIGGER) { in plip_bh_timeout_error()
436 spin_unlock_irq(&nl->lock); in plip_bh_timeout_error()
440 if (++nl->timeout_count <= 3) { in plip_bh_timeout_error()
441 spin_unlock_irq(&nl->lock); in plip_bh_timeout_error()
447 dev->name, rcv->state, c0); in plip_bh_timeout_error()
449 dev->stats.rx_dropped++; in plip_bh_timeout_error()
451 rcv->state = PLIP_PK_DONE; in plip_bh_timeout_error()
452 if (rcv->skb) { in plip_bh_timeout_error()
453 dev_kfree_skb_irq(rcv->skb); in plip_bh_timeout_error()
454 rcv->skb = NULL; in plip_bh_timeout_error()
456 snd->state = PLIP_PK_DONE; in plip_bh_timeout_error()
457 if (snd->skb) { in plip_bh_timeout_error()
458 dev_consume_skb_irq(snd->skb); in plip_bh_timeout_error()
459 snd->skb = NULL; in plip_bh_timeout_error()
461 spin_unlock_irq(&nl->lock); in plip_bh_timeout_error()
463 DISABLE(dev->irq); in plip_bh_timeout_error()
464 synchronize_irq(dev->irq); in plip_bh_timeout_error()
468 nl->connection = PLIP_CN_ERROR; in plip_bh_timeout_error()
481 /* PLIP_RECEIVE --- receive a byte(two nibbles)
501 if (--cx == 0) in plip_receive()
505 write_data (dev, 0x10); /* send ACK */ in plip_receive()
519 if (--cx == 0) in plip_receive()
523 write_data (dev, 0x00); /* send ACK */ in plip_receive()
538 * PLIP fortunately has no bus architecture (its Point-to-point).
550 skb_pull(skb,dev->hard_header_len); in plip_type_trans()
553 if(is_multicast_ether_addr(eth->h_dest)) in plip_type_trans()
555 if(ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) in plip_type_trans()
556 skb->pkt_type=PACKET_BROADCAST; in plip_type_trans()
558 skb->pkt_type=PACKET_MULTICAST; in plip_type_trans()
566 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) in plip_type_trans()
567 return eth->h_proto; in plip_type_trans()
569 rawp = skb->data; in plip_type_trans()
586 /* PLIP_RECEIVE_PACKET --- receive a packet */
591 unsigned short nibble_timeout = nl->nibble; in plip_receive_packet()
594 switch (rcv->state) { in plip_receive_packet()
596 DISABLE(dev->irq); in plip_receive_packet()
599 write_data (dev, 0x01); /* send ACK */ in plip_receive_packet()
601 printk(KERN_DEBUG "%s: receive start\n", dev->name); in plip_receive_packet()
602 rcv->state = PLIP_PK_LENGTH_LSB; in plip_receive_packet()
603 rcv->nibble = PLIP_NB_BEGIN; in plip_receive_packet()
607 if (snd->state != PLIP_PK_DONE) { in plip_receive_packet()
608 if (plip_receive(nl->trigger, dev, in plip_receive_packet()
609 &rcv->nibble, &rcv->length.b.lsb)) { in plip_receive_packet()
610 /* collision, here dev->tbusy == 1 */ in plip_receive_packet()
611 rcv->state = PLIP_PK_DONE; in plip_receive_packet()
612 nl->is_deferred = 1; in plip_receive_packet()
613 nl->connection = PLIP_CN_SEND; in plip_receive_packet()
614 schedule_delayed_work(&nl->deferred, 1); in plip_receive_packet()
616 ENABLE(dev->irq); in plip_receive_packet()
621 &rcv->nibble, &rcv->length.b.lsb)) in plip_receive_packet()
624 rcv->state = PLIP_PK_LENGTH_MSB; in plip_receive_packet()
629 &rcv->nibble, &rcv->length.b.msb)) in plip_receive_packet()
631 if (rcv->length.h > dev->mtu + dev->hard_header_len || in plip_receive_packet()
632 rcv->length.h < 8) { in plip_receive_packet()
633 printk(KERN_WARNING "%s: bogus packet size %d.\n", dev->name, rcv->length.h); in plip_receive_packet()
637 rcv->skb = dev_alloc_skb(rcv->length.h + 2); in plip_receive_packet()
638 if (rcv->skb == NULL) { in plip_receive_packet()
639 printk(KERN_ERR "%s: Memory squeeze.\n", dev->name); in plip_receive_packet()
642 skb_reserve(rcv->skb, 2); /* Align IP on 16 byte boundaries */ in plip_receive_packet()
643 skb_put(rcv->skb,rcv->length.h); in plip_receive_packet()
644 rcv->skb->dev = dev; in plip_receive_packet()
645 rcv->state = PLIP_PK_DATA; in plip_receive_packet()
646 rcv->byte = 0; in plip_receive_packet()
647 rcv->checksum = 0; in plip_receive_packet()
651 lbuf = rcv->skb->data; in plip_receive_packet()
654 &rcv->nibble, &lbuf[rcv->byte])) in plip_receive_packet()
656 } while (++rcv->byte < rcv->length.h); in plip_receive_packet()
658 rcv->checksum += lbuf[--rcv->byte]; in plip_receive_packet()
659 } while (rcv->byte); in plip_receive_packet()
660 rcv->state = PLIP_PK_CHECKSUM; in plip_receive_packet()
665 &rcv->nibble, &rcv->data)) in plip_receive_packet()
667 if (rcv->data != rcv->checksum) { in plip_receive_packet()
668 dev->stats.rx_crc_errors++; in plip_receive_packet()
670 printk(KERN_DEBUG "%s: checksum error\n", dev->name); in plip_receive_packet()
673 rcv->state = PLIP_PK_DONE; in plip_receive_packet()
678 rcv->skb->protocol=plip_type_trans(rcv->skb, dev); in plip_receive_packet()
679 netif_rx(rcv->skb); in plip_receive_packet()
680 dev->stats.rx_bytes += rcv->length.h; in plip_receive_packet()
681 dev->stats.rx_packets++; in plip_receive_packet()
682 rcv->skb = NULL; in plip_receive_packet()
684 printk(KERN_DEBUG "%s: receive end\n", dev->name); in plip_receive_packet()
688 spin_lock_irq(&nl->lock); in plip_receive_packet()
689 if (snd->state != PLIP_PK_DONE) { in plip_receive_packet()
690 nl->connection = PLIP_CN_SEND; in plip_receive_packet()
691 spin_unlock_irq(&nl->lock); in plip_receive_packet()
692 schedule_work(&nl->immediate); in plip_receive_packet()
694 ENABLE(dev->irq); in plip_receive_packet()
697 nl->connection = PLIP_CN_NONE; in plip_receive_packet()
698 spin_unlock_irq(&nl->lock); in plip_receive_packet()
700 ENABLE(dev->irq); in plip_receive_packet()
707 /* PLIP_SEND --- send a byte (two nibbles)
729 if (--cx == 0) in plip_send()
744 if (--cx == 0) in plip_send()
754 /* PLIP_SEND_PACKET --- send a packet */
759 unsigned short nibble_timeout = nl->nibble; in plip_send_packet()
764 if (snd->skb == NULL || (lbuf = snd->skb->data) == NULL) { in plip_send_packet()
765 printk(KERN_DEBUG "%s: send skb lost\n", dev->name); in plip_send_packet()
766 snd->state = PLIP_PK_DONE; in plip_send_packet()
767 snd->skb = NULL; in plip_send_packet()
771 switch (snd->state) { in plip_send_packet()
778 cx = nl->trigger; in plip_send_packet()
781 spin_lock_irq(&nl->lock); in plip_send_packet()
782 if (nl->connection == PLIP_CN_RECEIVE) { in plip_send_packet()
783 spin_unlock_irq(&nl->lock); in plip_send_packet()
785 dev->stats.collisions++; in plip_send_packet()
790 spin_unlock_irq(&nl->lock); in plip_send_packet()
791 DISABLE(dev->irq); in plip_send_packet()
792 synchronize_irq(dev->irq); in plip_send_packet()
793 if (nl->connection == PLIP_CN_RECEIVE) { in plip_send_packet()
799 them. -- AV */ in plip_send_packet()
800 ENABLE(dev->irq); in plip_send_packet()
801 dev->stats.collisions++; in plip_send_packet()
806 printk(KERN_DEBUG "%s: send start\n", dev->name); in plip_send_packet()
807 snd->state = PLIP_PK_LENGTH_LSB; in plip_send_packet()
808 snd->nibble = PLIP_NB_BEGIN; in plip_send_packet()
809 nl->timeout_count = 0; in plip_send_packet()
812 spin_unlock_irq(&nl->lock); in plip_send_packet()
813 if (--cx == 0) { in plip_send_packet()
822 &snd->nibble, snd->length.b.lsb)) in plip_send_packet()
824 snd->state = PLIP_PK_LENGTH_MSB; in plip_send_packet()
829 &snd->nibble, snd->length.b.msb)) in plip_send_packet()
831 snd->state = PLIP_PK_DATA; in plip_send_packet()
832 snd->byte = 0; in plip_send_packet()
833 snd->checksum = 0; in plip_send_packet()
839 &snd->nibble, lbuf[snd->byte])) in plip_send_packet()
841 } while (++snd->byte < snd->length.h); in plip_send_packet()
843 snd->checksum += lbuf[--snd->byte]; in plip_send_packet()
844 } while (snd->byte); in plip_send_packet()
845 snd->state = PLIP_PK_CHECKSUM; in plip_send_packet()
850 &snd->nibble, snd->checksum)) in plip_send_packet()
853 dev->stats.tx_bytes += snd->skb->len; in plip_send_packet()
854 dev_kfree_skb(snd->skb); in plip_send_packet()
855 dev->stats.tx_packets++; in plip_send_packet()
856 snd->state = PLIP_PK_DONE; in plip_send_packet()
862 snd->skb = NULL; in plip_send_packet()
864 printk(KERN_DEBUG "%s: send end\n", dev->name); in plip_send_packet()
865 nl->connection = PLIP_CN_CLOSING; in plip_send_packet()
866 nl->is_deferred = 1; in plip_send_packet()
867 schedule_delayed_work(&nl->deferred, 1); in plip_send_packet()
869 ENABLE(dev->irq); in plip_send_packet()
879 spin_lock_irq(&nl->lock); in plip_connection_close()
880 if (nl->connection == PLIP_CN_CLOSING) { in plip_connection_close()
881 nl->connection = PLIP_CN_NONE; in plip_connection_close()
884 spin_unlock_irq(&nl->lock); in plip_connection_close()
885 if (nl->should_relinquish) { in plip_connection_close()
886 nl->should_relinquish = nl->port_owner = 0; in plip_connection_close()
887 parport_release(nl->pardev); in plip_connection_close()
892 /* PLIP_ERROR --- wait till other end settled */
902 printk(KERN_DEBUG "%s: reset interface.\n", dev->name); in plip_error()
903 nl->connection = PLIP_CN_NONE; in plip_error()
904 nl->should_relinquish = 0; in plip_error()
907 ENABLE(dev->irq); in plip_error()
910 nl->is_deferred = 1; in plip_error()
911 schedule_delayed_work(&nl->deferred, 1); in plip_error()
928 rcv = &nl->rcv_data; in plip_interrupt()
930 spin_lock_irqsave (&nl->lock, flags); in plip_interrupt()
934 if ((dev->irq != -1) && (net_debug > 1)) in plip_interrupt()
935 printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); in plip_interrupt()
936 spin_unlock_irqrestore (&nl->lock, flags); in plip_interrupt()
941 printk(KERN_DEBUG "%s: interrupt.\n", dev->name); in plip_interrupt()
943 switch (nl->connection) { in plip_interrupt()
949 rcv->state = PLIP_PK_TRIGGER; in plip_interrupt()
950 nl->connection = PLIP_CN_RECEIVE; in plip_interrupt()
951 nl->timeout_count = 0; in plip_interrupt()
952 schedule_work(&nl->immediate); in plip_interrupt()
957 around test and set of dev->interrupt. in plip_interrupt()
962 printk(KERN_ERR "%s: receive interrupt in error state\n", dev->name); in plip_interrupt()
966 spin_unlock_irqrestore(&nl->lock, flags); in plip_interrupt()
973 struct plip_local *snd = &nl->snd_data; in plip_tx_packet()
979 if (!nl->port_owner) { in plip_tx_packet()
980 if (parport_claim(nl->pardev)) in plip_tx_packet()
982 nl->port_owner = 1; in plip_tx_packet()
987 if (skb->len > dev->mtu + dev->hard_header_len) { in plip_tx_packet()
988 printk(KERN_WARNING "%s: packet too big, %d.\n", dev->name, (int)skb->len); in plip_tx_packet()
994 printk(KERN_DEBUG "%s: send request\n", dev->name); in plip_tx_packet()
996 spin_lock_irq(&nl->lock); in plip_tx_packet()
997 snd->skb = skb; in plip_tx_packet()
998 snd->length.h = skb->len; in plip_tx_packet()
999 snd->state = PLIP_PK_TRIGGER; in plip_tx_packet()
1000 if (nl->connection == PLIP_CN_NONE) { in plip_tx_packet()
1001 nl->connection = PLIP_CN_SEND; in plip_tx_packet()
1002 nl->timeout_count = 0; in plip_tx_packet()
1004 schedule_work(&nl->immediate); in plip_tx_packet()
1005 spin_unlock_irq(&nl->lock); in plip_tx_packet()
1018 /* Any address will do - we take the first */ in plip_rewrite_address()
1019 const struct in_ifaddr *ifa = rcu_dereference(in_dev->ifa_list); in plip_rewrite_address()
1021 memcpy(eth->h_source, dev->dev_addr, ETH_ALEN); in plip_rewrite_address()
1022 memset(eth->h_dest, 0xfc, 2); in plip_rewrite_address()
1023 memcpy(eth->h_dest+2, &ifa->ifa_address, 4); in plip_rewrite_address()
1038 plip_rewrite_address (dev, (struct ethhdr *)skb->data); in plip_hard_header()
1052 eth = (struct ethhdr*)(((u8*)hh->hh_data) + in plip_hard_header_cache()
1054 plip_rewrite_address (neigh->dev, eth); in plip_hard_header_cache()
1073 if (!nl->port_owner) { in plip_open()
1074 if (parport_claim(nl->pardev)) return -EAGAIN; in plip_open()
1075 nl->port_owner = 1; in plip_open()
1078 nl->should_relinquish = 0; in plip_open()
1085 if (dev->irq == -1) in plip_open()
1087 atomic_set (&nl->kill_timer, 0); in plip_open()
1088 schedule_delayed_work(&nl->timer, 1); in plip_open()
1092 nl->rcv_data.state = nl->snd_data.state = PLIP_PK_DONE; in plip_open()
1093 nl->rcv_data.skb = nl->snd_data.skb = NULL; in plip_open()
1094 nl->connection = PLIP_CN_NONE; in plip_open()
1095 nl->is_deferred = 0; in plip_open()
1097 /* Fill in the MAC-level header. in plip_open()
1098 We used to abuse dev->broadcast to store the point-to-point in plip_open()
1101 because we use the hh_cache. Actually, abusing dev->broadcast in plip_open()
1102 didn't work, because when using plip_open the point-to-point in plip_open()
1111 /* Any address will do - we take the first. We already in plip_open()
1114 const struct in_ifaddr *ifa = rtnl_dereference(in_dev->ifa_list); in plip_open()
1116 dev_addr_mod(dev, 2, &ifa->ifa_local, 4); in plip_open()
1130 struct plip_local *snd = &nl->snd_data; in plip_close()
1131 struct plip_local *rcv = &nl->rcv_data; in plip_close()
1134 DISABLE(dev->irq); in plip_close()
1135 synchronize_irq(dev->irq); in plip_close()
1137 if (dev->irq == -1) in plip_close()
1139 init_completion(&nl->killed_timer_cmp); in plip_close()
1140 atomic_set (&nl->kill_timer, 1); in plip_close()
1141 wait_for_completion(&nl->killed_timer_cmp); in plip_close()
1147 nl->is_deferred = 0; in plip_close()
1148 nl->connection = PLIP_CN_NONE; in plip_close()
1149 if (nl->port_owner) { in plip_close()
1150 parport_release(nl->pardev); in plip_close()
1151 nl->port_owner = 0; in plip_close()
1154 snd->state = PLIP_PK_DONE; in plip_close()
1155 if (snd->skb) { in plip_close()
1156 dev_kfree_skb(snd->skb); in plip_close()
1157 snd->skb = NULL; in plip_close()
1159 rcv->state = PLIP_PK_DONE; in plip_close()
1160 if (rcv->skb) { in plip_close()
1161 kfree_skb(rcv->skb); in plip_close()
1162 rcv->skb = NULL; in plip_close()
1179 if (nl->connection != PLIP_CN_NONE) { in plip_preempt()
1180 nl->should_relinquish = 1; in plip_preempt()
1184 nl->port_owner = 0; /* Remember that we released the bus */ in plip_preempt()
1194 if (nl->port_owner) { in plip_wakeup()
1196 printk(KERN_DEBUG "%s: why am I being woken up?\n", dev->name); in plip_wakeup()
1197 if (!parport_claim(nl->pardev)) in plip_wakeup()
1199 printk(KERN_DEBUG "%s: I'm broken.\n", dev->name); in plip_wakeup()
1204 if (!(dev->flags & IFF_UP)) in plip_wakeup()
1208 if (!parport_claim(nl->pardev)) { in plip_wakeup()
1209 nl->port_owner = 1; in plip_wakeup()
1220 struct plipconf *pc = (struct plipconf *) &rq->ifr_ifru; in plip_siocdevprivate() local
1223 return -EOPNOTSUPP; in plip_siocdevprivate()
1226 return -EOPNOTSUPP; in plip_siocdevprivate()
1228 switch(pc->pcmd) { in plip_siocdevprivate()
1230 pc->trigger = nl->trigger; in plip_siocdevprivate()
1231 pc->nibble = nl->nibble; in plip_siocdevprivate()
1235 return -EPERM; in plip_siocdevprivate()
1236 nl->trigger = pc->trigger; in plip_siocdevprivate()
1237 nl->nibble = pc->nibble; in plip_siocdevprivate()
1240 return -EOPNOTSUPP; in plip_siocdevprivate()
1245 static int parport[PLIP_MAX] = { [0 ... PLIP_MAX-1] = -1 };
1258 for (i = 0; i < PLIP_MAX && list[i] != -1; i++) { in plip_searchfor()
1274 if ((parport[0] == -1 && (!timid || !port->devices)) || in plip_attach()
1275 plip_searchfor(parport, port->number)) { in plip_attach()
1286 strcpy(dev->name, name); in plip_attach()
1288 dev->irq = port->irq; in plip_attach()
1289 dev->base_addr = port->base; in plip_attach()
1290 if (port->irq == -1) { in plip_attach()
1291 printk(KERN_INFO "plip: %s has no IRQ. Using IRQ-less mode," in plip_attach()
1292 "which is fairly inefficient!\n", port->name); in plip_attach()
1296 nl->dev = dev; in plip_attach()
1304 nl->pardev = parport_register_dev_model(port, dev->name, in plip_attach()
1307 if (!nl->pardev) { in plip_attach()
1320 if (dev->irq != -1) in plip_attach()
1323 dev->name, dev->base_addr, dev->irq); in plip_attach()
1327 dev->name, dev->base_addr); in plip_attach()
1333 parport_unregister_device(nl->pardev); in plip_attach()
1347 struct device_driver *drv = par_dev->dev.driver; in plip_probe()
1348 int len = strlen(drv->name); in plip_probe()
1350 if (strncmp(par_dev->name, drv->name, len)) in plip_probe()
1351 return -ENODEV; in plip_probe()
1372 if (nl->port_owner) in plip_cleanup_module()
1373 parport_release(nl->pardev); in plip_cleanup_module()
1374 parport_unregister_device(nl->pardev); in plip_cleanup_module()
1406 parport[0] = -2; in plip_setup()
1421 if (parport[0] == -2) in plip_init()
1424 if (parport[0] != -1 && timid) { in plip_init()