Lines Matching +full:ns +full:- +full:firmware
1 // SPDX-License-Identifier: GPL-2.0-or-later
28 Merged with 2.2 - Alan Cox
151 int error = -ENODEV; in sb1000_probe_one()
155 return -ENODEV; in sb1000_probe_one()
164 serial_number = pdev->card->serial; in sb1000_probe_one()
178 error = -ENOMEM; in sb1000_probe_one()
183 dev->base_addr = ioaddr[0]; in sb1000_probe_one()
185 dev->mem_start = ioaddr[1]; in sb1000_probe_one()
186 dev->irq = irq; in sb1000_probe_one()
190 "S/N %#8.8x, IRQ %d.\n", dev->name, dev->base_addr, in sb1000_probe_one()
191 dev->mem_start, serial_number, dev->irq); in sb1000_probe_one()
194 * The SB1000 is an rx-only cable modem device. The uplink is a modem in sb1000_probe_one()
197 dev->flags = IFF_POINTOPOINT|IFF_NOARP; in sb1000_probe_one()
199 SET_NETDEV_DEV(dev, &pdev->dev); in sb1000_probe_one()
204 dev->netdev_ops = &sb1000_netdev_ops; in sb1000_probe_one()
241 release_region(dev->base_addr, 16); in sb1000_remove_one()
242 release_region(dev->mem_start, 16); in sb1000_remove_one()
277 return -ETIME; in card_wait_for_busy_clear()
301 return -ETIME; in card_wait_for_ready()
351 return -EIO; in card_send_command()
373 return -ETIME; in sb1000_wait_for_ready()
381 return -ETIME; in sb1000_wait_for_ready()
399 return -ETIME; in sb1000_wait_for_ready_clear()
407 return -ETIME; in sb1000_wait_for_ready_clear()
481 return -EIO; in sb1000_reset()
485 /* check SB1000 firmware CRC */
498 return -EIO; in sb1000_check_CRC()
546 return -EIO; in sb1000_activate()
552 /* get SB1000 firmware version */
567 return -EIO; in sb1000_get_firmware_version()
609 return -EINVAL; in sb1000_set_frequency()
748 int ioaddr, ns; in sb1000_rx() local
752 struct net_device_stats *stats = &dev->stats; in sb1000_rx()
758 const int NewDatagramDataSize = FrameSize - NewDatagramHeaderSize; in sb1000_rx()
761 const int ContDatagramDataSize = FrameSize - ContDatagramHeaderSize; in sb1000_rx()
764 ioaddr = dev->base_addr; in sb1000_rx()
770 lp->rx_frames++; in sb1000_rx()
773 for (ns = 0; ns < NPIDS; ns++) { in sb1000_rx()
774 session_id = lp->rx_session_id[ns]; in sb1000_rx()
775 frame_id = lp->rx_frame_id[ns]; in sb1000_rx()
795 stats->rx_frame_errors++; in sb1000_rx()
796 skb = lp->rx_skb[ns]; in sb1000_rx()
799 "expecting %02x %02x\n", dev->name, st[0], st[1], in sb1000_rx()
807 lp->rx_frame_id[ns] = 0x30 | ((st[1] + 1) & 0x0f); in sb1000_rx()
818 "got %02x expecting %02x\n", dev->name, buffer[0], in sb1000_rx()
820 stats->rx_length_errors++; in sb1000_rx()
825 buffer[NewDatagramHeaderSkip + 4]) - 17; in sb1000_rx()
829 "than MRU (%d)\n", dev->name, dlen, SB1000_MRU); in sb1000_rx()
830 stats->rx_length_errors++; in sb1000_rx()
834 lp->rx_dlen[ns] = dlen; in sb1000_rx()
840 "skbuff\n", dev->name, skbsize); in sb1000_rx()
841 stats->rx_dropped++; in sb1000_rx()
845 skb->dev = dev; in sb1000_rx()
847 skb->protocol = (unsigned short) buffer[NewDatagramHeaderSkip + 16]; in sb1000_rx()
850 lp->rx_skb[ns] = skb; in sb1000_rx()
857 "got %02x expecting %02x\n", dev->name, buffer[0], in sb1000_rx()
859 stats->rx_length_errors++; in sb1000_rx()
863 skb = lp->rx_skb[ns]; in sb1000_rx()
866 dlen = lp->rx_dlen[ns]; in sb1000_rx()
868 if (skb->len < dlen + TrailerSize) { in sb1000_rx()
869 lp->rx_session_id[ns] &= ~0x40; in sb1000_rx()
876 stats->rx_bytes+=dlen; in sb1000_rx()
877 stats->rx_packets++; in sb1000_rx()
878 lp->rx_skb[ns] = NULL; in sb1000_rx()
879 lp->rx_session_id[ns] |= 0x40; in sb1000_rx()
886 dev->name, st[0], st[1]); in sb1000_rx()
887 stats->rx_frame_errors++; in sb1000_rx()
890 sb1000_print_status_buffer(dev->name, st, buffer, FrameSize); in sb1000_rx()
892 stats->rx_errors++; in sb1000_rx()
893 if (ns < NPIDS) { in sb1000_rx()
894 if ((skb = lp->rx_skb[ns])) { in sb1000_rx()
896 lp->rx_skb[ns] = NULL; in sb1000_rx()
898 lp->rx_session_id[ns] |= 0x40; in sb1000_rx()
900 return -1; in sb1000_rx()
914 ioaddr[0] = dev->base_addr; in sb1000_error_dpc()
916 ioaddr[1] = dev->mem_start; in sb1000_error_dpc()
917 name = dev->name; in sb1000_error_dpc()
924 lp->rx_error_dpc_count = ErrorDpcCounterInitialize; in sb1000_error_dpc()
939 ioaddr[0] = dev->base_addr; in sb1000_open()
941 ioaddr[1] = dev->mem_start; in sb1000_open()
942 name = dev->name; in sb1000_open()
952 lp->rx_skb[0] = NULL; in sb1000_open()
953 lp->rx_skb[1] = NULL; in sb1000_open()
954 lp->rx_skb[2] = NULL; in sb1000_open()
955 lp->rx_skb[3] = NULL; in sb1000_open()
956 lp->rx_dlen[0] = 0; in sb1000_open()
957 lp->rx_dlen[1] = 0; in sb1000_open()
958 lp->rx_dlen[2] = 0; in sb1000_open()
959 lp->rx_dlen[3] = 0; in sb1000_open()
960 lp->rx_frames = 0; in sb1000_open()
961 lp->rx_error_count = 0; in sb1000_open()
962 lp->rx_error_dpc_count = 0; in sb1000_open()
963 lp->rx_session_id[0] = 0x50; in sb1000_open()
964 lp->rx_session_id[1] = 0x48; in sb1000_open()
965 lp->rx_session_id[2] = 0x44; in sb1000_open()
966 lp->rx_session_id[3] = 0x42; in sb1000_open()
967 lp->rx_frame_id[0] = 0; in sb1000_open()
968 lp->rx_frame_id[1] = 0; in sb1000_open()
969 lp->rx_frame_id[2] = 0; in sb1000_open()
970 lp->rx_frame_id[3] = 0; in sb1000_open()
971 if (request_irq(dev->irq, sb1000_interrupt, 0, "sb1000", dev)) { in sb1000_open()
972 return -EAGAIN; in sb1000_open()
976 printk(KERN_DEBUG "%s: Opening, IRQ %d\n", name, dev->irq); in sb1000_open()
978 /* Activate board and check firmware version */ in sb1000_open()
986 printk(KERN_WARNING "%s: found firmware version %x.%02x " in sb1000_open()
1005 if (!(dev && dev->flags & IFF_UP)) in sb1000_siocdevprivate()
1006 return -ENODEV; in sb1000_siocdevprivate()
1008 ioaddr[0] = dev->base_addr; in sb1000_siocdevprivate()
1010 ioaddr[1] = dev->mem_start; in sb1000_siocdevprivate()
1011 name = dev->name; in sb1000_siocdevprivate()
1015 stats[0] = dev->stats.rx_bytes; in sb1000_siocdevprivate()
1016 stats[1] = lp->rx_frames; in sb1000_siocdevprivate()
1017 stats[2] = dev->stats.rx_packets; in sb1000_siocdevprivate()
1018 stats[3] = dev->stats.rx_errors; in sb1000_siocdevprivate()
1019 stats[4] = dev->stats.rx_dropped; in sb1000_siocdevprivate()
1021 return -EFAULT; in sb1000_siocdevprivate()
1025 case SIOCGCMFIRMWARE: /* get firmware version */ in sb1000_siocdevprivate()
1029 return -EFAULT; in sb1000_siocdevprivate()
1036 return -EFAULT; in sb1000_siocdevprivate()
1041 return -EPERM; in sb1000_siocdevprivate()
1043 return -EFAULT; in sb1000_siocdevprivate()
1052 return -EFAULT; in sb1000_siocdevprivate()
1057 return -EPERM; in sb1000_siocdevprivate()
1059 return -EFAULT; in sb1000_siocdevprivate()
1063 lp->rx_session_id[0] = 0x50 | (PID[0] & 0x0f); in sb1000_siocdevprivate()
1064 lp->rx_session_id[1] = 0x48; in sb1000_siocdevprivate()
1065 lp->rx_session_id[2] = 0x44; in sb1000_siocdevprivate()
1066 lp->rx_session_id[3] = 0x42; in sb1000_siocdevprivate()
1067 lp->rx_frame_id[0] = 0; in sb1000_siocdevprivate()
1068 lp->rx_frame_id[1] = 0; in sb1000_siocdevprivate()
1069 lp->rx_frame_id[2] = 0; in sb1000_siocdevprivate()
1070 lp->rx_frame_id[3] = 0; in sb1000_siocdevprivate()
1074 status = -EINVAL; in sb1000_siocdevprivate()
1084 printk(KERN_WARNING "%s: trying to transmit!!!\n", dev->name); in sb1000_start_xmit()
1104 ioaddr[0] = dev->base_addr; in sb1000_interrupt()
1106 ioaddr[1] = dev->mem_start; in sb1000_interrupt()
1107 name = dev->name; in sb1000_interrupt()
1116 printk(KERN_DEBUG "%s: entering interrupt\n", dev->name); in sb1000_interrupt()
1120 lp->rx_error_count++; in sb1000_interrupt()
1129 if (lp->rx_error_dpc_count && !(--lp->rx_error_dpc_count)) { in sb1000_interrupt()
1135 if (lp->rx_error_count >= MaxRxErrorCount) { in sb1000_interrupt()
1140 lp->rx_error_count = 0; in sb1000_interrupt()
1153 printk(KERN_DEBUG "%s: Shutting down sb1000.\n", dev->name); in sb1000_close()
1157 ioaddr[0] = dev->base_addr; in sb1000_close()
1159 ioaddr[1] = dev->mem_start; in sb1000_close()
1161 free_irq(dev->irq, dev); in sb1000_close()
1162 /* If we don't do this, we can't re-insmod it later. */ in sb1000_close()
1168 if (lp->rx_skb[i]) { in sb1000_close()
1169 dev_kfree_skb(lp->rx_skb[i]); in sb1000_close()