diff options
Diffstat (limited to 'drivers/net')
118 files changed, 1127 insertions, 561 deletions
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 8ae72ec14456..0e2ba21d4441 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -908,6 +908,7 @@ static const struct net_device_ops rtl8139_netdev_ops = { | |||
908 | .ndo_open = rtl8139_open, | 908 | .ndo_open = rtl8139_open, |
909 | .ndo_stop = rtl8139_close, | 909 | .ndo_stop = rtl8139_close, |
910 | .ndo_get_stats = rtl8139_get_stats, | 910 | .ndo_get_stats = rtl8139_get_stats, |
911 | .ndo_change_mtu = eth_change_mtu, | ||
911 | .ndo_validate_addr = eth_validate_addr, | 912 | .ndo_validate_addr = eth_validate_addr, |
912 | .ndo_set_mac_address = rtl8139_set_mac_address, | 913 | .ndo_set_mac_address = rtl8139_set_mac_address, |
913 | .ndo_start_xmit = rtl8139_start_xmit, | 914 | .ndo_start_xmit = rtl8139_start_xmit, |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 1dc721517e4c..c155bd3ec9f1 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1725,6 +1725,7 @@ config TLAN | |||
1725 | 1725 | ||
1726 | config KS8842 | 1726 | config KS8842 |
1727 | tristate "Micrel KSZ8842" | 1727 | tristate "Micrel KSZ8842" |
1728 | depends on HAS_IOMEM | ||
1728 | help | 1729 | help |
1729 | This platform driver is for Micrel KSZ8842 chip. | 1730 | This platform driver is for Micrel KSZ8842 chip. |
1730 | 1731 | ||
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index 85a18175730b..08787f5a22a3 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c | |||
@@ -569,16 +569,8 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
569 | 569 | ||
570 | #ifdef DEBUG_DRIVER | 570 | #ifdef DEBUG_DRIVER |
571 | /* dump the packet */ | 571 | /* dump the packet */ |
572 | { | 572 | print_hex_dump(KERN_DEBUG, "skb->data: ", DUMP_PREFIX_NONE, |
573 | int i; | 573 | 16, 1, skb->data, 64, true); |
574 | |||
575 | for (i = 0; i < 64; i++) { | ||
576 | if ((i % 16) == 0) | ||
577 | printk("\n" KERN_DEBUG); | ||
578 | printk ("%2.2x ", skb->data [i]); | ||
579 | } | ||
580 | printk("\n"); | ||
581 | } | ||
582 | #endif | 574 | #endif |
583 | entry = lp->tx_new & lp->tx_ring_mod_mask; | 575 | entry = lp->tx_new & lp->tx_ring_mod_mask; |
584 | ib->btx_ring [entry].length = (-skblen) | 0xf000; | 576 | ib->btx_ring [entry].length = (-skblen) | 0xf000; |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index d6d4ab3b430c..7d227cdab9f8 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -158,15 +158,12 @@ module_exit(arcnet_exit); | |||
158 | void arcnet_dump_skb(struct net_device *dev, | 158 | void arcnet_dump_skb(struct net_device *dev, |
159 | struct sk_buff *skb, char *desc) | 159 | struct sk_buff *skb, char *desc) |
160 | { | 160 | { |
161 | int i; | 161 | char hdr[32]; |
162 | 162 | ||
163 | printk(KERN_DEBUG "%6s: skb dump (%s) follows:", dev->name, desc); | 163 | /* dump the packet */ |
164 | for (i = 0; i < skb->len; i++) { | 164 | snprintf(hdr, sizeof(hdr), "%6s:%s skb->data:", dev->name, desc); |
165 | if (i % 16 == 0) | 165 | print_hex_dump(KERN_DEBUG, hdr, DUMP_PREFIX_OFFSET, |
166 | printk("\n" KERN_DEBUG "[%04X] ", i); | 166 | 16, 1, skb->data, skb->len, true); |
167 | printk("%02X ", ((u_char *) skb->data)[i]); | ||
168 | } | ||
169 | printk("\n"); | ||
170 | } | 167 | } |
171 | 168 | ||
172 | EXPORT_SYMBOL(arcnet_dump_skb); | 169 | EXPORT_SYMBOL(arcnet_dump_skb); |
@@ -184,6 +181,7 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum, | |||
184 | int i, length; | 181 | int i, length; |
185 | unsigned long flags = 0; | 182 | unsigned long flags = 0; |
186 | static uint8_t buf[512]; | 183 | static uint8_t buf[512]; |
184 | char hdr[32]; | ||
187 | 185 | ||
188 | /* hw.copy_from_card expects IRQ context so take the IRQ lock | 186 | /* hw.copy_from_card expects IRQ context so take the IRQ lock |
189 | to keep it single threaded */ | 187 | to keep it single threaded */ |
@@ -197,14 +195,10 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum, | |||
197 | /* if the offset[0] byte is nonzero, this is a 256-byte packet */ | 195 | /* if the offset[0] byte is nonzero, this is a 256-byte packet */ |
198 | length = (buf[2] ? 256 : 512); | 196 | length = (buf[2] ? 256 : 512); |
199 | 197 | ||
200 | printk(KERN_DEBUG "%6s: packet dump (%s) follows:", dev->name, desc); | 198 | /* dump the packet */ |
201 | for (i = 0; i < length; i++) { | 199 | snprintf(hdr, sizeof(hdr), "%6s:%s packet dump:", dev->name, desc); |
202 | if (i % 16 == 0) | 200 | print_hex_dump(KERN_DEBUG, hdr, DUMP_PREFIX_OFFSET, |
203 | printk("\n" KERN_DEBUG "[%04X] ", i); | 201 | 16, 1, buf, length, true); |
204 | printk("%02X ", buf[i]); | ||
205 | } | ||
206 | printk("\n"); | ||
207 | |||
208 | } | 202 | } |
209 | 203 | ||
210 | #else | 204 | #else |
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index 6f42ad728915..3fe09876e76d 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c | |||
@@ -1142,7 +1142,9 @@ static const struct net_device_ops ixp4xx_netdev_ops = { | |||
1142 | .ndo_start_xmit = eth_xmit, | 1142 | .ndo_start_xmit = eth_xmit, |
1143 | .ndo_set_multicast_list = eth_set_mcast_list, | 1143 | .ndo_set_multicast_list = eth_set_mcast_list, |
1144 | .ndo_do_ioctl = eth_ioctl, | 1144 | .ndo_do_ioctl = eth_ioctl, |
1145 | 1145 | .ndo_change_mtu = eth_change_mtu, | |
1146 | .ndo_set_mac_address = eth_mac_addr, | ||
1147 | .ndo_validate_addr = eth_validate_addr, | ||
1146 | }; | 1148 | }; |
1147 | 1149 | ||
1148 | static int __devinit eth_init_one(struct platform_device *pdev) | 1150 | static int __devinit eth_init_one(struct platform_device *pdev) |
diff --git a/drivers/net/atl1c/atl1c_ethtool.c b/drivers/net/atl1c/atl1c_ethtool.c index e4afbd628c23..607007d75b6f 100644 --- a/drivers/net/atl1c/atl1c_ethtool.c +++ b/drivers/net/atl1c/atl1c_ethtool.c | |||
@@ -281,6 +281,8 @@ static int atl1c_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
281 | if (wol->wolopts & WAKE_PHY) | 281 | if (wol->wolopts & WAKE_PHY) |
282 | adapter->wol |= AT_WUFC_LNKC; | 282 | adapter->wol |= AT_WUFC_LNKC; |
283 | 283 | ||
284 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
285 | |||
284 | return 0; | 286 | return 0; |
285 | } | 287 | } |
286 | 288 | ||
diff --git a/drivers/net/atl1e/atl1e_ethtool.c b/drivers/net/atl1e/atl1e_ethtool.c index 619c6583e1aa..4003955d7a96 100644 --- a/drivers/net/atl1e/atl1e_ethtool.c +++ b/drivers/net/atl1e/atl1e_ethtool.c | |||
@@ -365,6 +365,8 @@ static int atl1e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
365 | if (wol->wolopts & WAKE_PHY) | 365 | if (wol->wolopts & WAKE_PHY) |
366 | adapter->wol |= AT_WUFC_LNKC; | 366 | adapter->wol |= AT_WUFC_LNKC; |
367 | 367 | ||
368 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
369 | |||
368 | return 0; | 370 | return 0; |
369 | } | 371 | } |
370 | 372 | ||
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c index c734b1983ec1..204db961029e 100644 --- a/drivers/net/atlx/atl2.c +++ b/drivers/net/atlx/atl2.c | |||
@@ -2071,7 +2071,7 @@ static int atl2_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
2071 | if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)) | 2071 | if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)) |
2072 | return -EOPNOTSUPP; | 2072 | return -EOPNOTSUPP; |
2073 | 2073 | ||
2074 | if (wol->wolopts & (WAKE_MCAST|WAKE_BCAST|WAKE_MCAST)) | 2074 | if (wol->wolopts & (WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)) |
2075 | return -EOPNOTSUPP; | 2075 | return -EOPNOTSUPP; |
2076 | 2076 | ||
2077 | /* these settings will always override what we currently have */ | 2077 | /* these settings will always override what we currently have */ |
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index f703758f0a6e..5b4bf3d2cdc2 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -73,7 +73,7 @@ static inline char *nic_name(struct pci_dev *pdev) | |||
73 | #define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST) | 73 | #define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST) |
74 | 74 | ||
75 | #define BE_MAX_LRO_DESCRIPTORS 16 | 75 | #define BE_MAX_LRO_DESCRIPTORS 16 |
76 | #define BE_MAX_FRAGS_PER_FRAME 16 | 76 | #define BE_MAX_FRAGS_PER_FRAME (min((u32) 16, (u32) MAX_SKB_FRAGS)) |
77 | 77 | ||
78 | struct be_dma_mem { | 78 | struct be_dma_mem { |
79 | void *va; | 79 | void *va; |
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index 9592f22e4c8c..cccc5419ad72 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -162,8 +162,8 @@ be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce) | |||
162 | return -EINVAL; | 162 | return -EINVAL; |
163 | 163 | ||
164 | adapter->max_rx_coal = coalesce->rx_max_coalesced_frames; | 164 | adapter->max_rx_coal = coalesce->rx_max_coalesced_frames; |
165 | if (adapter->max_rx_coal > MAX_SKB_FRAGS) | 165 | if (adapter->max_rx_coal > BE_MAX_FRAGS_PER_FRAME) |
166 | adapter->max_rx_coal = MAX_SKB_FRAGS - 1; | 166 | adapter->max_rx_coal = BE_MAX_FRAGS_PER_FRAME; |
167 | 167 | ||
168 | /* if AIC is being turned on now, start with an EQD of 0 */ | 168 | /* if AIC is being turned on now, start with an EQD of 0 */ |
169 | if (rx_eq->enable_aic == 0 && | 169 | if (rx_eq->enable_aic == 0 && |
diff --git a/drivers/net/benet/be_hw.h b/drivers/net/benet/be_hw.h index b02e805c1db3..29c33c709c6d 100644 --- a/drivers/net/benet/be_hw.h +++ b/drivers/net/benet/be_hw.h | |||
@@ -55,6 +55,10 @@ | |||
55 | #define MEMBAR_CTRL_INT_CTRL_PFUNC_MASK 0x7 /* bits 26 - 28 */ | 55 | #define MEMBAR_CTRL_INT_CTRL_PFUNC_MASK 0x7 /* bits 26 - 28 */ |
56 | #define MEMBAR_CTRL_INT_CTRL_PFUNC_SHIFT 26 | 56 | #define MEMBAR_CTRL_INT_CTRL_PFUNC_SHIFT 26 |
57 | 57 | ||
58 | /********* ISR0 Register offset **********/ | ||
59 | #define CEV_ISR0_OFFSET 0xC18 | ||
60 | #define CEV_ISR_SIZE 4 | ||
61 | |||
58 | /********* Event Q door bell *************/ | 62 | /********* Event Q door bell *************/ |
59 | #define DB_EQ_OFFSET DB_CQ_OFFSET | 63 | #define DB_EQ_OFFSET DB_CQ_OFFSET |
60 | #define DB_EQ_RING_ID_MASK 0x1FF /* bits 0 - 8 */ | 64 | #define DB_EQ_RING_ID_MASK 0x1FF /* bits 0 - 8 */ |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 66c10c87f517..c43f6a119295 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -666,7 +666,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter, | |||
666 | { | 666 | { |
667 | struct be_queue_info *rxq = &adapter->rx_obj.q; | 667 | struct be_queue_info *rxq = &adapter->rx_obj.q; |
668 | struct be_rx_page_info *page_info; | 668 | struct be_rx_page_info *page_info; |
669 | u16 rxq_idx, i, num_rcvd; | 669 | u16 rxq_idx, i, num_rcvd, j; |
670 | u32 pktsize, hdr_len, curr_frag_len; | 670 | u32 pktsize, hdr_len, curr_frag_len; |
671 | u8 *start; | 671 | u8 *start; |
672 | 672 | ||
@@ -709,22 +709,33 @@ static void skb_fill_rx_data(struct be_adapter *adapter, | |||
709 | 709 | ||
710 | /* More frags present for this completion */ | 710 | /* More frags present for this completion */ |
711 | pktsize -= curr_frag_len; /* account for above copied frag */ | 711 | pktsize -= curr_frag_len; /* account for above copied frag */ |
712 | for (i = 1; i < num_rcvd; i++) { | 712 | for (i = 1, j = 0; i < num_rcvd; i++) { |
713 | index_inc(&rxq_idx, rxq->len); | 713 | index_inc(&rxq_idx, rxq->len); |
714 | page_info = get_rx_page_info(adapter, rxq_idx); | 714 | page_info = get_rx_page_info(adapter, rxq_idx); |
715 | 715 | ||
716 | curr_frag_len = min(pktsize, rx_frag_size); | 716 | curr_frag_len = min(pktsize, rx_frag_size); |
717 | 717 | ||
718 | skb_shinfo(skb)->frags[i].page = page_info->page; | 718 | /* Coalesce all frags from the same physical page in one slot */ |
719 | skb_shinfo(skb)->frags[i].page_offset = page_info->page_offset; | 719 | if (page_info->page_offset == 0) { |
720 | skb_shinfo(skb)->frags[i].size = curr_frag_len; | 720 | /* Fresh page */ |
721 | j++; | ||
722 | skb_shinfo(skb)->frags[j].page = page_info->page; | ||
723 | skb_shinfo(skb)->frags[j].page_offset = | ||
724 | page_info->page_offset; | ||
725 | skb_shinfo(skb)->frags[j].size = 0; | ||
726 | skb_shinfo(skb)->nr_frags++; | ||
727 | } else { | ||
728 | put_page(page_info->page); | ||
729 | } | ||
730 | |||
731 | skb_shinfo(skb)->frags[j].size += curr_frag_len; | ||
721 | skb->len += curr_frag_len; | 732 | skb->len += curr_frag_len; |
722 | skb->data_len += curr_frag_len; | 733 | skb->data_len += curr_frag_len; |
723 | skb_shinfo(skb)->nr_frags++; | ||
724 | pktsize -= curr_frag_len; | 734 | pktsize -= curr_frag_len; |
725 | 735 | ||
726 | memset(page_info, 0, sizeof(*page_info)); | 736 | memset(page_info, 0, sizeof(*page_info)); |
727 | } | 737 | } |
738 | BUG_ON(j > MAX_SKB_FRAGS); | ||
728 | 739 | ||
729 | done: | 740 | done: |
730 | be_rx_stats_update(adapter, pktsize, num_rcvd); | 741 | be_rx_stats_update(adapter, pktsize, num_rcvd); |
@@ -786,7 +797,7 @@ static void be_rx_compl_process_lro(struct be_adapter *adapter, | |||
786 | struct skb_frag_struct rx_frags[BE_MAX_FRAGS_PER_FRAME]; | 797 | struct skb_frag_struct rx_frags[BE_MAX_FRAGS_PER_FRAME]; |
787 | struct be_queue_info *rxq = &adapter->rx_obj.q; | 798 | struct be_queue_info *rxq = &adapter->rx_obj.q; |
788 | u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; | 799 | u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; |
789 | u16 i, rxq_idx = 0, vid; | 800 | u16 i, rxq_idx = 0, vid, j; |
790 | 801 | ||
791 | num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); | 802 | num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); |
792 | pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); | 803 | pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); |
@@ -794,20 +805,28 @@ static void be_rx_compl_process_lro(struct be_adapter *adapter, | |||
794 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); | 805 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); |
795 | 806 | ||
796 | remaining = pkt_size; | 807 | remaining = pkt_size; |
797 | for (i = 0; i < num_rcvd; i++) { | 808 | for (i = 0, j = -1; i < num_rcvd; i++) { |
798 | page_info = get_rx_page_info(adapter, rxq_idx); | 809 | page_info = get_rx_page_info(adapter, rxq_idx); |
799 | 810 | ||
800 | curr_frag_len = min(remaining, rx_frag_size); | 811 | curr_frag_len = min(remaining, rx_frag_size); |
801 | 812 | ||
802 | rx_frags[i].page = page_info->page; | 813 | /* Coalesce all frags from the same physical page in one slot */ |
803 | rx_frags[i].page_offset = page_info->page_offset; | 814 | if (i == 0 || page_info->page_offset == 0) { |
804 | rx_frags[i].size = curr_frag_len; | 815 | /* First frag or Fresh page */ |
805 | remaining -= curr_frag_len; | 816 | j++; |
817 | rx_frags[j].page = page_info->page; | ||
818 | rx_frags[j].page_offset = page_info->page_offset; | ||
819 | rx_frags[j].size = 0; | ||
820 | } else { | ||
821 | put_page(page_info->page); | ||
822 | } | ||
823 | rx_frags[j].size += curr_frag_len; | ||
806 | 824 | ||
825 | remaining -= curr_frag_len; | ||
807 | index_inc(&rxq_idx, rxq->len); | 826 | index_inc(&rxq_idx, rxq->len); |
808 | |||
809 | memset(page_info, 0, sizeof(*page_info)); | 827 | memset(page_info, 0, sizeof(*page_info)); |
810 | } | 828 | } |
829 | BUG_ON(j > MAX_SKB_FRAGS); | ||
811 | 830 | ||
812 | if (likely(!vlanf)) { | 831 | if (likely(!vlanf)) { |
813 | lro_receive_frags(&adapter->rx_obj.lro_mgr, rx_frags, pkt_size, | 832 | lro_receive_frags(&adapter->rx_obj.lro_mgr, rx_frags, pkt_size, |
@@ -1255,15 +1274,17 @@ static irqreturn_t be_intx(int irq, void *dev) | |||
1255 | { | 1274 | { |
1256 | struct be_adapter *adapter = dev; | 1275 | struct be_adapter *adapter = dev; |
1257 | struct be_ctrl_info *ctrl = &adapter->ctrl; | 1276 | struct be_ctrl_info *ctrl = &adapter->ctrl; |
1258 | int rx, tx; | 1277 | int isr; |
1259 | 1278 | ||
1260 | tx = event_handle(ctrl, &adapter->tx_eq); | 1279 | isr = ioread32(ctrl->csr + CEV_ISR0_OFFSET + |
1261 | rx = event_handle(ctrl, &adapter->rx_eq); | 1280 | ctrl->pci_func * CEV_ISR_SIZE); |
1281 | if (!isr) | ||
1282 | return IRQ_NONE; | ||
1262 | 1283 | ||
1263 | if (rx || tx) | 1284 | event_handle(ctrl, &adapter->tx_eq); |
1264 | return IRQ_HANDLED; | 1285 | event_handle(ctrl, &adapter->rx_eq); |
1265 | else | 1286 | |
1266 | return IRQ_NONE; | 1287 | return IRQ_HANDLED; |
1267 | } | 1288 | } |
1268 | 1289 | ||
1269 | static irqreturn_t be_msix_rx(int irq, void *dev) | 1290 | static irqreturn_t be_msix_rx(int irq, void *dev) |
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c index 9578a3dfac01..206144f2470f 100644 --- a/drivers/net/bmac.c +++ b/drivers/net/bmac.c | |||
@@ -428,10 +428,11 @@ bmac_init_phy(struct net_device *dev) | |||
428 | printk(KERN_DEBUG "phy registers:"); | 428 | printk(KERN_DEBUG "phy registers:"); |
429 | for (addr = 0; addr < 32; ++addr) { | 429 | for (addr = 0; addr < 32; ++addr) { |
430 | if ((addr & 7) == 0) | 430 | if ((addr & 7) == 0) |
431 | printk("\n" KERN_DEBUG); | 431 | printk(KERN_DEBUG); |
432 | printk(" %.4x", bmac_mif_read(dev, addr)); | 432 | printk(KERN_CONT " %.4x", bmac_mif_read(dev, addr)); |
433 | } | 433 | } |
434 | printk("\n"); | 434 | printk(KERN_CONT "\n"); |
435 | |||
435 | if (bp->is_bmac_plus) { | 436 | if (bp->is_bmac_plus) { |
436 | unsigned int capable, ctrl; | 437 | unsigned int capable, ctrl; |
437 | 438 | ||
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 38f1c3375d7f..b70cc99962fc 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -6825,6 +6825,14 @@ bnx2_nway_reset(struct net_device *dev) | |||
6825 | return 0; | 6825 | return 0; |
6826 | } | 6826 | } |
6827 | 6827 | ||
6828 | static u32 | ||
6829 | bnx2_get_link(struct net_device *dev) | ||
6830 | { | ||
6831 | struct bnx2 *bp = netdev_priv(dev); | ||
6832 | |||
6833 | return bp->link_up; | ||
6834 | } | ||
6835 | |||
6828 | static int | 6836 | static int |
6829 | bnx2_get_eeprom_len(struct net_device *dev) | 6837 | bnx2_get_eeprom_len(struct net_device *dev) |
6830 | { | 6838 | { |
@@ -7392,7 +7400,7 @@ static const struct ethtool_ops bnx2_ethtool_ops = { | |||
7392 | .get_wol = bnx2_get_wol, | 7400 | .get_wol = bnx2_get_wol, |
7393 | .set_wol = bnx2_set_wol, | 7401 | .set_wol = bnx2_set_wol, |
7394 | .nway_reset = bnx2_nway_reset, | 7402 | .nway_reset = bnx2_nway_reset, |
7395 | .get_link = ethtool_op_get_link, | 7403 | .get_link = bnx2_get_link, |
7396 | .get_eeprom_len = bnx2_get_eeprom_len, | 7404 | .get_eeprom_len = bnx2_get_eeprom_len, |
7397 | .get_eeprom = bnx2_get_eeprom, | 7405 | .get_eeprom = bnx2_get_eeprom, |
7398 | .set_eeprom = bnx2_set_eeprom, | 7406 | .set_eeprom = bnx2_set_eeprom, |
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 8678457849f9..85a737c5c23f 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -902,6 +902,8 @@ struct bnx2x { | |||
902 | u16 rx_quick_cons_trip; | 902 | u16 rx_quick_cons_trip; |
903 | u16 rx_ticks_int; | 903 | u16 rx_ticks_int; |
904 | u16 rx_ticks; | 904 | u16 rx_ticks; |
905 | /* Maximal coalescing timeout in us */ | ||
906 | #define BNX2X_MAX_COALESCE_TOUT (0xf0*12) | ||
905 | 907 | ||
906 | u32 lin_cnt; | 908 | u32 lin_cnt; |
907 | 909 | ||
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index fbf1352e9c1c..c36a5f33739f 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -484,8 +484,9 @@ static void bnx2x_fw_dump(struct bnx2x *bp) | |||
484 | 484 | ||
485 | mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104); | 485 | mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104); |
486 | mark = ((mark + 0x3) & ~0x3); | 486 | mark = ((mark + 0x3) & ~0x3); |
487 | printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n" KERN_ERR, mark); | 487 | printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n", mark); |
488 | 488 | ||
489 | printk(KERN_ERR PFX); | ||
489 | for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) { | 490 | for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) { |
490 | for (word = 0; word < 8; word++) | 491 | for (word = 0; word < 8; word++) |
491 | data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH + | 492 | data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH + |
@@ -500,7 +501,7 @@ static void bnx2x_fw_dump(struct bnx2x *bp) | |||
500 | data[8] = 0x0; | 501 | data[8] = 0x0; |
501 | printk(KERN_CONT "%s", (char *)data); | 502 | printk(KERN_CONT "%s", (char *)data); |
502 | } | 503 | } |
503 | printk("\n" KERN_ERR PFX "end of fw dump\n"); | 504 | printk(KERN_ERR PFX "end of fw dump\n"); |
504 | } | 505 | } |
505 | 506 | ||
506 | static void bnx2x_panic_dump(struct bnx2x *bp) | 507 | static void bnx2x_panic_dump(struct bnx2x *bp) |
@@ -4434,7 +4435,7 @@ static void bnx2x_update_coalesce(struct bnx2x *bp) | |||
4434 | REG_WR16(bp, BAR_USTRORM_INTMEM + | 4435 | REG_WR16(bp, BAR_USTRORM_INTMEM + |
4435 | USTORM_SB_HC_DISABLE_OFFSET(port, sb_id, | 4436 | USTORM_SB_HC_DISABLE_OFFSET(port, sb_id, |
4436 | U_SB_ETH_RX_CQ_INDEX), | 4437 | U_SB_ETH_RX_CQ_INDEX), |
4437 | bp->rx_ticks ? 0 : 1); | 4438 | (bp->rx_ticks/12) ? 0 : 1); |
4438 | 4439 | ||
4439 | /* HC_INDEX_C_ETH_TX_CQ_CONS */ | 4440 | /* HC_INDEX_C_ETH_TX_CQ_CONS */ |
4440 | REG_WR8(bp, BAR_CSTRORM_INTMEM + | 4441 | REG_WR8(bp, BAR_CSTRORM_INTMEM + |
@@ -4444,7 +4445,7 @@ static void bnx2x_update_coalesce(struct bnx2x *bp) | |||
4444 | REG_WR16(bp, BAR_CSTRORM_INTMEM + | 4445 | REG_WR16(bp, BAR_CSTRORM_INTMEM + |
4445 | CSTORM_SB_HC_DISABLE_OFFSET(port, sb_id, | 4446 | CSTORM_SB_HC_DISABLE_OFFSET(port, sb_id, |
4446 | C_SB_ETH_TX_CQ_INDEX), | 4447 | C_SB_ETH_TX_CQ_INDEX), |
4447 | bp->tx_ticks ? 0 : 1); | 4448 | (bp->tx_ticks/12) ? 0 : 1); |
4448 | } | 4449 | } |
4449 | } | 4450 | } |
4450 | 4451 | ||
@@ -7354,7 +7355,7 @@ static void bnx2x_reset_task(struct work_struct *work) | |||
7354 | #ifdef BNX2X_STOP_ON_ERROR | 7355 | #ifdef BNX2X_STOP_ON_ERROR |
7355 | BNX2X_ERR("reset task called but STOP_ON_ERROR defined" | 7356 | BNX2X_ERR("reset task called but STOP_ON_ERROR defined" |
7356 | " so reset not done to allow debug dump,\n" | 7357 | " so reset not done to allow debug dump,\n" |
7357 | KERN_ERR " you will need to reboot when done\n"); | 7358 | " you will need to reboot when done\n"); |
7358 | return; | 7359 | return; |
7359 | #endif | 7360 | #endif |
7360 | 7361 | ||
@@ -8637,6 +8638,14 @@ static int bnx2x_nway_reset(struct net_device *dev) | |||
8637 | return 0; | 8638 | return 0; |
8638 | } | 8639 | } |
8639 | 8640 | ||
8641 | static u32 | ||
8642 | bnx2x_get_link(struct net_device *dev) | ||
8643 | { | ||
8644 | struct bnx2x *bp = netdev_priv(dev); | ||
8645 | |||
8646 | return bp->link_vars.link_up; | ||
8647 | } | ||
8648 | |||
8640 | static int bnx2x_get_eeprom_len(struct net_device *dev) | 8649 | static int bnx2x_get_eeprom_len(struct net_device *dev) |
8641 | { | 8650 | { |
8642 | struct bnx2x *bp = netdev_priv(dev); | 8651 | struct bnx2x *bp = netdev_priv(dev); |
@@ -9061,12 +9070,12 @@ static int bnx2x_set_coalesce(struct net_device *dev, | |||
9061 | struct bnx2x *bp = netdev_priv(dev); | 9070 | struct bnx2x *bp = netdev_priv(dev); |
9062 | 9071 | ||
9063 | bp->rx_ticks = (u16) coal->rx_coalesce_usecs; | 9072 | bp->rx_ticks = (u16) coal->rx_coalesce_usecs; |
9064 | if (bp->rx_ticks > 3000) | 9073 | if (bp->rx_ticks > BNX2X_MAX_COALESCE_TOUT) |
9065 | bp->rx_ticks = 3000; | 9074 | bp->rx_ticks = BNX2X_MAX_COALESCE_TOUT; |
9066 | 9075 | ||
9067 | bp->tx_ticks = (u16) coal->tx_coalesce_usecs; | 9076 | bp->tx_ticks = (u16) coal->tx_coalesce_usecs; |
9068 | if (bp->tx_ticks > 0x3000) | 9077 | if (bp->tx_ticks > BNX2X_MAX_COALESCE_TOUT) |
9069 | bp->tx_ticks = 0x3000; | 9078 | bp->tx_ticks = BNX2X_MAX_COALESCE_TOUT; |
9070 | 9079 | ||
9071 | if (netif_running(dev)) | 9080 | if (netif_running(dev)) |
9072 | bnx2x_update_coalesce(bp); | 9081 | bnx2x_update_coalesce(bp); |
@@ -10034,7 +10043,7 @@ static struct ethtool_ops bnx2x_ethtool_ops = { | |||
10034 | .get_msglevel = bnx2x_get_msglevel, | 10043 | .get_msglevel = bnx2x_get_msglevel, |
10035 | .set_msglevel = bnx2x_set_msglevel, | 10044 | .set_msglevel = bnx2x_set_msglevel, |
10036 | .nway_reset = bnx2x_nway_reset, | 10045 | .nway_reset = bnx2x_nway_reset, |
10037 | .get_link = ethtool_op_get_link, | 10046 | .get_link = bnx2x_get_link, |
10038 | .get_eeprom_len = bnx2x_get_eeprom_len, | 10047 | .get_eeprom_len = bnx2x_get_eeprom_len, |
10039 | .get_eeprom = bnx2x_get_eeprom, | 10048 | .get_eeprom = bnx2x_get_eeprom, |
10040 | .set_eeprom = bnx2x_set_eeprom, | 10049 | .set_eeprom = bnx2x_set_eeprom, |
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index d5e18812bf49..33821a81cbf8 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig | |||
@@ -36,7 +36,7 @@ config CAN_CALC_BITTIMING | |||
36 | If unsure, say Y. | 36 | If unsure, say Y. |
37 | 37 | ||
38 | config CAN_SJA1000 | 38 | config CAN_SJA1000 |
39 | depends on CAN_DEV | 39 | depends on CAN_DEV && HAS_IOMEM |
40 | tristate "Philips SJA1000" | 40 | tristate "Philips SJA1000" |
41 | ---help--- | 41 | ---help--- |
42 | Driver for the SJA1000 CAN controllers from Philips or NXP | 42 | Driver for the SJA1000 CAN controllers from Philips or NXP |
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 58afafbd3b9c..fd5e32cbcb87 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
@@ -1097,7 +1097,7 @@ static const struct net_device_ops cpmac_netdev_ops = { | |||
1097 | .ndo_start_xmit = cpmac_start_xmit, | 1097 | .ndo_start_xmit = cpmac_start_xmit, |
1098 | .ndo_tx_timeout = cpmac_tx_timeout, | 1098 | .ndo_tx_timeout = cpmac_tx_timeout, |
1099 | .ndo_set_multicast_list = cpmac_set_multicast_list, | 1099 | .ndo_set_multicast_list = cpmac_set_multicast_list, |
1100 | .ndo_so_ioctl = cpmac_ioctl, | 1100 | .ndo_do_ioctl = cpmac_ioctl, |
1101 | .ndo_set_config = cpmac_config, | 1101 | .ndo_set_config = cpmac_config, |
1102 | .ndo_change_mtu = eth_change_mtu, | 1102 | .ndo_change_mtu = eth_change_mtu, |
1103 | .ndo_validate_addr = eth_validate_addr, | 1103 | .ndo_validate_addr = eth_validate_addr, |
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index 3eee666a9cd2..55445f980f9c 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c | |||
@@ -1524,6 +1524,7 @@ static void net_timeout(struct net_device *dev) | |||
1524 | static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | 1524 | static int net_send_packet(struct sk_buff *skb, struct net_device *dev) |
1525 | { | 1525 | { |
1526 | struct net_local *lp = netdev_priv(dev); | 1526 | struct net_local *lp = netdev_priv(dev); |
1527 | unsigned long flags; | ||
1527 | 1528 | ||
1528 | if (net_debug > 3) { | 1529 | if (net_debug > 3) { |
1529 | printk("%s: sent %d byte packet of type %x\n", | 1530 | printk("%s: sent %d byte packet of type %x\n", |
@@ -1535,7 +1536,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1535 | ask the chip to start transmitting before the | 1536 | ask the chip to start transmitting before the |
1536 | whole packet has been completely uploaded. */ | 1537 | whole packet has been completely uploaded. */ |
1537 | 1538 | ||
1538 | spin_lock_irq(&lp->lock); | 1539 | spin_lock_irqsave(&lp->lock, flags); |
1539 | netif_stop_queue(dev); | 1540 | netif_stop_queue(dev); |
1540 | 1541 | ||
1541 | /* initiate a transmit sequence */ | 1542 | /* initiate a transmit sequence */ |
@@ -1549,13 +1550,13 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1549 | * we're waiting for TxOk, so return 1 and requeue this packet. | 1550 | * we're waiting for TxOk, so return 1 and requeue this packet. |
1550 | */ | 1551 | */ |
1551 | 1552 | ||
1552 | spin_unlock_irq(&lp->lock); | 1553 | spin_unlock_irqrestore(&lp->lock, flags); |
1553 | if (net_debug) printk("cs89x0: Tx buffer not free!\n"); | 1554 | if (net_debug) printk("cs89x0: Tx buffer not free!\n"); |
1554 | return NETDEV_TX_BUSY; | 1555 | return NETDEV_TX_BUSY; |
1555 | } | 1556 | } |
1556 | /* Write the contents of the packet */ | 1557 | /* Write the contents of the packet */ |
1557 | writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1); | 1558 | writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1); |
1558 | spin_unlock_irq(&lp->lock); | 1559 | spin_unlock_irqrestore(&lp->lock, flags); |
1559 | lp->stats.tx_bytes += skb->len; | 1560 | lp->stats.tx_bytes += skb->len; |
1560 | dev->trans_start = jiffies; | 1561 | dev->trans_start = jiffies; |
1561 | dev_kfree_skb (skb); | 1562 | dev_kfree_skb (skb); |
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 538dda4422dc..fb5df5c6203e 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -642,8 +642,7 @@ static int setup_sge_qsets(struct adapter *adap) | |||
642 | struct port_info *pi = netdev_priv(dev); | 642 | struct port_info *pi = netdev_priv(dev); |
643 | 643 | ||
644 | pi->qs = &adap->sge.qs[pi->first_qset]; | 644 | pi->qs = &adap->sge.qs[pi->first_qset]; |
645 | for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; | 645 | for (j = 0; j < pi->nqsets; ++j, ++qset_idx) { |
646 | ++j, ++qset_idx) { | ||
647 | set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO); | 646 | set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO); |
648 | err = t3_sge_alloc_qset(adap, qset_idx, 1, | 647 | err = t3_sge_alloc_qset(adap, qset_idx, 1, |
649 | (adap->flags & USING_MSIX) ? qset_idx + 1 : | 648 | (adap->flags & USING_MSIX) ? qset_idx + 1 : |
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 2df8fb0af701..12fd446f9895 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c | |||
@@ -1820,11 +1820,19 @@ static int emac_dev_setmac_addr(struct net_device *ndev, void *addr) | |||
1820 | struct device *emac_dev = &priv->ndev->dev; | 1820 | struct device *emac_dev = &priv->ndev->dev; |
1821 | struct sockaddr *sa = addr; | 1821 | struct sockaddr *sa = addr; |
1822 | 1822 | ||
1823 | if (!is_valid_ether_addr(sa->sa_data)) | ||
1824 | return -EINVAL; | ||
1825 | |||
1823 | /* Store mac addr in priv and rx channel and set it in EMAC hw */ | 1826 | /* Store mac addr in priv and rx channel and set it in EMAC hw */ |
1824 | memcpy(priv->mac_addr, sa->sa_data, ndev->addr_len); | 1827 | memcpy(priv->mac_addr, sa->sa_data, ndev->addr_len); |
1825 | memcpy(rxch->mac_addr, sa->sa_data, ndev->addr_len); | ||
1826 | memcpy(ndev->dev_addr, sa->sa_data, ndev->addr_len); | 1828 | memcpy(ndev->dev_addr, sa->sa_data, ndev->addr_len); |
1827 | emac_setmac(priv, EMAC_DEF_RX_CH, rxch->mac_addr); | 1829 | |
1830 | /* If the interface is down - rxch is NULL. */ | ||
1831 | /* MAC address is configured only after the interface is enabled. */ | ||
1832 | if (netif_running(ndev)) { | ||
1833 | memcpy(rxch->mac_addr, sa->sa_data, ndev->addr_len); | ||
1834 | emac_setmac(priv, EMAC_DEF_RX_CH, rxch->mac_addr); | ||
1835 | } | ||
1828 | 1836 | ||
1829 | if (netif_msg_drv(priv)) | 1837 | if (netif_msg_drv(priv)) |
1830 | dev_notice(emac_dev, "DaVinci EMAC: emac_dev_setmac_addr %pM\n", | 1838 | dev_notice(emac_dev, "DaVinci EMAC: emac_dev_setmac_addr %pM\n", |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 895d72143ee0..4b6a219fecea 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -268,8 +268,9 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
268 | printk(KERN_INFO "tx_coalesce:\t%d packets\n", | 268 | printk(KERN_INFO "tx_coalesce:\t%d packets\n", |
269 | tx_coalesce); | 269 | tx_coalesce); |
270 | if (np->coalesce) | 270 | if (np->coalesce) |
271 | printk(KERN_INFO "rx_coalesce:\t%d packets\n" | 271 | printk(KERN_INFO |
272 | KERN_INFO "rx_timeout: \t%d ns\n", | 272 | "rx_coalesce:\t%d packets\n" |
273 | "rx_timeout: \t%d ns\n", | ||
273 | np->rx_coalesce, np->rx_timeout*640); | 274 | np->rx_coalesce, np->rx_timeout*640); |
274 | if (np->vlan) | 275 | if (np->vlan) |
275 | printk(KERN_INFO "vlan(id):\t%d\n", np->vlan); | 276 | printk(KERN_INFO "vlan(id):\t%d\n", np->vlan); |
@@ -1522,9 +1523,9 @@ mii_get_media (struct net_device *dev) | |||
1522 | printk (KERN_INFO "Operating at 10 Mbps, "); | 1523 | printk (KERN_INFO "Operating at 10 Mbps, "); |
1523 | } | 1524 | } |
1524 | if (bmcr & MII_BMCR_DUPLEX_MODE) { | 1525 | if (bmcr & MII_BMCR_DUPLEX_MODE) { |
1525 | printk ("Full duplex\n"); | 1526 | printk (KERN_CONT "Full duplex\n"); |
1526 | } else { | 1527 | } else { |
1527 | printk ("Half duplex\n"); | 1528 | printk (KERN_CONT "Half duplex\n"); |
1528 | } | 1529 | } |
1529 | } | 1530 | } |
1530 | if (np->tx_flow) | 1531 | if (np->tx_flow) |
@@ -1614,9 +1615,9 @@ mii_set_media (struct net_device *dev) | |||
1614 | } | 1615 | } |
1615 | if (np->full_duplex) { | 1616 | if (np->full_duplex) { |
1616 | bmcr |= MII_BMCR_DUPLEX_MODE; | 1617 | bmcr |= MII_BMCR_DUPLEX_MODE; |
1617 | printk ("Full duplex\n"); | 1618 | printk (KERN_CONT "Full duplex\n"); |
1618 | } else { | 1619 | } else { |
1619 | printk ("Half duplex\n"); | 1620 | printk (KERN_CONT "Half duplex\n"); |
1620 | } | 1621 | } |
1621 | #if 0 | 1622 | #if 0 |
1622 | /* Set 1000BaseT Master/Slave setting */ | 1623 | /* Set 1000BaseT Master/Slave setting */ |
@@ -1669,9 +1670,9 @@ mii_get_media_pcs (struct net_device *dev) | |||
1669 | __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR); | 1670 | __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR); |
1670 | printk (KERN_INFO "Operating at 1000 Mbps, "); | 1671 | printk (KERN_INFO "Operating at 1000 Mbps, "); |
1671 | if (bmcr & MII_BMCR_DUPLEX_MODE) { | 1672 | if (bmcr & MII_BMCR_DUPLEX_MODE) { |
1672 | printk ("Full duplex\n"); | 1673 | printk (KERN_CONT "Full duplex\n"); |
1673 | } else { | 1674 | } else { |
1674 | printk ("Half duplex\n"); | 1675 | printk (KERN_CONT "Half duplex\n"); |
1675 | } | 1676 | } |
1676 | } | 1677 | } |
1677 | if (np->tx_flow) | 1678 | if (np->tx_flow) |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 5e3356f8eb5a..5b8cbdb4b520 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -2185,12 +2185,16 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter, | |||
2185 | /* Free all the Rx ring sk_buffs */ | 2185 | /* Free all the Rx ring sk_buffs */ |
2186 | for (i = 0; i < rx_ring->count; i++) { | 2186 | for (i = 0; i < rx_ring->count; i++) { |
2187 | buffer_info = &rx_ring->buffer_info[i]; | 2187 | buffer_info = &rx_ring->buffer_info[i]; |
2188 | if (buffer_info->skb) { | 2188 | if (buffer_info->dma) { |
2189 | pci_unmap_single(pdev, | 2189 | pci_unmap_single(pdev, |
2190 | buffer_info->dma, | 2190 | buffer_info->dma, |
2191 | buffer_info->length, | 2191 | buffer_info->length, |
2192 | PCI_DMA_FROMDEVICE); | 2192 | PCI_DMA_FROMDEVICE); |
2193 | } | ||
2194 | |||
2195 | buffer_info->dma = 0; | ||
2193 | 2196 | ||
2197 | if (buffer_info->skb) { | ||
2194 | dev_kfree_skb(buffer_info->skb); | 2198 | dev_kfree_skb(buffer_info->skb); |
2195 | buffer_info->skb = NULL; | 2199 | buffer_info->skb = NULL; |
2196 | } | 2200 | } |
@@ -4033,6 +4037,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
4033 | buffer_info->dma, | 4037 | buffer_info->dma, |
4034 | buffer_info->length, | 4038 | buffer_info->length, |
4035 | PCI_DMA_FROMDEVICE); | 4039 | PCI_DMA_FROMDEVICE); |
4040 | buffer_info->dma = 0; | ||
4036 | 4041 | ||
4037 | length = le16_to_cpu(rx_desc->length); | 4042 | length = le16_to_cpu(rx_desc->length); |
4038 | /* !EOP means multiple descriptors were used to store a single | 4043 | /* !EOP means multiple descriptors were used to store a single |
@@ -4222,6 +4227,7 @@ map_skb: | |||
4222 | pci_unmap_single(pdev, buffer_info->dma, | 4227 | pci_unmap_single(pdev, buffer_info->dma, |
4223 | adapter->rx_buffer_len, | 4228 | adapter->rx_buffer_len, |
4224 | PCI_DMA_FROMDEVICE); | 4229 | PCI_DMA_FROMDEVICE); |
4230 | buffer_info->dma = 0; | ||
4225 | 4231 | ||
4226 | break; /* while !buffer_info->skb */ | 4232 | break; /* while !buffer_info->skb */ |
4227 | } | 4233 | } |
@@ -4817,6 +4823,9 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, | |||
4817 | 4823 | ||
4818 | netif_device_detach(netdev); | 4824 | netif_device_detach(netdev); |
4819 | 4825 | ||
4826 | if (state == pci_channel_io_perm_failure) | ||
4827 | return PCI_ERS_RESULT_DISCONNECT; | ||
4828 | |||
4820 | if (netif_running(netdev)) | 4829 | if (netif_running(netdev)) |
4821 | e1000_down(adapter); | 4830 | e1000_down(adapter); |
4822 | pci_disable_device(pdev); | 4831 | pci_disable_device(pdev); |
diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h index 8890c97e1120..c0f185beb8bc 100644 --- a/drivers/net/e1000e/defines.h +++ b/drivers/net/e1000e/defines.h | |||
@@ -238,6 +238,7 @@ | |||
238 | #define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */ | 238 | #define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */ |
239 | #define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */ | 239 | #define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */ |
240 | #define E1000_STATUS_LAN_INIT_DONE 0x00000200 /* Lan Init Completion by NVM */ | 240 | #define E1000_STATUS_LAN_INIT_DONE 0x00000200 /* Lan Init Completion by NVM */ |
241 | #define E1000_STATUS_PHYRA 0x00000400 /* PHY Reset Asserted */ | ||
241 | #define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */ | 242 | #define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */ |
242 | 243 | ||
243 | /* Constants used to interpret the masked PCI-X bus speed. */ | 244 | /* Constants used to interpret the masked PCI-X bus speed. */ |
@@ -575,6 +576,8 @@ | |||
575 | #define PHY_1000T_STATUS 0x0A /* 1000Base-T Status Reg */ | 576 | #define PHY_1000T_STATUS 0x0A /* 1000Base-T Status Reg */ |
576 | #define PHY_EXT_STATUS 0x0F /* Extended Status Reg */ | 577 | #define PHY_EXT_STATUS 0x0F /* Extended Status Reg */ |
577 | 578 | ||
579 | #define PHY_CONTROL_LB 0x4000 /* PHY Loopback bit */ | ||
580 | |||
578 | /* NVM Control */ | 581 | /* NVM Control */ |
579 | #define E1000_EECD_SK 0x00000001 /* NVM Clock */ | 582 | #define E1000_EECD_SK 0x00000001 /* NVM Clock */ |
580 | #define E1000_EECD_CS 0x00000002 /* NVM Chip Select */ | 583 | #define E1000_EECD_CS 0x00000002 /* NVM Chip Select */ |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index 163c1c0cfee7..fd44d9f90769 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
@@ -215,6 +215,7 @@ enum e1e_registers { | |||
215 | E1000_SWSM = 0x05B50, /* SW Semaphore */ | 215 | E1000_SWSM = 0x05B50, /* SW Semaphore */ |
216 | E1000_FWSM = 0x05B54, /* FW Semaphore */ | 216 | E1000_FWSM = 0x05B54, /* FW Semaphore */ |
217 | E1000_SWSM2 = 0x05B58, /* Driver-only SW semaphore */ | 217 | E1000_SWSM2 = 0x05B58, /* Driver-only SW semaphore */ |
218 | E1000_CRC_OFFSET = 0x05F50, /* CRC Offset register */ | ||
218 | E1000_HICR = 0x08F00, /* Host Interface Control */ | 219 | E1000_HICR = 0x08F00, /* Host Interface Control */ |
219 | }; | 220 | }; |
220 | 221 | ||
@@ -302,6 +303,9 @@ enum e1e_registers { | |||
302 | #define E1000_KMRNCTRLSTA_REN 0x00200000 | 303 | #define E1000_KMRNCTRLSTA_REN 0x00200000 |
303 | #define E1000_KMRNCTRLSTA_DIAG_OFFSET 0x3 /* Kumeran Diagnostic */ | 304 | #define E1000_KMRNCTRLSTA_DIAG_OFFSET 0x3 /* Kumeran Diagnostic */ |
304 | #define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */ | 305 | #define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */ |
306 | #define E1000_KMRNCTRLSTA_K1_CONFIG 0x7 | ||
307 | #define E1000_KMRNCTRLSTA_K1_ENABLE 0x140E | ||
308 | #define E1000_KMRNCTRLSTA_K1_DISABLE 0x1400 | ||
305 | 309 | ||
306 | #define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10 | 310 | #define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10 |
307 | #define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY Special Control */ | 311 | #define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY Special Control */ |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 9e23f50fb9cd..d56c7473144a 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -338,6 +338,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw) | |||
338 | { | 338 | { |
339 | struct e1000_nvm_info *nvm = &hw->nvm; | 339 | struct e1000_nvm_info *nvm = &hw->nvm; |
340 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; | 340 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; |
341 | union ich8_hws_flash_status hsfsts; | ||
341 | u32 gfpreg; | 342 | u32 gfpreg; |
342 | u32 sector_base_addr; | 343 | u32 sector_base_addr; |
343 | u32 sector_end_addr; | 344 | u32 sector_end_addr; |
@@ -374,6 +375,20 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw) | |||
374 | /* Adjust to word count */ | 375 | /* Adjust to word count */ |
375 | nvm->flash_bank_size /= sizeof(u16); | 376 | nvm->flash_bank_size /= sizeof(u16); |
376 | 377 | ||
378 | /* | ||
379 | * Make sure the flash bank size does not overwrite the 4k | ||
380 | * sector ranges. We may have 64k allotted to us but we only care | ||
381 | * about the first 2 4k sectors. Therefore, if we have anything less | ||
382 | * than 64k set in the HSFSTS register, we will reduce the bank size | ||
383 | * down to 4k and let the rest remain unused. If berasesz == 3, then | ||
384 | * we are working in 64k mode. Otherwise we are not. | ||
385 | */ | ||
386 | if (nvm->flash_bank_size > E1000_ICH8_SHADOW_RAM_WORDS) { | ||
387 | hsfsts.regval = er16flash(ICH_FLASH_HSFSTS); | ||
388 | if (hsfsts.hsf_status.berasesz != 3) | ||
389 | nvm->flash_bank_size = E1000_ICH8_SHADOW_RAM_WORDS; | ||
390 | } | ||
391 | |||
377 | nvm->word_size = E1000_ICH8_SHADOW_RAM_WORDS; | 392 | nvm->word_size = E1000_ICH8_SHADOW_RAM_WORDS; |
378 | 393 | ||
379 | /* Clear shadow ram */ | 394 | /* Clear shadow ram */ |
@@ -446,6 +461,95 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
446 | return 0; | 461 | return 0; |
447 | } | 462 | } |
448 | 463 | ||
464 | /** | ||
465 | * e1000_check_for_copper_link_ich8lan - Check for link (Copper) | ||
466 | * @hw: pointer to the HW structure | ||
467 | * | ||
468 | * Checks to see of the link status of the hardware has changed. If a | ||
469 | * change in link status has been detected, then we read the PHY registers | ||
470 | * to get the current speed/duplex if link exists. | ||
471 | **/ | ||
472 | static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) | ||
473 | { | ||
474 | struct e1000_mac_info *mac = &hw->mac; | ||
475 | s32 ret_val; | ||
476 | bool link; | ||
477 | |||
478 | /* | ||
479 | * We only want to go out to the PHY registers to see if Auto-Neg | ||
480 | * has completed and/or if our link status has changed. The | ||
481 | * get_link_status flag is set upon receiving a Link Status | ||
482 | * Change or Rx Sequence Error interrupt. | ||
483 | */ | ||
484 | if (!mac->get_link_status) { | ||
485 | ret_val = 0; | ||
486 | goto out; | ||
487 | } | ||
488 | |||
489 | if (hw->mac.type == e1000_pchlan) { | ||
490 | ret_val = e1000e_write_kmrn_reg(hw, | ||
491 | E1000_KMRNCTRLSTA_K1_CONFIG, | ||
492 | E1000_KMRNCTRLSTA_K1_ENABLE); | ||
493 | if (ret_val) | ||
494 | goto out; | ||
495 | } | ||
496 | |||
497 | /* | ||
498 | * First we want to see if the MII Status Register reports | ||
499 | * link. If so, then we want to get the current speed/duplex | ||
500 | * of the PHY. | ||
501 | */ | ||
502 | ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); | ||
503 | if (ret_val) | ||
504 | goto out; | ||
505 | |||
506 | if (!link) | ||
507 | goto out; /* No link detected */ | ||
508 | |||
509 | mac->get_link_status = false; | ||
510 | |||
511 | if (hw->phy.type == e1000_phy_82578) { | ||
512 | ret_val = e1000_link_stall_workaround_hv(hw); | ||
513 | if (ret_val) | ||
514 | goto out; | ||
515 | } | ||
516 | |||
517 | /* | ||
518 | * Check if there was DownShift, must be checked | ||
519 | * immediately after link-up | ||
520 | */ | ||
521 | e1000e_check_downshift(hw); | ||
522 | |||
523 | /* | ||
524 | * If we are forcing speed/duplex, then we simply return since | ||
525 | * we have already determined whether we have link or not. | ||
526 | */ | ||
527 | if (!mac->autoneg) { | ||
528 | ret_val = -E1000_ERR_CONFIG; | ||
529 | goto out; | ||
530 | } | ||
531 | |||
532 | /* | ||
533 | * Auto-Neg is enabled. Auto Speed Detection takes care | ||
534 | * of MAC speed/duplex configuration. So we only need to | ||
535 | * configure Collision Distance in the MAC. | ||
536 | */ | ||
537 | e1000e_config_collision_dist(hw); | ||
538 | |||
539 | /* | ||
540 | * Configure Flow Control now that Auto-Neg has completed. | ||
541 | * First, we need to restore the desired flow control | ||
542 | * settings because we may have had to re-autoneg with a | ||
543 | * different link partner. | ||
544 | */ | ||
545 | ret_val = e1000e_config_fc_after_link_up(hw); | ||
546 | if (ret_val) | ||
547 | hw_dbg(hw, "Error configuring flow control\n"); | ||
548 | |||
549 | out: | ||
550 | return ret_val; | ||
551 | } | ||
552 | |||
449 | static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) | 553 | static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) |
450 | { | 554 | { |
451 | struct e1000_hw *hw = &adapter->hw; | 555 | struct e1000_hw *hw = &adapter->hw; |
@@ -694,6 +798,38 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) | |||
694 | } | 798 | } |
695 | 799 | ||
696 | /** | 800 | /** |
801 | * e1000_lan_init_done_ich8lan - Check for PHY config completion | ||
802 | * @hw: pointer to the HW structure | ||
803 | * | ||
804 | * Check the appropriate indication the MAC has finished configuring the | ||
805 | * PHY after a software reset. | ||
806 | **/ | ||
807 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw) | ||
808 | { | ||
809 | u32 data, loop = E1000_ICH8_LAN_INIT_TIMEOUT; | ||
810 | |||
811 | /* Wait for basic configuration completes before proceeding */ | ||
812 | do { | ||
813 | data = er32(STATUS); | ||
814 | data &= E1000_STATUS_LAN_INIT_DONE; | ||
815 | udelay(100); | ||
816 | } while ((!data) && --loop); | ||
817 | |||
818 | /* | ||
819 | * If basic configuration is incomplete before the above loop | ||
820 | * count reaches 0, loading the configuration from NVM will | ||
821 | * leave the PHY in a bad state possibly resulting in no link. | ||
822 | */ | ||
823 | if (loop == 0) | ||
824 | hw_dbg(hw, "LAN_INIT_DONE not set, increase timeout\n"); | ||
825 | |||
826 | /* Clear the Init Done bit for the next init event */ | ||
827 | data = er32(STATUS); | ||
828 | data &= ~E1000_STATUS_LAN_INIT_DONE; | ||
829 | ew32(STATUS, data); | ||
830 | } | ||
831 | |||
832 | /** | ||
697 | * e1000_phy_hw_reset_ich8lan - Performs a PHY reset | 833 | * e1000_phy_hw_reset_ich8lan - Performs a PHY reset |
698 | * @hw: pointer to the HW structure | 834 | * @hw: pointer to the HW structure |
699 | * | 835 | * |
@@ -707,13 +843,15 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
707 | u32 i; | 843 | u32 i; |
708 | u32 data, cnf_size, cnf_base_addr, sw_cfg_mask; | 844 | u32 data, cnf_size, cnf_base_addr, sw_cfg_mask; |
709 | s32 ret_val; | 845 | s32 ret_val; |
710 | u16 loop = E1000_ICH8_LAN_INIT_TIMEOUT; | ||
711 | u16 word_addr, reg_data, reg_addr, phy_page = 0; | 846 | u16 word_addr, reg_data, reg_addr, phy_page = 0; |
712 | 847 | ||
713 | ret_val = e1000e_phy_hw_reset_generic(hw); | 848 | ret_val = e1000e_phy_hw_reset_generic(hw); |
714 | if (ret_val) | 849 | if (ret_val) |
715 | return ret_val; | 850 | return ret_val; |
716 | 851 | ||
852 | /* Allow time for h/w to get to a quiescent state after reset */ | ||
853 | mdelay(10); | ||
854 | |||
717 | if (hw->mac.type == e1000_pchlan) { | 855 | if (hw->mac.type == e1000_pchlan) { |
718 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | 856 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); |
719 | if (ret_val) | 857 | if (ret_val) |
@@ -741,26 +879,8 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
741 | if (!(data & sw_cfg_mask)) | 879 | if (!(data & sw_cfg_mask)) |
742 | return 0; | 880 | return 0; |
743 | 881 | ||
744 | /* Wait for basic configuration completes before proceeding*/ | 882 | /* Wait for basic configuration completes before proceeding */ |
745 | do { | 883 | e1000_lan_init_done_ich8lan(hw); |
746 | data = er32(STATUS); | ||
747 | data &= E1000_STATUS_LAN_INIT_DONE; | ||
748 | udelay(100); | ||
749 | } while ((!data) && --loop); | ||
750 | |||
751 | /* | ||
752 | * If basic configuration is incomplete before the above loop | ||
753 | * count reaches 0, loading the configuration from NVM will | ||
754 | * leave the PHY in a bad state possibly resulting in no link. | ||
755 | */ | ||
756 | if (loop == 0) { | ||
757 | hw_dbg(hw, "LAN_INIT_DONE not set, increase timeout\n"); | ||
758 | } | ||
759 | |||
760 | /* Clear the Init Done bit for the next init event */ | ||
761 | data = er32(STATUS); | ||
762 | data &= ~E1000_STATUS_LAN_INIT_DONE; | ||
763 | ew32(STATUS, data); | ||
764 | 884 | ||
765 | /* | 885 | /* |
766 | * Make sure HW does not configure LCD from PHY | 886 | * Make sure HW does not configure LCD from PHY |
@@ -961,12 +1081,14 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active) | |||
961 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU; | 1081 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU; |
962 | ew32(PHY_CTRL, phy_ctrl); | 1082 | ew32(PHY_CTRL, phy_ctrl); |
963 | 1083 | ||
1084 | if (phy->type != e1000_phy_igp_3) | ||
1085 | return 0; | ||
1086 | |||
964 | /* | 1087 | /* |
965 | * Call gig speed drop workaround on LPLU before accessing | 1088 | * Call gig speed drop workaround on LPLU before accessing |
966 | * any PHY registers | 1089 | * any PHY registers |
967 | */ | 1090 | */ |
968 | if ((hw->mac.type == e1000_ich8lan) && | 1091 | if (hw->mac.type == e1000_ich8lan) |
969 | (hw->phy.type == e1000_phy_igp_3)) | ||
970 | e1000e_gig_downshift_workaround_ich8lan(hw); | 1092 | e1000e_gig_downshift_workaround_ich8lan(hw); |
971 | 1093 | ||
972 | /* When LPLU is enabled, we should disable SmartSpeed */ | 1094 | /* When LPLU is enabled, we should disable SmartSpeed */ |
@@ -979,6 +1101,9 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active) | |||
979 | phy_ctrl &= ~E1000_PHY_CTRL_D0A_LPLU; | 1101 | phy_ctrl &= ~E1000_PHY_CTRL_D0A_LPLU; |
980 | ew32(PHY_CTRL, phy_ctrl); | 1102 | ew32(PHY_CTRL, phy_ctrl); |
981 | 1103 | ||
1104 | if (phy->type != e1000_phy_igp_3) | ||
1105 | return 0; | ||
1106 | |||
982 | /* | 1107 | /* |
983 | * LPLU and SmartSpeed are mutually exclusive. LPLU is used | 1108 | * LPLU and SmartSpeed are mutually exclusive. LPLU is used |
984 | * during Dx states where the power conservation is most | 1109 | * during Dx states where the power conservation is most |
@@ -1038,6 +1163,10 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active) | |||
1038 | if (!active) { | 1163 | if (!active) { |
1039 | phy_ctrl &= ~E1000_PHY_CTRL_NOND0A_LPLU; | 1164 | phy_ctrl &= ~E1000_PHY_CTRL_NOND0A_LPLU; |
1040 | ew32(PHY_CTRL, phy_ctrl); | 1165 | ew32(PHY_CTRL, phy_ctrl); |
1166 | |||
1167 | if (phy->type != e1000_phy_igp_3) | ||
1168 | return 0; | ||
1169 | |||
1041 | /* | 1170 | /* |
1042 | * LPLU and SmartSpeed are mutually exclusive. LPLU is used | 1171 | * LPLU and SmartSpeed are mutually exclusive. LPLU is used |
1043 | * during Dx states where the power conservation is most | 1172 | * during Dx states where the power conservation is most |
@@ -1073,12 +1202,14 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active) | |||
1073 | phy_ctrl |= E1000_PHY_CTRL_NOND0A_LPLU; | 1202 | phy_ctrl |= E1000_PHY_CTRL_NOND0A_LPLU; |
1074 | ew32(PHY_CTRL, phy_ctrl); | 1203 | ew32(PHY_CTRL, phy_ctrl); |
1075 | 1204 | ||
1205 | if (phy->type != e1000_phy_igp_3) | ||
1206 | return 0; | ||
1207 | |||
1076 | /* | 1208 | /* |
1077 | * Call gig speed drop workaround on LPLU before accessing | 1209 | * Call gig speed drop workaround on LPLU before accessing |
1078 | * any PHY registers | 1210 | * any PHY registers |
1079 | */ | 1211 | */ |
1080 | if ((hw->mac.type == e1000_ich8lan) && | 1212 | if (hw->mac.type == e1000_ich8lan) |
1081 | (hw->phy.type == e1000_phy_igp_3)) | ||
1082 | e1000e_gig_downshift_workaround_ich8lan(hw); | 1213 | e1000e_gig_downshift_workaround_ich8lan(hw); |
1083 | 1214 | ||
1084 | /* When LPLU is enabled, we should disable SmartSpeed */ | 1215 | /* When LPLU is enabled, we should disable SmartSpeed */ |
@@ -1905,7 +2036,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank) | |||
1905 | break; | 2036 | break; |
1906 | case 1: | 2037 | case 1: |
1907 | sector_size = ICH_FLASH_SEG_SIZE_4K; | 2038 | sector_size = ICH_FLASH_SEG_SIZE_4K; |
1908 | iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_4K; | 2039 | iteration = 1; |
1909 | break; | 2040 | break; |
1910 | case 2: | 2041 | case 2: |
1911 | if (hw->mac.type == e1000_ich9lan) { | 2042 | if (hw->mac.type == e1000_ich9lan) { |
@@ -1917,7 +2048,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank) | |||
1917 | break; | 2048 | break; |
1918 | case 3: | 2049 | case 3: |
1919 | sector_size = ICH_FLASH_SEG_SIZE_64K; | 2050 | sector_size = ICH_FLASH_SEG_SIZE_64K; |
1920 | iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_64K; | 2051 | iteration = 1; |
1921 | break; | 2052 | break; |
1922 | default: | 2053 | default: |
1923 | return -E1000_ERR_NVM; | 2054 | return -E1000_ERR_NVM; |
@@ -2143,6 +2274,12 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2143 | ctrl = er32(CTRL); | 2274 | ctrl = er32(CTRL); |
2144 | 2275 | ||
2145 | if (!e1000_check_reset_block(hw)) { | 2276 | if (!e1000_check_reset_block(hw)) { |
2277 | /* Clear PHY Reset Asserted bit */ | ||
2278 | if (hw->mac.type >= e1000_pchlan) { | ||
2279 | u32 status = er32(STATUS); | ||
2280 | ew32(STATUS, status & ~E1000_STATUS_PHYRA); | ||
2281 | } | ||
2282 | |||
2146 | /* | 2283 | /* |
2147 | * PHY HW reset requires MAC CORE reset at the same | 2284 | * PHY HW reset requires MAC CORE reset at the same |
2148 | * time to make sure the interface between MAC and the | 2285 | * time to make sure the interface between MAC and the |
@@ -2156,23 +2293,34 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2156 | ew32(CTRL, (ctrl | E1000_CTRL_RST)); | 2293 | ew32(CTRL, (ctrl | E1000_CTRL_RST)); |
2157 | msleep(20); | 2294 | msleep(20); |
2158 | 2295 | ||
2159 | if (!ret_val) { | 2296 | if (!ret_val) |
2160 | /* release the swflag because it is not reset by | ||
2161 | * hardware reset | ||
2162 | */ | ||
2163 | e1000_release_swflag_ich8lan(hw); | 2297 | e1000_release_swflag_ich8lan(hw); |
2164 | } | ||
2165 | 2298 | ||
2166 | ret_val = e1000e_get_auto_rd_done(hw); | 2299 | if (ctrl & E1000_CTRL_PHY_RST) |
2167 | if (ret_val) { | 2300 | ret_val = hw->phy.ops.get_cfg_done(hw); |
2168 | /* | 2301 | |
2169 | * When auto config read does not complete, do not | 2302 | if (hw->mac.type >= e1000_ich10lan) { |
2170 | * return with an error. This can happen in situations | 2303 | e1000_lan_init_done_ich8lan(hw); |
2171 | * where there is no eeprom and prevents getting link. | 2304 | } else { |
2172 | */ | 2305 | ret_val = e1000e_get_auto_rd_done(hw); |
2173 | hw_dbg(hw, "Auto Read Done did not complete\n"); | 2306 | if (ret_val) { |
2307 | /* | ||
2308 | * When auto config read does not complete, do not | ||
2309 | * return with an error. This can happen in situations | ||
2310 | * where there is no eeprom and prevents getting link. | ||
2311 | */ | ||
2312 | hw_dbg(hw, "Auto Read Done did not complete\n"); | ||
2313 | } | ||
2174 | } | 2314 | } |
2175 | 2315 | ||
2316 | /* | ||
2317 | * For PCH, this write will make sure that any noise | ||
2318 | * will be detected as a CRC error and be dropped rather than show up | ||
2319 | * as a bad packet to the DMA engine. | ||
2320 | */ | ||
2321 | if (hw->mac.type == e1000_pchlan) | ||
2322 | ew32(CRC_OFFSET, 0x65656565); | ||
2323 | |||
2176 | ew32(IMC, 0xffffffff); | 2324 | ew32(IMC, 0xffffffff); |
2177 | icr = er32(ICR); | 2325 | icr = er32(ICR); |
2178 | 2326 | ||
@@ -2222,6 +2370,18 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) | |||
2222 | for (i = 0; i < mac->mta_reg_count; i++) | 2370 | for (i = 0; i < mac->mta_reg_count; i++) |
2223 | E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); | 2371 | E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); |
2224 | 2372 | ||
2373 | /* | ||
2374 | * The 82578 Rx buffer will stall if wakeup is enabled in host and | ||
2375 | * the ME. Reading the BM_WUC register will clear the host wakeup bit. | ||
2376 | * Reset the phy after disabling host wakeup to reset the Rx buffer. | ||
2377 | */ | ||
2378 | if (hw->phy.type == e1000_phy_82578) { | ||
2379 | hw->phy.ops.read_phy_reg(hw, BM_WUC, &i); | ||
2380 | ret_val = e1000_phy_hw_reset_ich8lan(hw); | ||
2381 | if (ret_val) | ||
2382 | return ret_val; | ||
2383 | } | ||
2384 | |||
2225 | /* Setup link and flow control */ | 2385 | /* Setup link and flow control */ |
2226 | ret_val = e1000_setup_link_ich8lan(hw); | 2386 | ret_val = e1000_setup_link_ich8lan(hw); |
2227 | 2387 | ||
@@ -2254,16 +2414,6 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) | |||
2254 | ew32(CTRL_EXT, ctrl_ext); | 2414 | ew32(CTRL_EXT, ctrl_ext); |
2255 | 2415 | ||
2256 | /* | 2416 | /* |
2257 | * The 82578 Rx buffer will stall if wakeup is enabled in host and | ||
2258 | * the ME. Reading the BM_WUC register will clear the host wakeup bit. | ||
2259 | * Reset the phy after disabling host wakeup to reset the Rx buffer. | ||
2260 | */ | ||
2261 | if (hw->phy.type == e1000_phy_82578) { | ||
2262 | e1e_rphy(hw, BM_WUC, &i); | ||
2263 | e1000e_phy_hw_reset_generic(hw); | ||
2264 | } | ||
2265 | |||
2266 | /* | ||
2267 | * Clear all of the statistics registers (clear on read). It is | 2417 | * Clear all of the statistics registers (clear on read). It is |
2268 | * important that we do this after we have tried to establish link | 2418 | * important that we do this after we have tried to establish link |
2269 | * because the symbol error count will increment wildly if there | 2419 | * because the symbol error count will increment wildly if there |
@@ -2485,6 +2635,14 @@ static s32 e1000_get_link_up_info_ich8lan(struct e1000_hw *hw, u16 *speed, | |||
2485 | if (ret_val) | 2635 | if (ret_val) |
2486 | return ret_val; | 2636 | return ret_val; |
2487 | 2637 | ||
2638 | if ((hw->mac.type == e1000_pchlan) && (*speed == SPEED_1000)) { | ||
2639 | ret_val = e1000e_write_kmrn_reg(hw, | ||
2640 | E1000_KMRNCTRLSTA_K1_CONFIG, | ||
2641 | E1000_KMRNCTRLSTA_K1_DISABLE); | ||
2642 | if (ret_val) | ||
2643 | return ret_val; | ||
2644 | } | ||
2645 | |||
2488 | if ((hw->mac.type == e1000_ich8lan) && | 2646 | if ((hw->mac.type == e1000_ich8lan) && |
2489 | (hw->phy.type == e1000_phy_igp_3) && | 2647 | (hw->phy.type == e1000_phy_igp_3) && |
2490 | (*speed == SPEED_1000)) { | 2648 | (*speed == SPEED_1000)) { |
@@ -2850,6 +3008,16 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw) | |||
2850 | { | 3008 | { |
2851 | u32 bank = 0; | 3009 | u32 bank = 0; |
2852 | 3010 | ||
3011 | if (hw->mac.type >= e1000_pchlan) { | ||
3012 | u32 status = er32(STATUS); | ||
3013 | |||
3014 | if (status & E1000_STATUS_PHYRA) | ||
3015 | ew32(STATUS, status & ~E1000_STATUS_PHYRA); | ||
3016 | else | ||
3017 | hw_dbg(hw, | ||
3018 | "PHY Reset Asserted not set - needs delay\n"); | ||
3019 | } | ||
3020 | |||
2853 | e1000e_get_cfg_done(hw); | 3021 | e1000e_get_cfg_done(hw); |
2854 | 3022 | ||
2855 | /* If EEPROM is not marked present, init the IGP 3 PHY manually */ | 3023 | /* If EEPROM is not marked present, init the IGP 3 PHY manually */ |
@@ -2921,7 +3089,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) | |||
2921 | static struct e1000_mac_operations ich8_mac_ops = { | 3089 | static struct e1000_mac_operations ich8_mac_ops = { |
2922 | .id_led_init = e1000e_id_led_init, | 3090 | .id_led_init = e1000e_id_led_init, |
2923 | .check_mng_mode = e1000_check_mng_mode_ich8lan, | 3091 | .check_mng_mode = e1000_check_mng_mode_ich8lan, |
2924 | .check_for_link = e1000e_check_for_copper_link, | 3092 | .check_for_link = e1000_check_for_copper_link_ich8lan, |
2925 | /* cleanup_led dependent on mac type */ | 3093 | /* cleanup_led dependent on mac type */ |
2926 | .clear_hw_cntrs = e1000_clear_hw_cntrs_ich8lan, | 3094 | .clear_hw_cntrs = e1000_clear_hw_cntrs_ich8lan, |
2927 | .get_bus_info = e1000_get_bus_info_ich8lan, | 3095 | .get_bus_info = e1000_get_bus_info_ich8lan, |
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index be6d9e990374..99ba2b8a2a05 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
@@ -378,12 +378,6 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) | |||
378 | 378 | ||
379 | mac->get_link_status = 0; | 379 | mac->get_link_status = 0; |
380 | 380 | ||
381 | if (hw->phy.type == e1000_phy_82578) { | ||
382 | ret_val = e1000_link_stall_workaround_hv(hw); | ||
383 | if (ret_val) | ||
384 | return ret_val; | ||
385 | } | ||
386 | |||
387 | /* | 381 | /* |
388 | * Check if there was DownShift, must be checked | 382 | * Check if there was DownShift, must be checked |
389 | * immediately after link-up | 383 | * immediately after link-up |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 679885a122b4..63415bb6f48f 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -4785,6 +4785,9 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, | |||
4785 | 4785 | ||
4786 | netif_device_detach(netdev); | 4786 | netif_device_detach(netdev); |
4787 | 4787 | ||
4788 | if (state == pci_channel_io_perm_failure) | ||
4789 | return PCI_ERS_RESULT_DISCONNECT; | ||
4790 | |||
4788 | if (netif_running(netdev)) | 4791 | if (netif_running(netdev)) |
4789 | e1000e_down(adapter); | 4792 | e1000e_down(adapter); |
4790 | pci_disable_device(pdev); | 4793 | pci_disable_device(pdev); |
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index e23459cf3d0e..994401fd0664 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
@@ -1531,7 +1531,12 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, | |||
1531 | */ | 1531 | */ |
1532 | ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status); | 1532 | ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status); |
1533 | if (ret_val) | 1533 | if (ret_val) |
1534 | break; | 1534 | /* |
1535 | * If the first read fails, another entity may have | ||
1536 | * ownership of the resources, wait and try again to | ||
1537 | * see if they have relinquished the resources yet. | ||
1538 | */ | ||
1539 | udelay(usec_interval); | ||
1535 | ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status); | 1540 | ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status); |
1536 | if (ret_val) | 1541 | if (ret_val) |
1537 | break; | 1542 | break; |
@@ -2737,6 +2742,11 @@ s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw) | |||
2737 | if (hw->phy.type != e1000_phy_82578) | 2742 | if (hw->phy.type != e1000_phy_82578) |
2738 | goto out; | 2743 | goto out; |
2739 | 2744 | ||
2745 | /* Do not apply workaround if in PHY loopback bit 14 set */ | ||
2746 | hw->phy.ops.read_phy_reg(hw, PHY_CONTROL, &data); | ||
2747 | if (data & PHY_CONTROL_LB) | ||
2748 | goto out; | ||
2749 | |||
2740 | /* check if link is up and at 1Gbps */ | 2750 | /* check if link is up and at 1Gbps */ |
2741 | ret_val = hw->phy.ops.read_phy_reg(hw, BM_CS_STATUS, &data); | 2751 | ret_val = hw->phy.ops.read_phy_reg(hw, BM_CS_STATUS, &data); |
2742 | if (ret_val) | 2752 | if (ret_val) |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 147c4b088fb3..e8d46cc1bec2 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -3080,7 +3080,9 @@ static const struct net_device_ops ehea_netdev_ops = { | |||
3080 | .ndo_poll_controller = ehea_netpoll, | 3080 | .ndo_poll_controller = ehea_netpoll, |
3081 | #endif | 3081 | #endif |
3082 | .ndo_get_stats = ehea_get_stats, | 3082 | .ndo_get_stats = ehea_get_stats, |
3083 | .ndo_change_mtu = eth_change_mtu, | ||
3083 | .ndo_set_mac_address = ehea_set_mac_addr, | 3084 | .ndo_set_mac_address = ehea_set_mac_addr, |
3085 | .ndo_validate_addr = eth_validate_addr, | ||
3084 | .ndo_set_multicast_list = ehea_set_multicast_list, | 3086 | .ndo_set_multicast_list = ehea_set_multicast_list, |
3085 | .ndo_change_mtu = ehea_change_mtu, | 3087 | .ndo_change_mtu = ehea_change_mtu, |
3086 | .ndo_vlan_rx_register = ehea_vlan_rx_register, | 3088 | .ndo_vlan_rx_register = ehea_vlan_rx_register, |
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index b60e27dfcfa7..88d7ebf31220 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -338,8 +338,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
338 | #ifndef MODULE | 338 | #ifndef MODULE |
339 | static int printed_version; | 339 | static int printed_version; |
340 | if (!printed_version++) | 340 | if (!printed_version++) |
341 | printk (KERN_INFO "%s" KERN_INFO "%s", | 341 | printk(KERN_INFO "%s%s", version, version2); |
342 | version, version2); | ||
343 | #endif | 342 | #endif |
344 | 343 | ||
345 | card_idx++; | 344 | card_idx++; |
@@ -1600,7 +1599,7 @@ static int __init epic_init (void) | |||
1600 | { | 1599 | { |
1601 | /* when a module, this is printed whether or not devices are found in probe */ | 1600 | /* when a module, this is printed whether or not devices are found in probe */ |
1602 | #ifdef MODULE | 1601 | #ifdef MODULE |
1603 | printk (KERN_INFO "%s" KERN_INFO "%s", | 1602 | printk (KERN_INFO "%s%s", |
1604 | version, version2); | 1603 | version, version2); |
1605 | #endif | 1604 | #endif |
1606 | 1605 | ||
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c index 891be28a7d4f..48385c42ab57 100644 --- a/drivers/net/fealnx.c +++ b/drivers/net/fealnx.c | |||
@@ -1209,17 +1209,20 @@ static void fealnx_tx_timeout(struct net_device *dev) | |||
1209 | unsigned long flags; | 1209 | unsigned long flags; |
1210 | int i; | 1210 | int i; |
1211 | 1211 | ||
1212 | printk(KERN_WARNING "%s: Transmit timed out, status %8.8x," | 1212 | printk(KERN_WARNING |
1213 | " resetting...\n", dev->name, ioread32(ioaddr + ISR)); | 1213 | "%s: Transmit timed out, status %8.8x, resetting...\n", |
1214 | dev->name, ioread32(ioaddr + ISR)); | ||
1214 | 1215 | ||
1215 | { | 1216 | { |
1216 | printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); | 1217 | printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); |
1217 | for (i = 0; i < RX_RING_SIZE; i++) | 1218 | for (i = 0; i < RX_RING_SIZE; i++) |
1218 | printk(" %8.8x", (unsigned int) np->rx_ring[i].status); | 1219 | printk(KERN_CONT " %8.8x", |
1219 | printk("\n" KERN_DEBUG " Tx ring %p: ", np->tx_ring); | 1220 | (unsigned int) np->rx_ring[i].status); |
1221 | printk(KERN_CONT "\n"); | ||
1222 | printk(KERN_DEBUG " Tx ring %p: ", np->tx_ring); | ||
1220 | for (i = 0; i < TX_RING_SIZE; i++) | 1223 | for (i = 0; i < TX_RING_SIZE; i++) |
1221 | printk(" %4.4x", np->tx_ring[i].status); | 1224 | printk(KERN_CONT " %4.4x", np->tx_ring[i].status); |
1222 | printk("\n"); | 1225 | printk(KERN_CONT "\n"); |
1223 | } | 1226 | } |
1224 | 1227 | ||
1225 | spin_lock_irqsave(&np->lock, flags); | 1228 | spin_lock_irqsave(&np->lock, flags); |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 0f19b743749b..d4b98074b1b7 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -1642,6 +1642,7 @@ static const struct net_device_ops fec_netdev_ops = { | |||
1642 | .ndo_stop = fec_enet_close, | 1642 | .ndo_stop = fec_enet_close, |
1643 | .ndo_start_xmit = fec_enet_start_xmit, | 1643 | .ndo_start_xmit = fec_enet_start_xmit, |
1644 | .ndo_set_multicast_list = set_multicast_list, | 1644 | .ndo_set_multicast_list = set_multicast_list, |
1645 | .ndo_change_mtu = eth_change_mtu, | ||
1645 | .ndo_validate_addr = eth_validate_addr, | 1646 | .ndo_validate_addr = eth_validate_addr, |
1646 | .ndo_tx_timeout = fec_timeout, | 1647 | .ndo_tx_timeout = fec_timeout, |
1647 | .ndo_set_mac_address = fec_set_mac_address, | 1648 | .ndo_set_mac_address = fec_set_mac_address, |
diff --git a/drivers/net/fec.h b/drivers/net/fec.h index 30b7dd671336..cc47f3f057c7 100644 --- a/drivers/net/fec.h +++ b/drivers/net/fec.h | |||
@@ -46,12 +46,12 @@ | |||
46 | 46 | ||
47 | #else | 47 | #else |
48 | 48 | ||
49 | #define FEC_ECNTRL; 0x000 /* Ethernet control reg */ | 49 | #define FEC_ECNTRL 0x000 /* Ethernet control reg */ |
50 | #define FEC_IEVENT; 0x004 /* Interrupt even reg */ | 50 | #define FEC_IEVENT 0x004 /* Interrupt even reg */ |
51 | #define FEC_IMASK; 0x008 /* Interrupt mask reg */ | 51 | #define FEC_IMASK 0x008 /* Interrupt mask reg */ |
52 | #define FEC_IVEC; 0x00c /* Interrupt vec status reg */ | 52 | #define FEC_IVEC 0x00c /* Interrupt vec status reg */ |
53 | #define FEC_R_DES_ACTIVE; 0x010 /* Receive descriptor reg */ | 53 | #define FEC_R_DES_ACTIVE 0x010 /* Receive descriptor reg */ |
54 | #define FEC_X_DES_ACTIVE; 0x01c /* Transmit descriptor reg */ | 54 | #define FEC_X_DES_ACTIVE 0x014 /* Transmit descriptor reg */ |
55 | #define FEC_MII_DATA 0x040 /* MII manage frame reg */ | 55 | #define FEC_MII_DATA 0x040 /* MII manage frame reg */ |
56 | #define FEC_MII_SPEED 0x044 /* MII speed control reg */ | 56 | #define FEC_MII_SPEED 0x044 /* MII speed control reg */ |
57 | #define FEC_R_BOUND 0x08c /* FIFO receive bound reg */ | 57 | #define FEC_R_BOUND 0x08c /* FIFO receive bound reg */ |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 1094d292630f..3b4e0766c7b2 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -3514,11 +3514,13 @@ static irqreturn_t nv_nic_irq(int foo, void *data) | |||
3514 | nv_msi_workaround(np); | 3514 | nv_msi_workaround(np); |
3515 | 3515 | ||
3516 | #ifdef CONFIG_FORCEDETH_NAPI | 3516 | #ifdef CONFIG_FORCEDETH_NAPI |
3517 | napi_schedule(&np->napi); | 3517 | if (napi_schedule_prep(&np->napi)) { |
3518 | 3518 | /* | |
3519 | /* Disable furthur irq's | 3519 | * Disable further irq's (msix not enabled with napi) |
3520 | (msix not enabled with napi) */ | 3520 | */ |
3521 | writel(0, base + NvRegIrqMask); | 3521 | writel(0, base + NvRegIrqMask); |
3522 | __napi_schedule(&np->napi); | ||
3523 | } | ||
3522 | 3524 | ||
3523 | #else | 3525 | #else |
3524 | do | 3526 | do |
@@ -3615,12 +3617,13 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data) | |||
3615 | nv_msi_workaround(np); | 3617 | nv_msi_workaround(np); |
3616 | 3618 | ||
3617 | #ifdef CONFIG_FORCEDETH_NAPI | 3619 | #ifdef CONFIG_FORCEDETH_NAPI |
3618 | napi_schedule(&np->napi); | 3620 | if (napi_schedule_prep(&np->napi)) { |
3619 | 3621 | /* | |
3620 | /* Disable furthur irq's | 3622 | * Disable further irq's (msix not enabled with napi) |
3621 | (msix not enabled with napi) */ | 3623 | */ |
3622 | writel(0, base + NvRegIrqMask); | 3624 | writel(0, base + NvRegIrqMask); |
3623 | 3625 | __napi_schedule(&np->napi); | |
3626 | } | ||
3624 | #else | 3627 | #else |
3625 | do | 3628 | do |
3626 | { | 3629 | { |
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c index 3af581303ca2..d167090248e2 100644 --- a/drivers/net/fsl_pq_mdio.c +++ b/drivers/net/fsl_pq_mdio.c | |||
@@ -188,7 +188,7 @@ static int fsl_pq_mdio_find_free(struct mii_bus *new_bus) | |||
188 | } | 188 | } |
189 | 189 | ||
190 | 190 | ||
191 | #ifdef CONFIG_GIANFAR | 191 | #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE) |
192 | static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs) | 192 | static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs) |
193 | { | 193 | { |
194 | struct gfar __iomem *enet_regs; | 194 | struct gfar __iomem *enet_regs; |
@@ -206,7 +206,7 @@ static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs) | |||
206 | #endif | 206 | #endif |
207 | 207 | ||
208 | 208 | ||
209 | #ifdef CONFIG_UCC_GETH | 209 | #if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE) |
210 | static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id) | 210 | static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id) |
211 | { | 211 | { |
212 | struct device_node *np = NULL; | 212 | struct device_node *np = NULL; |
@@ -291,7 +291,7 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev, | |||
291 | if (of_device_is_compatible(np, "fsl,gianfar-mdio") || | 291 | if (of_device_is_compatible(np, "fsl,gianfar-mdio") || |
292 | of_device_is_compatible(np, "fsl,gianfar-tbi") || | 292 | of_device_is_compatible(np, "fsl,gianfar-tbi") || |
293 | of_device_is_compatible(np, "gianfar")) { | 293 | of_device_is_compatible(np, "gianfar")) { |
294 | #ifdef CONFIG_GIANFAR | 294 | #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE) |
295 | tbipa = get_gfar_tbipa(regs); | 295 | tbipa = get_gfar_tbipa(regs); |
296 | #else | 296 | #else |
297 | err = -ENODEV; | 297 | err = -ENODEV; |
@@ -299,7 +299,7 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev, | |||
299 | #endif | 299 | #endif |
300 | } else if (of_device_is_compatible(np, "fsl,ucc-mdio") || | 300 | } else if (of_device_is_compatible(np, "fsl,ucc-mdio") || |
301 | of_device_is_compatible(np, "ucc_geth_phy")) { | 301 | of_device_is_compatible(np, "ucc_geth_phy")) { |
302 | #ifdef CONFIG_UCC_GETH | 302 | #if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE) |
303 | u32 id; | 303 | u32 id; |
304 | static u32 mii_mng_master; | 304 | static u32 mii_mng_master; |
305 | 305 | ||
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 4ae1d259fced..43d813ed9f45 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -156,6 +156,8 @@ static const struct net_device_ops gfar_netdev_ops = { | |||
156 | .ndo_tx_timeout = gfar_timeout, | 156 | .ndo_tx_timeout = gfar_timeout, |
157 | .ndo_do_ioctl = gfar_ioctl, | 157 | .ndo_do_ioctl = gfar_ioctl, |
158 | .ndo_vlan_rx_register = gfar_vlan_rx_register, | 158 | .ndo_vlan_rx_register = gfar_vlan_rx_register, |
159 | .ndo_set_mac_address = eth_mac_addr, | ||
160 | .ndo_validate_addr = eth_validate_addr, | ||
159 | #ifdef CONFIG_NET_POLL_CONTROLLER | 161 | #ifdef CONFIG_NET_POLL_CONTROLLER |
160 | .ndo_poll_controller = gfar_netpoll, | 162 | .ndo_poll_controller = gfar_netpoll, |
161 | #endif | 163 | #endif |
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 9d5b62cb30f7..d62378cbc149 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -173,8 +173,8 @@ static int tx_params[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; | |||
173 | 173 | ||
174 | static const char version[] __devinitconst = | 174 | static const char version[] __devinitconst = |
175 | KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker\n" | 175 | KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker\n" |
176 | KERN_INFO " Some modifications by Eric kasten <kasten@nscl.msu.edu>\n" | 176 | " Some modifications by Eric kasten <kasten@nscl.msu.edu>\n" |
177 | KERN_INFO " Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n"; | 177 | " Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n"; |
178 | 178 | ||
179 | 179 | ||
180 | /* IP_MF appears to be only defined in <netinet/ip.h>, however, | 180 | /* IP_MF appears to be only defined in <netinet/ip.h>, however, |
@@ -1080,11 +1080,14 @@ static void hamachi_tx_timeout(struct net_device *dev) | |||
1080 | { | 1080 | { |
1081 | printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring); | 1081 | printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring); |
1082 | for (i = 0; i < RX_RING_SIZE; i++) | 1082 | for (i = 0; i < RX_RING_SIZE; i++) |
1083 | printk(" %8.8x", le32_to_cpu(hmp->rx_ring[i].status_n_length)); | 1083 | printk(KERN_CONT " %8.8x", |
1084 | printk("\n"KERN_DEBUG" Tx ring %p: ", hmp->tx_ring); | 1084 | le32_to_cpu(hmp->rx_ring[i].status_n_length)); |
1085 | printk(KERN_CONT "\n"); | ||
1086 | printk(KERN_DEBUG" Tx ring %p: ", hmp->tx_ring); | ||
1085 | for (i = 0; i < TX_RING_SIZE; i++) | 1087 | for (i = 0; i < TX_RING_SIZE; i++) |
1086 | printk(" %4.4x", le32_to_cpu(hmp->tx_ring[i].status_n_length)); | 1088 | printk(KERN_CONT " %4.4x", |
1087 | printk("\n"); | 1089 | le32_to_cpu(hmp->tx_ring[i].status_n_length)); |
1090 | printk(KERN_CONT "\n"); | ||
1088 | } | 1091 | } |
1089 | 1092 | ||
1090 | /* Reinit the hardware and make sure the Rx and Tx processes | 1093 | /* Reinit the hardware and make sure the Rx and Tx processes |
@@ -1753,13 +1756,13 @@ static int hamachi_close(struct net_device *dev) | |||
1753 | 1756 | ||
1754 | #ifdef __i386__ | 1757 | #ifdef __i386__ |
1755 | if (hamachi_debug > 2) { | 1758 | if (hamachi_debug > 2) { |
1756 | printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", | 1759 | printk(KERN_DEBUG " Tx ring at %8.8x:\n", |
1757 | (int)hmp->tx_ring_dma); | 1760 | (int)hmp->tx_ring_dma); |
1758 | for (i = 0; i < TX_RING_SIZE; i++) | 1761 | for (i = 0; i < TX_RING_SIZE; i++) |
1759 | printk(" %c #%d desc. %8.8x %8.8x.\n", | 1762 | printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x.\n", |
1760 | readl(ioaddr + TxCurPtr) == (long)&hmp->tx_ring[i] ? '>' : ' ', | 1763 | readl(ioaddr + TxCurPtr) == (long)&hmp->tx_ring[i] ? '>' : ' ', |
1761 | i, hmp->tx_ring[i].status_n_length, hmp->tx_ring[i].addr); | 1764 | i, hmp->tx_ring[i].status_n_length, hmp->tx_ring[i].addr); |
1762 | printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", | 1765 | printk(KERN_DEBUG " Rx ring %8.8x:\n", |
1763 | (int)hmp->rx_ring_dma); | 1766 | (int)hmp->rx_ring_dma); |
1764 | for (i = 0; i < RX_RING_SIZE; i++) { | 1767 | for (i = 0; i < RX_RING_SIZE; i++) { |
1765 | printk(KERN_DEBUG " %c #%d desc. %4.4x %8.8x\n", | 1768 | printk(KERN_DEBUG " %c #%d desc. %4.4x %8.8x\n", |
@@ -1770,7 +1773,7 @@ static int hamachi_close(struct net_device *dev) | |||
1770 | u16 *addr = (u16 *) | 1773 | u16 *addr = (u16 *) |
1771 | hmp->rx_skbuff[i]->data; | 1774 | hmp->rx_skbuff[i]->data; |
1772 | int j; | 1775 | int j; |
1773 | 1776 | printk(KERN_DEBUG "Addr: "); | |
1774 | for (j = 0; j < 0x50; j++) | 1777 | for (j = 0; j < 0x50; j++) |
1775 | printk(" %4.4x", addr[j]); | 1778 | printk(" %4.4x", addr[j]); |
1776 | printk("\n"); | 1779 | printk("\n"); |
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 5e4b7afd0683..352703255bba 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c | |||
@@ -68,7 +68,7 @@ static const char paranoia_str[] = KERN_ERR | |||
68 | 68 | ||
69 | static const char bc_drvname[] = "baycom_epp"; | 69 | static const char bc_drvname[] = "baycom_epp"; |
70 | static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n" | 70 | static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n" |
71 | KERN_INFO "baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n"; | 71 | "baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n"; |
72 | 72 | ||
73 | /* --------------------------------------------------------------------- */ | 73 | /* --------------------------------------------------------------------- */ |
74 | 74 | ||
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c index 2e6fc4dc74b1..5f5af9a606f8 100644 --- a/drivers/net/hamradio/baycom_par.c +++ b/drivers/net/hamradio/baycom_par.c | |||
@@ -102,7 +102,7 @@ | |||
102 | 102 | ||
103 | static const char bc_drvname[] = "baycom_par"; | 103 | static const char bc_drvname[] = "baycom_par"; |
104 | static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" | 104 | static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" |
105 | KERN_INFO "baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n"; | 105 | "baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n"; |
106 | 106 | ||
107 | /* --------------------------------------------------------------------- */ | 107 | /* --------------------------------------------------------------------- */ |
108 | 108 | ||
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c index b6a816e60c0f..aa4488e871b2 100644 --- a/drivers/net/hamradio/baycom_ser_fdx.c +++ b/drivers/net/hamradio/baycom_ser_fdx.c | |||
@@ -91,7 +91,7 @@ | |||
91 | 91 | ||
92 | static const char bc_drvname[] = "baycom_ser_fdx"; | 92 | static const char bc_drvname[] = "baycom_ser_fdx"; |
93 | static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" | 93 | static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" |
94 | KERN_INFO "baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; | 94 | "baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; |
95 | 95 | ||
96 | /* --------------------------------------------------------------------- */ | 96 | /* --------------------------------------------------------------------- */ |
97 | 97 | ||
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c index 3bcc57acbe6d..88c593596020 100644 --- a/drivers/net/hamradio/baycom_ser_hdx.c +++ b/drivers/net/hamradio/baycom_ser_hdx.c | |||
@@ -79,7 +79,7 @@ | |||
79 | 79 | ||
80 | static const char bc_drvname[] = "baycom_ser_hdx"; | 80 | static const char bc_drvname[] = "baycom_ser_hdx"; |
81 | static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" | 81 | static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" |
82 | KERN_INFO "baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; | 82 | "baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; |
83 | 83 | ||
84 | /* --------------------------------------------------------------------- */ | 84 | /* --------------------------------------------------------------------- */ |
85 | 85 | ||
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index efd9be214885..ac28dd5a4fd1 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
@@ -190,6 +190,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) | |||
190 | phy->ops.write_reg = igb_write_phy_reg_igp; | 190 | phy->ops.write_reg = igb_write_phy_reg_igp; |
191 | } | 191 | } |
192 | 192 | ||
193 | /* set lan id */ | ||
194 | hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >> | ||
195 | E1000_STATUS_FUNC_SHIFT; | ||
196 | |||
193 | /* Set phy->phy_addr and phy->id. */ | 197 | /* Set phy->phy_addr and phy->id. */ |
194 | ret_val = igb_get_phy_id_82575(hw); | 198 | ret_val = igb_get_phy_id_82575(hw); |
195 | if (ret_val) | 199 | if (ret_val) |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index ea17319624aa..adb09d32625d 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -127,14 +127,48 @@ static void igb_restore_vlan(struct igb_adapter *); | |||
127 | static void igb_ping_all_vfs(struct igb_adapter *); | 127 | static void igb_ping_all_vfs(struct igb_adapter *); |
128 | static void igb_msg_task(struct igb_adapter *); | 128 | static void igb_msg_task(struct igb_adapter *); |
129 | static int igb_rcv_msg_from_vf(struct igb_adapter *, u32); | 129 | static int igb_rcv_msg_from_vf(struct igb_adapter *, u32); |
130 | static inline void igb_set_rah_pool(struct e1000_hw *, int , int); | ||
131 | static void igb_set_mc_list_pools(struct igb_adapter *, int, u16); | 130 | static void igb_set_mc_list_pools(struct igb_adapter *, int, u16); |
132 | static void igb_vmm_control(struct igb_adapter *); | 131 | static void igb_vmm_control(struct igb_adapter *); |
133 | static inline void igb_set_vmolr(struct e1000_hw *, int); | ||
134 | static inline int igb_set_vf_rlpml(struct igb_adapter *, int, int); | ||
135 | static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *); | 132 | static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *); |
136 | static void igb_restore_vf_multicasts(struct igb_adapter *adapter); | 133 | static void igb_restore_vf_multicasts(struct igb_adapter *adapter); |
137 | 134 | ||
135 | static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn) | ||
136 | { | ||
137 | u32 reg_data; | ||
138 | |||
139 | reg_data = rd32(E1000_VMOLR(vfn)); | ||
140 | reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */ | ||
141 | E1000_VMOLR_ROPE | /* Accept packets matched in UTA */ | ||
142 | E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */ | ||
143 | E1000_VMOLR_AUPE | /* Accept untagged packets */ | ||
144 | E1000_VMOLR_STRVLAN; /* Strip vlan tags */ | ||
145 | wr32(E1000_VMOLR(vfn), reg_data); | ||
146 | } | ||
147 | |||
148 | static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size, | ||
149 | int vfn) | ||
150 | { | ||
151 | struct e1000_hw *hw = &adapter->hw; | ||
152 | u32 vmolr; | ||
153 | |||
154 | vmolr = rd32(E1000_VMOLR(vfn)); | ||
155 | vmolr &= ~E1000_VMOLR_RLPML_MASK; | ||
156 | vmolr |= size | E1000_VMOLR_LPE; | ||
157 | wr32(E1000_VMOLR(vfn), vmolr); | ||
158 | |||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry) | ||
163 | { | ||
164 | u32 reg_data; | ||
165 | |||
166 | reg_data = rd32(E1000_RAH(entry)); | ||
167 | reg_data &= ~E1000_RAH_POOL_MASK; | ||
168 | reg_data |= E1000_RAH_POOL_1 << pool;; | ||
169 | wr32(E1000_RAH(entry), reg_data); | ||
170 | } | ||
171 | |||
138 | #ifdef CONFIG_PM | 172 | #ifdef CONFIG_PM |
139 | static int igb_suspend(struct pci_dev *, pm_message_t); | 173 | static int igb_suspend(struct pci_dev *, pm_message_t); |
140 | static int igb_resume(struct pci_dev *); | 174 | static int igb_resume(struct pci_dev *); |
@@ -4549,11 +4583,12 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring, | |||
4549 | cleaned = true; | 4583 | cleaned = true; |
4550 | cleaned_count++; | 4584 | cleaned_count++; |
4551 | 4585 | ||
4586 | /* this is the fast path for the non-packet split case */ | ||
4552 | if (!adapter->rx_ps_hdr_size) { | 4587 | if (!adapter->rx_ps_hdr_size) { |
4553 | pci_unmap_single(pdev, buffer_info->dma, | 4588 | pci_unmap_single(pdev, buffer_info->dma, |
4554 | adapter->rx_buffer_len + | 4589 | adapter->rx_buffer_len, |
4555 | NET_IP_ALIGN, | ||
4556 | PCI_DMA_FROMDEVICE); | 4590 | PCI_DMA_FROMDEVICE); |
4591 | buffer_info->dma = 0; | ||
4557 | skb_put(skb, length); | 4592 | skb_put(skb, length); |
4558 | goto send_up; | 4593 | goto send_up; |
4559 | } | 4594 | } |
@@ -4570,8 +4605,9 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring, | |||
4570 | 4605 | ||
4571 | if (!skb_shinfo(skb)->nr_frags) { | 4606 | if (!skb_shinfo(skb)->nr_frags) { |
4572 | pci_unmap_single(pdev, buffer_info->dma, | 4607 | pci_unmap_single(pdev, buffer_info->dma, |
4573 | adapter->rx_ps_hdr_size + NET_IP_ALIGN, | 4608 | adapter->rx_ps_hdr_size, |
4574 | PCI_DMA_FROMDEVICE); | 4609 | PCI_DMA_FROMDEVICE); |
4610 | buffer_info->dma = 0; | ||
4575 | skb_put(skb, hlen); | 4611 | skb_put(skb, hlen); |
4576 | } | 4612 | } |
4577 | 4613 | ||
@@ -4713,7 +4749,6 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, | |||
4713 | bufsz = adapter->rx_ps_hdr_size; | 4749 | bufsz = adapter->rx_ps_hdr_size; |
4714 | else | 4750 | else |
4715 | bufsz = adapter->rx_buffer_len; | 4751 | bufsz = adapter->rx_buffer_len; |
4716 | bufsz += NET_IP_ALIGN; | ||
4717 | 4752 | ||
4718 | while (cleaned_count--) { | 4753 | while (cleaned_count--) { |
4719 | rx_desc = E1000_RX_DESC_ADV(*rx_ring, i); | 4754 | rx_desc = E1000_RX_DESC_ADV(*rx_ring, i); |
@@ -4737,7 +4772,7 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, | |||
4737 | } | 4772 | } |
4738 | 4773 | ||
4739 | if (!buffer_info->skb) { | 4774 | if (!buffer_info->skb) { |
4740 | skb = netdev_alloc_skb(netdev, bufsz); | 4775 | skb = netdev_alloc_skb(netdev, bufsz + NET_IP_ALIGN); |
4741 | if (!skb) { | 4776 | if (!skb) { |
4742 | adapter->alloc_rx_buff_failed++; | 4777 | adapter->alloc_rx_buff_failed++; |
4743 | goto no_buffers; | 4778 | goto no_buffers; |
@@ -5338,6 +5373,9 @@ static pci_ers_result_t igb_io_error_detected(struct pci_dev *pdev, | |||
5338 | 5373 | ||
5339 | netif_device_detach(netdev); | 5374 | netif_device_detach(netdev); |
5340 | 5375 | ||
5376 | if (state == pci_channel_io_perm_failure) | ||
5377 | return PCI_ERS_RESULT_DISCONNECT; | ||
5378 | |||
5341 | if (netif_running(netdev)) | 5379 | if (netif_running(netdev)) |
5342 | igb_down(adapter); | 5380 | igb_down(adapter); |
5343 | pci_disable_device(pdev); | 5381 | pci_disable_device(pdev); |
@@ -5414,43 +5452,6 @@ static void igb_io_resume(struct pci_dev *pdev) | |||
5414 | igb_get_hw_control(adapter); | 5452 | igb_get_hw_control(adapter); |
5415 | } | 5453 | } |
5416 | 5454 | ||
5417 | static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn) | ||
5418 | { | ||
5419 | u32 reg_data; | ||
5420 | |||
5421 | reg_data = rd32(E1000_VMOLR(vfn)); | ||
5422 | reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */ | ||
5423 | E1000_VMOLR_ROPE | /* Accept packets matched in UTA */ | ||
5424 | E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */ | ||
5425 | E1000_VMOLR_AUPE | /* Accept untagged packets */ | ||
5426 | E1000_VMOLR_STRVLAN; /* Strip vlan tags */ | ||
5427 | wr32(E1000_VMOLR(vfn), reg_data); | ||
5428 | } | ||
5429 | |||
5430 | static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size, | ||
5431 | int vfn) | ||
5432 | { | ||
5433 | struct e1000_hw *hw = &adapter->hw; | ||
5434 | u32 vmolr; | ||
5435 | |||
5436 | vmolr = rd32(E1000_VMOLR(vfn)); | ||
5437 | vmolr &= ~E1000_VMOLR_RLPML_MASK; | ||
5438 | vmolr |= size | E1000_VMOLR_LPE; | ||
5439 | wr32(E1000_VMOLR(vfn), vmolr); | ||
5440 | |||
5441 | return 0; | ||
5442 | } | ||
5443 | |||
5444 | static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry) | ||
5445 | { | ||
5446 | u32 reg_data; | ||
5447 | |||
5448 | reg_data = rd32(E1000_RAH(entry)); | ||
5449 | reg_data &= ~E1000_RAH_POOL_MASK; | ||
5450 | reg_data |= E1000_RAH_POOL_1 << pool;; | ||
5451 | wr32(E1000_RAH(entry), reg_data); | ||
5452 | } | ||
5453 | |||
5454 | static void igb_set_mc_list_pools(struct igb_adapter *adapter, | 5455 | static void igb_set_mc_list_pools(struct igb_adapter *adapter, |
5455 | int entry_count, u16 total_rar_filters) | 5456 | int entry_count, u16 total_rar_filters) |
5456 | { | 5457 | { |
diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c index f3eed6a8fba5..911c082cee5a 100644 --- a/drivers/net/irda/bfin_sir.c +++ b/drivers/net/irda/bfin_sir.c | |||
@@ -677,6 +677,14 @@ static int bfin_sir_init_iobuf(iobuff_t *io, int size) | |||
677 | return 0; | 677 | return 0; |
678 | } | 678 | } |
679 | 679 | ||
680 | static const struct net_device_ops bfin_sir_ndo = { | ||
681 | .ndo_open = bfin_sir_open, | ||
682 | .ndo_stop = bfin_sir_stop, | ||
683 | .ndo_start_xmit = bfin_sir_hard_xmit, | ||
684 | .ndo_do_ioctl = bfin_sir_ioctl, | ||
685 | .ndo_get_stats = bfin_sir_stats, | ||
686 | }; | ||
687 | |||
680 | static int __devinit bfin_sir_probe(struct platform_device *pdev) | 688 | static int __devinit bfin_sir_probe(struct platform_device *pdev) |
681 | { | 689 | { |
682 | struct net_device *dev; | 690 | struct net_device *dev; |
@@ -718,12 +726,8 @@ static int __devinit bfin_sir_probe(struct platform_device *pdev) | |||
718 | if (err) | 726 | if (err) |
719 | goto err_mem_3; | 727 | goto err_mem_3; |
720 | 728 | ||
721 | dev->hard_start_xmit = bfin_sir_hard_xmit; | 729 | dev->netdev_ops = &bfin_sir_ndo; |
722 | dev->open = bfin_sir_open; | 730 | dev->irq = sir_port->irq; |
723 | dev->stop = bfin_sir_stop; | ||
724 | dev->do_ioctl = bfin_sir_ioctl; | ||
725 | dev->get_stats = bfin_sir_stats; | ||
726 | dev->irq = sir_port->irq; | ||
727 | 731 | ||
728 | irda_init_max_qos_capabilies(&self->qos); | 732 | irda_init_max_qos_capabilies(&self->qos); |
729 | 733 | ||
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c index d53aa9582137..20f9bc626688 100644 --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/tty.h> | 31 | #include <linux/tty.h> |
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
34 | #include <linux/smp_lock.h> | ||
35 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
36 | #include <linux/mutex.h> | 35 | #include <linux/mutex.h> |
37 | 36 | ||
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c index 73585fd8f29f..d12377b84358 100644 --- a/drivers/net/isa-skeleton.c +++ b/drivers/net/isa-skeleton.c | |||
@@ -430,7 +430,8 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
430 | * hardware interrupt handler. Queue flow control is | 430 | * hardware interrupt handler. Queue flow control is |
431 | * thus managed under this lock as well. | 431 | * thus managed under this lock as well. |
432 | */ | 432 | */ |
433 | spin_lock_irq(&np->lock); | 433 | unsigned long flags; |
434 | spin_lock_irqsave(&np->lock, flags); | ||
434 | 435 | ||
435 | add_to_tx_ring(np, skb, length); | 436 | add_to_tx_ring(np, skb, length); |
436 | dev->trans_start = jiffies; | 437 | dev->trans_start = jiffies; |
@@ -446,7 +447,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
446 | * is when the transmit statistics are updated. | 447 | * is when the transmit statistics are updated. |
447 | */ | 448 | */ |
448 | 449 | ||
449 | spin_unlock_irq(&np->lock); | 450 | spin_unlock_irqrestore(&np->lock, flags); |
450 | #else | 451 | #else |
451 | /* This is the case for older hardware which takes | 452 | /* This is the case for older hardware which takes |
452 | * a single transmit buffer at a time, and it is | 453 | * a single transmit buffer at a time, and it is |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index d56890f5c9d5..7c5978ad929a 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c | |||
@@ -138,6 +138,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
138 | adapter->hw.fc.requested_mode = ixgbe_fc_none; | 138 | adapter->hw.fc.requested_mode = ixgbe_fc_none; |
139 | } | 139 | } |
140 | adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; | 140 | adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; |
141 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) { | ||
142 | adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; | ||
143 | adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; | ||
144 | } | ||
141 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; | 145 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; |
142 | ixgbe_init_interrupt_scheme(adapter); | 146 | ixgbe_init_interrupt_scheme(adapter); |
143 | if (netif_running(netdev)) | 147 | if (netif_running(netdev)) |
@@ -154,6 +158,8 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
154 | adapter->dcb_cfg.pfc_mode_enable = false; | 158 | adapter->dcb_cfg.pfc_mode_enable = false; |
155 | adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; | 159 | adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; |
156 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; | 160 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; |
161 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) | ||
162 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; | ||
157 | ixgbe_init_interrupt_scheme(adapter); | 163 | ixgbe_init_interrupt_scheme(adapter); |
158 | if (netif_running(netdev)) | 164 | if (netif_running(netdev)) |
159 | netdev->netdev_ops->ndo_open(netdev); | 165 | netdev->netdev_ops->ndo_open(netdev); |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 86f4f3e36f27..2a978008fd6e 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -139,7 +139,7 @@ static int ixgbe_get_settings(struct net_device *netdev, | |||
139 | ecmd->autoneg = AUTONEG_ENABLE; | 139 | ecmd->autoneg = AUTONEG_ENABLE; |
140 | ecmd->transceiver = XCVR_EXTERNAL; | 140 | ecmd->transceiver = XCVR_EXTERNAL; |
141 | if ((hw->phy.media_type == ixgbe_media_type_copper) || | 141 | if ((hw->phy.media_type == ixgbe_media_type_copper) || |
142 | (hw->mac.type == ixgbe_mac_82599EB)) { | 142 | (hw->phy.multispeed_fiber)) { |
143 | ecmd->supported |= (SUPPORTED_1000baseT_Full | | 143 | ecmd->supported |= (SUPPORTED_1000baseT_Full | |
144 | SUPPORTED_Autoneg); | 144 | SUPPORTED_Autoneg); |
145 | 145 | ||
@@ -217,7 +217,7 @@ static int ixgbe_set_settings(struct net_device *netdev, | |||
217 | s32 err = 0; | 217 | s32 err = 0; |
218 | 218 | ||
219 | if ((hw->phy.media_type == ixgbe_media_type_copper) || | 219 | if ((hw->phy.media_type == ixgbe_media_type_copper) || |
220 | (hw->mac.type == ixgbe_mac_82599EB)) { | 220 | (hw->phy.multispeed_fiber)) { |
221 | /* 10000/copper and 1000/copper must autoneg | 221 | /* 10000/copper and 1000/copper must autoneg |
222 | * this function does not support any duplex forcing, but can | 222 | * this function does not support any duplex forcing, but can |
223 | * limit the advertising of the adapter to only 10000 or 1000 */ | 223 | * limit the advertising of the adapter to only 10000 or 1000 */ |
@@ -245,6 +245,7 @@ static int ixgbe_set_settings(struct net_device *netdev, | |||
245 | } else { | 245 | } else { |
246 | /* in this case we currently only support 10Gb/FULL */ | 246 | /* in this case we currently only support 10Gb/FULL */ |
247 | if ((ecmd->autoneg == AUTONEG_ENABLE) || | 247 | if ((ecmd->autoneg == AUTONEG_ENABLE) || |
248 | (ecmd->advertising != ADVERTISED_10000baseT_Full) || | ||
248 | (ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL)) | 249 | (ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL)) |
249 | return -EINVAL; | 250 | return -EINVAL; |
250 | } | 251 | } |
@@ -1829,7 +1830,6 @@ static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter, | |||
1829 | break; | 1830 | break; |
1830 | default: | 1831 | default: |
1831 | wol->supported = 0; | 1832 | wol->supported = 0; |
1832 | retval = 0; | ||
1833 | } | 1833 | } |
1834 | 1834 | ||
1835 | return retval; | 1835 | return retval; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index e756e220db32..e3442f47f932 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -563,7 +563,6 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
563 | union ixgbe_adv_rx_desc *rx_desc; | 563 | union ixgbe_adv_rx_desc *rx_desc; |
564 | struct ixgbe_rx_buffer *bi; | 564 | struct ixgbe_rx_buffer *bi; |
565 | unsigned int i; | 565 | unsigned int i; |
566 | unsigned int bufsz = rx_ring->rx_buf_len + NET_IP_ALIGN; | ||
567 | 566 | ||
568 | i = rx_ring->next_to_use; | 567 | i = rx_ring->next_to_use; |
569 | bi = &rx_ring->rx_buffer_info[i]; | 568 | bi = &rx_ring->rx_buffer_info[i]; |
@@ -593,7 +592,9 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
593 | 592 | ||
594 | if (!bi->skb) { | 593 | if (!bi->skb) { |
595 | struct sk_buff *skb; | 594 | struct sk_buff *skb; |
596 | skb = netdev_alloc_skb(adapter->netdev, bufsz); | 595 | skb = netdev_alloc_skb(adapter->netdev, |
596 | (rx_ring->rx_buf_len + | ||
597 | NET_IP_ALIGN)); | ||
597 | 598 | ||
598 | if (!skb) { | 599 | if (!skb) { |
599 | adapter->alloc_rx_buff_failed++; | 600 | adapter->alloc_rx_buff_failed++; |
@@ -608,7 +609,8 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
608 | skb_reserve(skb, NET_IP_ALIGN); | 609 | skb_reserve(skb, NET_IP_ALIGN); |
609 | 610 | ||
610 | bi->skb = skb; | 611 | bi->skb = skb; |
611 | bi->dma = pci_map_single(pdev, skb->data, bufsz, | 612 | bi->dma = pci_map_single(pdev, skb->data, |
613 | rx_ring->rx_buf_len, | ||
612 | PCI_DMA_FROMDEVICE); | 614 | PCI_DMA_FROMDEVICE); |
613 | } | 615 | } |
614 | /* Refresh the desc even if buffer_addrs didn't change because | 616 | /* Refresh the desc even if buffer_addrs didn't change because |
@@ -732,6 +734,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
732 | pci_unmap_single(pdev, rx_buffer_info->dma, | 734 | pci_unmap_single(pdev, rx_buffer_info->dma, |
733 | rx_ring->rx_buf_len, | 735 | rx_ring->rx_buf_len, |
734 | PCI_DMA_FROMDEVICE); | 736 | PCI_DMA_FROMDEVICE); |
737 | rx_buffer_info->dma = 0; | ||
735 | skb_put(skb, len); | 738 | skb_put(skb, len); |
736 | } | 739 | } |
737 | 740 | ||
@@ -2694,16 +2697,23 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) | |||
2694 | 2697 | ||
2695 | /* | 2698 | /* |
2696 | * For hot-pluggable SFP+ devices, a new SFP+ module may have | 2699 | * For hot-pluggable SFP+ devices, a new SFP+ module may have |
2697 | * arrived before interrupts were enabled. We need to kick off | 2700 | * arrived before interrupts were enabled but after probe. Such |
2698 | * the SFP+ module setup first, then try to bring up link. | 2701 | * devices wouldn't have their type identified yet. We need to |
2702 | * kick off the SFP+ module setup first, then try to bring up link. | ||
2699 | * If we're not hot-pluggable SFP+, we just need to configure link | 2703 | * If we're not hot-pluggable SFP+, we just need to configure link |
2700 | * and bring it up. | 2704 | * and bring it up. |
2701 | */ | 2705 | */ |
2702 | err = hw->phy.ops.identify(hw); | 2706 | if (hw->phy.type == ixgbe_phy_unknown) { |
2703 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 2707 | err = hw->phy.ops.identify(hw); |
2704 | DPRINTK(PROBE, ERR, "PHY not supported on this NIC %d\n", err); | 2708 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
2705 | ixgbe_down(adapter); | 2709 | /* |
2706 | return err; | 2710 | * Take the device down and schedule the sfp tasklet |
2711 | * which will unregister_netdev and log it. | ||
2712 | */ | ||
2713 | ixgbe_down(adapter); | ||
2714 | schedule_work(&adapter->sfp_config_module_task); | ||
2715 | return err; | ||
2716 | } | ||
2707 | } | 2717 | } |
2708 | 2718 | ||
2709 | if (ixgbe_is_sfp(hw)) { | 2719 | if (ixgbe_is_sfp(hw)) { |
@@ -2812,9 +2822,11 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter, | |||
2812 | } | 2822 | } |
2813 | if (!rx_buffer_info->page) | 2823 | if (!rx_buffer_info->page) |
2814 | continue; | 2824 | continue; |
2815 | pci_unmap_page(pdev, rx_buffer_info->page_dma, PAGE_SIZE / 2, | 2825 | if (rx_buffer_info->page_dma) { |
2816 | PCI_DMA_FROMDEVICE); | 2826 | pci_unmap_page(pdev, rx_buffer_info->page_dma, |
2817 | rx_buffer_info->page_dma = 0; | 2827 | PAGE_SIZE / 2, PCI_DMA_FROMDEVICE); |
2828 | rx_buffer_info->page_dma = 0; | ||
2829 | } | ||
2818 | put_page(rx_buffer_info->page); | 2830 | put_page(rx_buffer_info->page); |
2819 | rx_buffer_info->page = NULL; | 2831 | rx_buffer_info->page = NULL; |
2820 | rx_buffer_info->page_offset = 0; | 2832 | rx_buffer_info->page_offset = 0; |
@@ -3118,7 +3130,11 @@ static inline bool ixgbe_set_fcoe_queues(struct ixgbe_adapter *adapter) | |||
3118 | #endif | 3130 | #endif |
3119 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { | 3131 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { |
3120 | DPRINTK(PROBE, INFO, "FCOE enabled with RSS \n"); | 3132 | DPRINTK(PROBE, INFO, "FCOE enabled with RSS \n"); |
3121 | ixgbe_set_rss_queues(adapter); | 3133 | if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) || |
3134 | (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) | ||
3135 | ixgbe_set_fdir_queues(adapter); | ||
3136 | else | ||
3137 | ixgbe_set_rss_queues(adapter); | ||
3122 | } | 3138 | } |
3123 | /* adding FCoE rx rings to the end */ | 3139 | /* adding FCoE rx rings to the end */ |
3124 | f->mask = adapter->num_rx_queues; | 3140 | f->mask = adapter->num_rx_queues; |
@@ -3376,7 +3392,12 @@ static inline bool ixgbe_cache_ring_fcoe(struct ixgbe_adapter *adapter) | |||
3376 | } | 3392 | } |
3377 | #endif /* CONFIG_IXGBE_DCB */ | 3393 | #endif /* CONFIG_IXGBE_DCB */ |
3378 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { | 3394 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { |
3379 | ixgbe_cache_ring_rss(adapter); | 3395 | if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) || |
3396 | (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) | ||
3397 | ixgbe_cache_ring_fdir(adapter); | ||
3398 | else | ||
3399 | ixgbe_cache_ring_rss(adapter); | ||
3400 | |||
3380 | fcoe_i = f->mask; | 3401 | fcoe_i = f->mask; |
3381 | } | 3402 | } |
3382 | for (i = 0; i < f->indices; i++, fcoe_i++) | 3403 | for (i = 0; i < f->indices; i++, fcoe_i++) |
@@ -3716,14 +3737,15 @@ static void ixgbe_sfp_task(struct work_struct *work) | |||
3716 | if ((hw->phy.type == ixgbe_phy_nl) && | 3737 | if ((hw->phy.type == ixgbe_phy_nl) && |
3717 | (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) { | 3738 | (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) { |
3718 | s32 ret = hw->phy.ops.identify_sfp(hw); | 3739 | s32 ret = hw->phy.ops.identify_sfp(hw); |
3719 | if (ret) | 3740 | if (ret == IXGBE_ERR_SFP_NOT_PRESENT) |
3720 | goto reschedule; | 3741 | goto reschedule; |
3721 | ret = hw->phy.ops.reset(hw); | 3742 | ret = hw->phy.ops.reset(hw); |
3722 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 3743 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
3723 | DPRINTK(PROBE, ERR, "failed to initialize because an " | 3744 | dev_err(&adapter->pdev->dev, "failed to initialize " |
3724 | "unsupported SFP+ module type was detected.\n" | 3745 | "because an unsupported SFP+ module type " |
3725 | "Reload the driver after installing a " | 3746 | "was detected.\n" |
3726 | "supported module.\n"); | 3747 | "Reload the driver after installing a " |
3748 | "supported module.\n"); | ||
3727 | unregister_netdev(adapter->netdev); | 3749 | unregister_netdev(adapter->netdev); |
3728 | } else { | 3750 | } else { |
3729 | DPRINTK(PROBE, INFO, "detected SFP+: %d\n", | 3751 | DPRINTK(PROBE, INFO, "detected SFP+: %d\n", |
@@ -4502,7 +4524,8 @@ static void ixgbe_multispeed_fiber_task(struct work_struct *work) | |||
4502 | u32 autoneg; | 4524 | u32 autoneg; |
4503 | 4525 | ||
4504 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; | 4526 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; |
4505 | if (hw->mac.ops.get_link_capabilities) | 4527 | autoneg = hw->phy.autoneg_advertised; |
4528 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) | ||
4506 | hw->mac.ops.get_link_capabilities(hw, &autoneg, | 4529 | hw->mac.ops.get_link_capabilities(hw, &autoneg, |
4507 | &hw->mac.autoneg); | 4530 | &hw->mac.autoneg); |
4508 | if (hw->mac.ops.setup_link_speed) | 4531 | if (hw->mac.ops.setup_link_speed) |
@@ -4524,10 +4547,17 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work) | |||
4524 | u32 err; | 4547 | u32 err; |
4525 | 4548 | ||
4526 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; | 4549 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; |
4550 | |||
4551 | /* Time for electrical oscillations to settle down */ | ||
4552 | msleep(100); | ||
4527 | err = hw->phy.ops.identify_sfp(hw); | 4553 | err = hw->phy.ops.identify_sfp(hw); |
4554 | |||
4528 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 4555 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
4529 | DPRINTK(PROBE, ERR, "PHY not supported on this NIC %d\n", err); | 4556 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
4530 | ixgbe_down(adapter); | 4557 | "an unsupported SFP+ module type was detected.\n" |
4558 | "Reload the driver after installing a supported " | ||
4559 | "module.\n"); | ||
4560 | unregister_netdev(adapter->netdev); | ||
4531 | return; | 4561 | return; |
4532 | } | 4562 | } |
4533 | hw->mac.ops.setup_sfp(hw); | 4563 | hw->mac.ops.setup_sfp(hw); |
@@ -5513,8 +5543,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5513 | round_jiffies(jiffies + (2 * HZ))); | 5543 | round_jiffies(jiffies + (2 * HZ))); |
5514 | err = 0; | 5544 | err = 0; |
5515 | } else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 5545 | } else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
5516 | dev_err(&adapter->pdev->dev, "failed to load because an " | 5546 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
5517 | "unsupported SFP+ module type was detected.\n"); | 5547 | "an unsupported SFP+ module type was detected.\n" |
5548 | "Reload the driver after installing a supported " | ||
5549 | "module.\n"); | ||
5518 | goto err_sw_init; | 5550 | goto err_sw_init; |
5519 | } else if (err) { | 5551 | } else if (err) { |
5520 | dev_err(&adapter->pdev->dev, "HW Init failed: %d\n", err); | 5552 | dev_err(&adapter->pdev->dev, "HW Init failed: %d\n", err); |
@@ -5555,12 +5587,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5555 | netdev->features |= NETIF_F_FCOE_CRC; | 5587 | netdev->features |= NETIF_F_FCOE_CRC; |
5556 | netdev->features |= NETIF_F_FSO; | 5588 | netdev->features |= NETIF_F_FSO; |
5557 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; | 5589 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; |
5558 | DPRINTK(DRV, INFO, "FCoE enabled, " | ||
5559 | "disabling Flow Director\n"); | ||
5560 | adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; | ||
5561 | adapter->flags &= | ||
5562 | ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; | ||
5563 | adapter->atr_sample_rate = 0; | ||
5564 | } else { | 5590 | } else { |
5565 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; | 5591 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; |
5566 | } | 5592 | } |
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c index 453e966762f0..9ecad17522c3 100644 --- a/drivers/net/ixgbe/ixgbe_phy.c +++ b/drivers/net/ixgbe/ixgbe_phy.c | |||
@@ -60,6 +60,7 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw) | |||
60 | 60 | ||
61 | if (hw->phy.type == ixgbe_phy_unknown) { | 61 | if (hw->phy.type == ixgbe_phy_unknown) { |
62 | for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) { | 62 | for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) { |
63 | hw->phy.mdio.prtad = phy_addr; | ||
63 | if (mdio45_probe(&hw->phy.mdio, phy_addr) == 0) { | 64 | if (mdio45_probe(&hw->phy.mdio, phy_addr) == 0) { |
64 | ixgbe_get_phy_id(hw); | 65 | ixgbe_get_phy_id(hw); |
65 | hw->phy.type = | 66 | hw->phy.type = |
@@ -68,6 +69,8 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw) | |||
68 | break; | 69 | break; |
69 | } | 70 | } |
70 | } | 71 | } |
72 | /* clear value if nothing found */ | ||
73 | hw->phy.mdio.prtad = 0; | ||
71 | } else { | 74 | } else { |
72 | status = 0; | 75 | status = 0; |
73 | } | 76 | } |
diff --git a/drivers/net/mdio.c b/drivers/net/mdio.c index dc45e9856c35..6851bdb2ce29 100644 --- a/drivers/net/mdio.c +++ b/drivers/net/mdio.c | |||
@@ -14,6 +14,10 @@ | |||
14 | #include <linux/mdio.h> | 14 | #include <linux/mdio.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | 16 | ||
17 | MODULE_DESCRIPTION("Generic support for MDIO-compatible transceivers"); | ||
18 | MODULE_AUTHOR("Copyright 2006-2009 Solarflare Communications Inc."); | ||
19 | MODULE_LICENSE("GPL"); | ||
20 | |||
17 | /** | 21 | /** |
18 | * mdio45_probe - probe for an MDIO (clause 45) device | 22 | * mdio45_probe - probe for an MDIO (clause 45) device |
19 | * @mdio: MDIO interface | 23 | * @mdio: MDIO interface |
diff --git a/drivers/net/mlx4/cmd.c b/drivers/net/mlx4/cmd.c index 2845a0560b84..65ec77dc31f5 100644 --- a/drivers/net/mlx4/cmd.c +++ b/drivers/net/mlx4/cmd.c | |||
@@ -80,7 +80,9 @@ enum { | |||
80 | /* Bad management packet (silently discarded): */ | 80 | /* Bad management packet (silently discarded): */ |
81 | CMD_STAT_BAD_PKT = 0x30, | 81 | CMD_STAT_BAD_PKT = 0x30, |
82 | /* More outstanding CQEs in CQ than new CQ size: */ | 82 | /* More outstanding CQEs in CQ than new CQ size: */ |
83 | CMD_STAT_BAD_SIZE = 0x40 | 83 | CMD_STAT_BAD_SIZE = 0x40, |
84 | /* Multi Function device support required: */ | ||
85 | CMD_STAT_MULTI_FUNC_REQ = 0x50, | ||
84 | }; | 86 | }; |
85 | 87 | ||
86 | enum { | 88 | enum { |
@@ -128,6 +130,7 @@ static int mlx4_status_to_errno(u8 status) | |||
128 | [CMD_STAT_LAM_NOT_PRE] = -EAGAIN, | 130 | [CMD_STAT_LAM_NOT_PRE] = -EAGAIN, |
129 | [CMD_STAT_BAD_PKT] = -EINVAL, | 131 | [CMD_STAT_BAD_PKT] = -EINVAL, |
130 | [CMD_STAT_BAD_SIZE] = -ENOMEM, | 132 | [CMD_STAT_BAD_SIZE] = -ENOMEM, |
133 | [CMD_STAT_MULTI_FUNC_REQ] = -EACCES, | ||
131 | }; | 134 | }; |
132 | 135 | ||
133 | if (status >= ARRAY_SIZE(trans_table) || | 136 | if (status >= ARRAY_SIZE(trans_table) || |
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 018348c01193..dac621b1e9fc 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -729,7 +729,10 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
729 | 729 | ||
730 | err = mlx4_QUERY_FW(dev); | 730 | err = mlx4_QUERY_FW(dev); |
731 | if (err) { | 731 | if (err) { |
732 | mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); | 732 | if (err == -EACCES) |
733 | mlx4_info(dev, "non-primary physical function, skipping.\n"); | ||
734 | else | ||
735 | mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); | ||
733 | return err; | 736 | return err; |
734 | } | 737 | } |
735 | 738 | ||
@@ -1285,6 +1288,7 @@ static struct pci_device_id mlx4_pci_table[] = { | |||
1285 | { PCI_VDEVICE(MELLANOX, 0x6750) }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */ | 1288 | { PCI_VDEVICE(MELLANOX, 0x6750) }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */ |
1286 | { PCI_VDEVICE(MELLANOX, 0x6372) }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */ | 1289 | { PCI_VDEVICE(MELLANOX, 0x6372) }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */ |
1287 | { PCI_VDEVICE(MELLANOX, 0x675a) }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */ | 1290 | { PCI_VDEVICE(MELLANOX, 0x675a) }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */ |
1291 | { PCI_VDEVICE(MELLANOX, 0x6764) }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/ | ||
1288 | { 0, } | 1292 | { 0, } |
1289 | }; | 1293 | }; |
1290 | 1294 | ||
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index c9bfe4eea189..78c088331f57 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -130,8 +130,8 @@ static int full_duplex[MAX_UNITS]; | |||
130 | static const char version[] __devinitconst = | 130 | static const char version[] __devinitconst = |
131 | KERN_INFO DRV_NAME " dp8381x driver, version " | 131 | KERN_INFO DRV_NAME " dp8381x driver, version " |
132 | DRV_VERSION ", " DRV_RELDATE "\n" | 132 | DRV_VERSION ", " DRV_RELDATE "\n" |
133 | KERN_INFO " originally by Donald Becker <becker@scyld.com>\n" | 133 | " originally by Donald Becker <becker@scyld.com>\n" |
134 | KERN_INFO " 2.4.x kernel port by Jeff Garzik, Tjeerd Mulder\n"; | 134 | " 2.4.x kernel port by Jeff Garzik, Tjeerd Mulder\n"; |
135 | 135 | ||
136 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); | 136 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); |
137 | MODULE_DESCRIPTION("National Semiconductor DP8381x series PCI Ethernet driver"); | 137 | MODULE_DESCRIPTION("National Semiconductor DP8381x series PCI Ethernet driver"); |
diff --git a/drivers/net/ne.c b/drivers/net/ne.c index 5c3e242428f1..992dbfffdb05 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c | |||
@@ -321,7 +321,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr) | |||
321 | } | 321 | } |
322 | 322 | ||
323 | if (ei_debug && version_printed++ == 0) | 323 | if (ei_debug && version_printed++ == 0) |
324 | printk(KERN_INFO "%s" KERN_INFO "%s", version1, version2); | 324 | printk(KERN_INFO "%s%s", version1, version2); |
325 | 325 | ||
326 | printk(KERN_INFO "NE*000 ethercard probe at %#3lx:", ioaddr); | 326 | printk(KERN_INFO "NE*000 ethercard probe at %#3lx:", ioaddr); |
327 | 327 | ||
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 970cedeb5f37..e1cdba752e09 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -60,7 +60,18 @@ | |||
60 | #define _NETXEN_NIC_LINUX_SUBVERSION 30 | 60 | #define _NETXEN_NIC_LINUX_SUBVERSION 30 |
61 | #define NETXEN_NIC_LINUX_VERSIONID "4.0.30" | 61 | #define NETXEN_NIC_LINUX_VERSIONID "4.0.30" |
62 | 62 | ||
63 | #define NETXEN_VERSION_CODE(a, b, c) (((a) << 16) + ((b) << 8) + (c)) | 63 | #define NETXEN_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c)) |
64 | #define _major(v) (((v) >> 24) & 0xff) | ||
65 | #define _minor(v) (((v) >> 16) & 0xff) | ||
66 | #define _build(v) ((v) & 0xffff) | ||
67 | |||
68 | /* version in image has weird encoding: | ||
69 | * 7:0 - major | ||
70 | * 15:8 - minor | ||
71 | * 31:16 - build (little endian) | ||
72 | */ | ||
73 | #define NETXEN_DECODE_VERSION(v) \ | ||
74 | NETXEN_VERSION_CODE(((v) & 0xff), (((v) >> 8) & 0xff), ((v) >> 16)) | ||
64 | 75 | ||
65 | #define NETXEN_NUM_FLASH_SECTORS (64) | 76 | #define NETXEN_NUM_FLASH_SECTORS (64) |
66 | #define NETXEN_FLASH_SECTOR_SIZE (64 * 1024) | 77 | #define NETXEN_FLASH_SECTOR_SIZE (64 * 1024) |
@@ -614,6 +625,7 @@ struct netxen_new_user_info { | |||
614 | #define NX_P2_MN_ROMIMAGE 0 | 625 | #define NX_P2_MN_ROMIMAGE 0 |
615 | #define NX_P3_CT_ROMIMAGE 1 | 626 | #define NX_P3_CT_ROMIMAGE 1 |
616 | #define NX_P3_MN_ROMIMAGE 2 | 627 | #define NX_P3_MN_ROMIMAGE 2 |
628 | #define NX_FLASH_ROMIMAGE 3 | ||
617 | 629 | ||
618 | #define NETXEN_USER_START_OLD NETXEN_PXE_START /* for backward compatibility */ | 630 | #define NETXEN_USER_START_OLD NETXEN_PXE_START /* for backward compatibility */ |
619 | 631 | ||
@@ -1243,7 +1255,7 @@ struct netxen_adapter { | |||
1243 | u32 resv3; | 1255 | u32 resv3; |
1244 | 1256 | ||
1245 | u8 has_link_events; | 1257 | u8 has_link_events; |
1246 | u8 resv1; | 1258 | u8 fw_type; |
1247 | u16 tx_context_id; | 1259 | u16 tx_context_id; |
1248 | u16 mtu; | 1260 | u16 mtu; |
1249 | u16 is_up; | 1261 | u16 is_up; |
@@ -1387,6 +1399,7 @@ void netxen_free_adapter_offload(struct netxen_adapter *adapter); | |||
1387 | int netxen_initialize_adapter_offload(struct netxen_adapter *adapter); | 1399 | int netxen_initialize_adapter_offload(struct netxen_adapter *adapter); |
1388 | int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val); | 1400 | int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val); |
1389 | int netxen_load_firmware(struct netxen_adapter *adapter); | 1401 | int netxen_load_firmware(struct netxen_adapter *adapter); |
1402 | int netxen_need_fw_reset(struct netxen_adapter *adapter); | ||
1390 | void netxen_request_firmware(struct netxen_adapter *adapter); | 1403 | void netxen_request_firmware(struct netxen_adapter *adapter); |
1391 | void netxen_release_firmware(struct netxen_adapter *adapter); | 1404 | void netxen_release_firmware(struct netxen_adapter *adapter); |
1392 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose); | 1405 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose); |
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h index 3cc047844af3..824103675648 100644 --- a/drivers/net/netxen/netxen_nic_hdr.h +++ b/drivers/net/netxen/netxen_nic_hdr.h | |||
@@ -853,6 +853,7 @@ enum { | |||
853 | #define NX_PEG_TUNE_CAPABILITY (NETXEN_CAM_RAM(0x02c)) | 853 | #define NX_PEG_TUNE_CAPABILITY (NETXEN_CAM_RAM(0x02c)) |
854 | 854 | ||
855 | #define NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL (0x14) | 855 | #define NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL (0x14) |
856 | #define NETXEN_PEG_ALIVE_COUNTER (NETXEN_CAM_RAM(0xb0)) | ||
856 | 857 | ||
857 | #define ISR_MSI_INT_TRIGGER(FUNC) (NETXEN_PCIX_PS_REG(PCIX_MSI_F(FUNC))) | 858 | #define ISR_MSI_INT_TRIGGER(FUNC) (NETXEN_PCIX_PS_REG(PCIX_MSI_F(FUNC))) |
858 | #define ISR_LEGACY_INT_TRIGGERED(VAL) (((VAL) & 0x300) == 0x200) | 859 | #define ISR_LEGACY_INT_TRIGGERED(VAL) (((VAL) & 0x300) == 0x200) |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index bdb143d2b5c7..b899bd51fcd8 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -684,11 +684,84 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
684 | } | 684 | } |
685 | 685 | ||
686 | int | 686 | int |
687 | netxen_need_fw_reset(struct netxen_adapter *adapter) | ||
688 | { | ||
689 | u32 count, old_count; | ||
690 | u32 val, version, major, minor, build; | ||
691 | int i, timeout; | ||
692 | u8 fw_type; | ||
693 | |||
694 | /* NX2031 firmware doesn't support heartbit */ | ||
695 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) | ||
696 | return 1; | ||
697 | |||
698 | /* last attempt had failed */ | ||
699 | if (NXRD32(adapter, CRB_CMDPEG_STATE) == PHAN_INITIALIZE_FAILED) | ||
700 | return 1; | ||
701 | |||
702 | old_count = count = NXRD32(adapter, NETXEN_PEG_ALIVE_COUNTER); | ||
703 | |||
704 | for (i = 0; i < 10; i++) { | ||
705 | |||
706 | timeout = msleep_interruptible(200); | ||
707 | if (timeout) { | ||
708 | NXWR32(adapter, CRB_CMDPEG_STATE, | ||
709 | PHAN_INITIALIZE_FAILED); | ||
710 | return -EINTR; | ||
711 | } | ||
712 | |||
713 | count = NXRD32(adapter, NETXEN_PEG_ALIVE_COUNTER); | ||
714 | if (count != old_count) | ||
715 | break; | ||
716 | } | ||
717 | |||
718 | /* firmware is dead */ | ||
719 | if (count == old_count) | ||
720 | return 1; | ||
721 | |||
722 | /* check if we have got newer or different file firmware */ | ||
723 | if (adapter->fw) { | ||
724 | |||
725 | const struct firmware *fw = adapter->fw; | ||
726 | |||
727 | val = cpu_to_le32(*(u32 *)&fw->data[NX_FW_VERSION_OFFSET]); | ||
728 | version = NETXEN_DECODE_VERSION(val); | ||
729 | |||
730 | major = NXRD32(adapter, NETXEN_FW_VERSION_MAJOR); | ||
731 | minor = NXRD32(adapter, NETXEN_FW_VERSION_MINOR); | ||
732 | build = NXRD32(adapter, NETXEN_FW_VERSION_SUB); | ||
733 | |||
734 | if (version > NETXEN_VERSION_CODE(major, minor, build)) | ||
735 | return 1; | ||
736 | |||
737 | if (version == NETXEN_VERSION_CODE(major, minor, build)) { | ||
738 | |||
739 | val = NXRD32(adapter, NETXEN_MIU_MN_CONTROL); | ||
740 | fw_type = (val & 0x4) ? | ||
741 | NX_P3_CT_ROMIMAGE : NX_P3_MN_ROMIMAGE; | ||
742 | |||
743 | if (adapter->fw_type != fw_type) | ||
744 | return 1; | ||
745 | } | ||
746 | } | ||
747 | |||
748 | return 0; | ||
749 | } | ||
750 | |||
751 | static char *fw_name[] = { | ||
752 | "nxromimg.bin", "nx3fwct.bin", "nx3fwmn.bin", "flash", | ||
753 | }; | ||
754 | |||
755 | int | ||
687 | netxen_load_firmware(struct netxen_adapter *adapter) | 756 | netxen_load_firmware(struct netxen_adapter *adapter) |
688 | { | 757 | { |
689 | u64 *ptr64; | 758 | u64 *ptr64; |
690 | u32 i, flashaddr, size; | 759 | u32 i, flashaddr, size; |
691 | const struct firmware *fw = adapter->fw; | 760 | const struct firmware *fw = adapter->fw; |
761 | struct pci_dev *pdev = adapter->pdev; | ||
762 | |||
763 | dev_info(&pdev->dev, "loading firmware from %s\n", | ||
764 | fw_name[adapter->fw_type]); | ||
692 | 765 | ||
693 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) | 766 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) |
694 | NXWR32(adapter, NETXEN_ROMUSB_GLB_CAS_RST, 1); | 767 | NXWR32(adapter, NETXEN_ROMUSB_GLB_CAS_RST, 1); |
@@ -756,7 +829,7 @@ static int | |||
756 | netxen_validate_firmware(struct netxen_adapter *adapter, const char *fwname) | 829 | netxen_validate_firmware(struct netxen_adapter *adapter, const char *fwname) |
757 | { | 830 | { |
758 | __le32 val; | 831 | __le32 val; |
759 | u32 major, minor, build, ver, min_ver, bios; | 832 | u32 ver, min_ver, bios; |
760 | struct pci_dev *pdev = adapter->pdev; | 833 | struct pci_dev *pdev = adapter->pdev; |
761 | const struct firmware *fw = adapter->fw; | 834 | const struct firmware *fw = adapter->fw; |
762 | 835 | ||
@@ -768,21 +841,18 @@ netxen_validate_firmware(struct netxen_adapter *adapter, const char *fwname) | |||
768 | return -EINVAL; | 841 | return -EINVAL; |
769 | 842 | ||
770 | val = cpu_to_le32(*(u32 *)&fw->data[NX_FW_VERSION_OFFSET]); | 843 | val = cpu_to_le32(*(u32 *)&fw->data[NX_FW_VERSION_OFFSET]); |
771 | major = (__force u32)val & 0xff; | ||
772 | minor = ((__force u32)val >> 8) & 0xff; | ||
773 | build = (__force u32)val >> 16; | ||
774 | 844 | ||
775 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | 845 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) |
776 | min_ver = NETXEN_VERSION_CODE(4, 0, 216); | 846 | min_ver = NETXEN_VERSION_CODE(4, 0, 216); |
777 | else | 847 | else |
778 | min_ver = NETXEN_VERSION_CODE(3, 4, 216); | 848 | min_ver = NETXEN_VERSION_CODE(3, 4, 216); |
779 | 849 | ||
780 | ver = NETXEN_VERSION_CODE(major, minor, build); | 850 | ver = NETXEN_DECODE_VERSION(val); |
781 | 851 | ||
782 | if ((major > _NETXEN_NIC_LINUX_MAJOR) || (ver < min_ver)) { | 852 | if ((_major(ver) > _NETXEN_NIC_LINUX_MAJOR) || (ver < min_ver)) { |
783 | dev_err(&pdev->dev, | 853 | dev_err(&pdev->dev, |
784 | "%s: firmware version %d.%d.%d unsupported\n", | 854 | "%s: firmware version %d.%d.%d unsupported\n", |
785 | fwname, major, minor, build); | 855 | fwname, _major(ver), _minor(ver), _build(ver)); |
786 | return -EINVAL; | 856 | return -EINVAL; |
787 | } | 857 | } |
788 | 858 | ||
@@ -798,22 +868,21 @@ netxen_validate_firmware(struct netxen_adapter *adapter, const char *fwname) | |||
798 | if (netxen_rom_fast_read(adapter, | 868 | if (netxen_rom_fast_read(adapter, |
799 | NX_FW_VERSION_OFFSET, (int *)&val)) | 869 | NX_FW_VERSION_OFFSET, (int *)&val)) |
800 | return -EIO; | 870 | return -EIO; |
801 | major = (__force u32)val & 0xff; | 871 | val = NETXEN_DECODE_VERSION(val); |
802 | minor = ((__force u32)val >> 8) & 0xff; | 872 | if (val > ver) { |
803 | build = (__force u32)val >> 16; | 873 | dev_info(&pdev->dev, "%s: firmware is older than flash\n", |
804 | if (NETXEN_VERSION_CODE(major, minor, build) > ver) | 874 | fwname); |
805 | return -EINVAL; | 875 | return -EINVAL; |
876 | } | ||
806 | 877 | ||
807 | NXWR32(adapter, NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC); | 878 | NXWR32(adapter, NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC); |
808 | return 0; | 879 | return 0; |
809 | } | 880 | } |
810 | 881 | ||
811 | static char *fw_name[] = { "nxromimg.bin", "nx3fwct.bin", "nx3fwmn.bin" }; | ||
812 | |||
813 | void netxen_request_firmware(struct netxen_adapter *adapter) | 882 | void netxen_request_firmware(struct netxen_adapter *adapter) |
814 | { | 883 | { |
815 | u32 capability, flashed_ver; | 884 | u32 capability, flashed_ver; |
816 | int fw_type; | 885 | u8 fw_type; |
817 | struct pci_dev *pdev = adapter->pdev; | 886 | struct pci_dev *pdev = adapter->pdev; |
818 | int rc = 0; | 887 | int rc = 0; |
819 | 888 | ||
@@ -830,6 +899,8 @@ request_mn: | |||
830 | 899 | ||
831 | netxen_rom_fast_read(adapter, | 900 | netxen_rom_fast_read(adapter, |
832 | NX_FW_VERSION_OFFSET, (int *)&flashed_ver); | 901 | NX_FW_VERSION_OFFSET, (int *)&flashed_ver); |
902 | flashed_ver = NETXEN_DECODE_VERSION(flashed_ver); | ||
903 | |||
833 | if (flashed_ver >= NETXEN_VERSION_CODE(4, 0, 220)) { | 904 | if (flashed_ver >= NETXEN_VERSION_CODE(4, 0, 220)) { |
834 | capability = NXRD32(adapter, NX_PEG_TUNE_CAPABILITY); | 905 | capability = NXRD32(adapter, NX_PEG_TUNE_CAPABILITY); |
835 | if (capability & NX_PEG_TUNE_MN_PRESENT) { | 906 | if (capability & NX_PEG_TUNE_MN_PRESENT) { |
@@ -838,6 +909,10 @@ request_mn: | |||
838 | } | 909 | } |
839 | } | 910 | } |
840 | 911 | ||
912 | fw_type = NX_FLASH_ROMIMAGE; | ||
913 | adapter->fw = NULL; | ||
914 | goto done; | ||
915 | |||
841 | request_fw: | 916 | request_fw: |
842 | rc = request_firmware(&adapter->fw, fw_name[fw_type], &pdev->dev); | 917 | rc = request_firmware(&adapter->fw, fw_name[fw_type], &pdev->dev); |
843 | if (rc != 0) { | 918 | if (rc != 0) { |
@@ -846,6 +921,7 @@ request_fw: | |||
846 | goto request_mn; | 921 | goto request_mn; |
847 | } | 922 | } |
848 | 923 | ||
924 | fw_type = NX_FLASH_ROMIMAGE; | ||
849 | adapter->fw = NULL; | 925 | adapter->fw = NULL; |
850 | goto done; | 926 | goto done; |
851 | } | 927 | } |
@@ -859,16 +935,13 @@ request_fw: | |||
859 | goto request_mn; | 935 | goto request_mn; |
860 | } | 936 | } |
861 | 937 | ||
938 | fw_type = NX_FLASH_ROMIMAGE; | ||
862 | adapter->fw = NULL; | 939 | adapter->fw = NULL; |
863 | goto done; | 940 | goto done; |
864 | } | 941 | } |
865 | 942 | ||
866 | done: | 943 | done: |
867 | if (adapter->fw) | 944 | adapter->fw_type = fw_type; |
868 | dev_info(&pdev->dev, "loading firmware from file %s\n", | ||
869 | fw_name[fw_type]); | ||
870 | else | ||
871 | dev_info(&pdev->dev, "loading firmware from flash\n"); | ||
872 | } | 945 | } |
873 | 946 | ||
874 | 947 | ||
@@ -944,28 +1017,31 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val) | |||
944 | u32 val = 0; | 1017 | u32 val = 0; |
945 | int retries = 60; | 1018 | int retries = 60; |
946 | 1019 | ||
947 | if (!pegtune_val) { | 1020 | if (pegtune_val) |
948 | do { | 1021 | return 0; |
949 | val = NXRD32(adapter, CRB_CMDPEG_STATE); | ||
950 | 1022 | ||
951 | if (val == PHAN_INITIALIZE_COMPLETE || | 1023 | do { |
952 | val == PHAN_INITIALIZE_ACK) | 1024 | val = NXRD32(adapter, CRB_CMDPEG_STATE); |
953 | return 0; | ||
954 | 1025 | ||
955 | msleep(500); | 1026 | switch (val) { |
1027 | case PHAN_INITIALIZE_COMPLETE: | ||
1028 | case PHAN_INITIALIZE_ACK: | ||
1029 | return 0; | ||
1030 | case PHAN_INITIALIZE_FAILED: | ||
1031 | goto out_err; | ||
1032 | default: | ||
1033 | break; | ||
1034 | } | ||
956 | 1035 | ||
957 | } while (--retries); | 1036 | msleep(500); |
958 | 1037 | ||
959 | if (!retries) { | 1038 | } while (--retries); |
960 | pegtune_val = NXRD32(adapter, | ||
961 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE); | ||
962 | printk(KERN_WARNING "netxen_phantom_init: init failed, " | ||
963 | "pegtune_val=%x\n", pegtune_val); | ||
964 | return -1; | ||
965 | } | ||
966 | } | ||
967 | 1039 | ||
968 | return 0; | 1040 | NXWR32(adapter, CRB_CMDPEG_STATE, PHAN_INITIALIZE_FAILED); |
1041 | |||
1042 | out_err: | ||
1043 | dev_warn(&adapter->pdev->dev, "firmware init failed\n"); | ||
1044 | return -EIO; | ||
969 | } | 1045 | } |
970 | 1046 | ||
971 | static int | 1047 | static int |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 71daa3d5f114..27539ddf94c4 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -705,7 +705,7 @@ netxen_start_firmware(struct netxen_adapter *adapter, int request_fw) | |||
705 | first_driver = (adapter->ahw.pci_func == 0); | 705 | first_driver = (adapter->ahw.pci_func == 0); |
706 | 706 | ||
707 | if (!first_driver) | 707 | if (!first_driver) |
708 | return 0; | 708 | goto wait_init; |
709 | 709 | ||
710 | first_boot = NXRD32(adapter, NETXEN_CAM_RAM(0x1fc)); | 710 | first_boot = NXRD32(adapter, NETXEN_CAM_RAM(0x1fc)); |
711 | 711 | ||
@@ -718,6 +718,10 @@ netxen_start_firmware(struct netxen_adapter *adapter, int request_fw) | |||
718 | if (request_fw) | 718 | if (request_fw) |
719 | netxen_request_firmware(adapter); | 719 | netxen_request_firmware(adapter); |
720 | 720 | ||
721 | err = netxen_need_fw_reset(adapter); | ||
722 | if (err <= 0) | ||
723 | return err; | ||
724 | |||
721 | if (first_boot != 0x55555555) { | 725 | if (first_boot != 0x55555555) { |
722 | NXWR32(adapter, CRB_CMDPEG_STATE, 0); | 726 | NXWR32(adapter, CRB_CMDPEG_STATE, 0); |
723 | netxen_pinit_from_rom(adapter, 0); | 727 | netxen_pinit_from_rom(adapter, 0); |
@@ -752,6 +756,7 @@ netxen_start_firmware(struct netxen_adapter *adapter, int request_fw) | |||
752 | | (_NETXEN_NIC_LINUX_SUBVERSION); | 756 | | (_NETXEN_NIC_LINUX_SUBVERSION); |
753 | NXWR32(adapter, CRB_DRIVER_VERSION, val); | 757 | NXWR32(adapter, CRB_DRIVER_VERSION, val); |
754 | 758 | ||
759 | wait_init: | ||
755 | /* Handshake with the card before we register the devices. */ | 760 | /* Handshake with the card before we register the devices. */ |
756 | err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); | 761 | err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); |
757 | if (err) { | 762 | if (err) { |
@@ -1178,6 +1183,7 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
1178 | free_netdev(netdev); | 1183 | free_netdev(netdev); |
1179 | } | 1184 | } |
1180 | 1185 | ||
1186 | #ifdef CONFIG_PM | ||
1181 | static int | 1187 | static int |
1182 | netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) | 1188 | netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) |
1183 | { | 1189 | { |
@@ -1242,6 +1248,7 @@ netxen_nic_resume(struct pci_dev *pdev) | |||
1242 | 1248 | ||
1243 | return 0; | 1249 | return 0; |
1244 | } | 1250 | } |
1251 | #endif | ||
1245 | 1252 | ||
1246 | static int netxen_nic_open(struct net_device *netdev) | 1253 | static int netxen_nic_open(struct net_device *netdev) |
1247 | { | 1254 | { |
@@ -1771,8 +1778,10 @@ static struct pci_driver netxen_driver = { | |||
1771 | .id_table = netxen_pci_tbl, | 1778 | .id_table = netxen_pci_tbl, |
1772 | .probe = netxen_nic_probe, | 1779 | .probe = netxen_nic_probe, |
1773 | .remove = __devexit_p(netxen_nic_remove), | 1780 | .remove = __devexit_p(netxen_nic_remove), |
1781 | #ifdef CONFIG_PM | ||
1774 | .suspend = netxen_nic_suspend, | 1782 | .suspend = netxen_nic_suspend, |
1775 | .resume = netxen_nic_resume | 1783 | .resume = netxen_nic_resume |
1784 | #endif | ||
1776 | }; | 1785 | }; |
1777 | 1786 | ||
1778 | /* Driver Registration on NetXen card */ | 1787 | /* Driver Registration on NetXen card */ |
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c index 8c1f6988f398..89f7b2ad5231 100644 --- a/drivers/net/pci-skeleton.c +++ b/drivers/net/pci-skeleton.c | |||
@@ -105,7 +105,7 @@ IVc. Errata | |||
105 | 105 | ||
106 | static char version[] __devinitdata = | 106 | static char version[] __devinitdata = |
107 | KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n" | 107 | KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n" |
108 | KERN_INFO " Support available from http://foo.com/bar/baz.html\n"; | 108 | " Support available from http://foo.com/bar/baz.html\n"; |
109 | 109 | ||
110 | /* define to 1 to enable PIO instead of MMIO */ | 110 | /* define to 1 to enable PIO instead of MMIO */ |
111 | #undef USE_IO_OPS | 111 | #undef USE_IO_OPS |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index f51944b28cfa..06618af1a468 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -298,14 +298,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
298 | 298 | ||
299 | strcpy(info->node.dev_name, dev->name); | 299 | strcpy(info->node.dev_name, dev->name); |
300 | 300 | ||
301 | printk(KERN_INFO "%s: port %#3lx, irq %d,", | 301 | printk(KERN_INFO |
302 | dev->name, dev->base_addr, dev->irq); | 302 | "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n", |
303 | printk (" mmio %#5lx,", (u_long)ti->mmio); | 303 | dev->name, dev->base_addr, dev->irq, |
304 | printk (" sram %#5lx,", (u_long)ti->sram_base << 12); | 304 | (u_long)ti->mmio, (u_long)(ti->sram_base << 12), |
305 | printk ("\n" KERN_INFO " hwaddr="); | 305 | dev->dev_addr); |
306 | for (i = 0; i < TR_ALEN; i++) | ||
307 | printk("%02X", dev->dev_addr[i]); | ||
308 | printk("\n"); | ||
309 | return 0; | 306 | return 0; |
310 | 307 | ||
311 | cs_failed: | 308 | cs_failed: |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 02ef63ed1f99..36de91baf238 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -1425,15 +1425,12 @@ static void BuildLAF(int *ladrf, int *adr) | |||
1425 | ladrf[byte] |= (1 << (hashcode & 7)); | 1425 | ladrf[byte] |= (1 << (hashcode & 7)); |
1426 | 1426 | ||
1427 | #ifdef PCMCIA_DEBUG | 1427 | #ifdef PCMCIA_DEBUG |
1428 | if (pc_debug > 2) { | 1428 | if (pc_debug > 2) |
1429 | printk(KERN_DEBUG " adr ="); | 1429 | printk(KERN_DEBUG " adr =%pM\n", adr); |
1430 | for (i = 0; i < 6; i++) | 1430 | printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); |
1431 | printk(" %02X", adr[i]); | 1431 | for (i = 0; i < 8; i++) |
1432 | printk("\n" KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63]" | 1432 | printk(KERN_CONT " %02X", ladrf[i]); |
1433 | " =", hashcode); | 1433 | printk(KERN_CONT "\n"); |
1434 | for (i = 0; i < 8; i++) | ||
1435 | printk(" %02X", ladrf[i]); | ||
1436 | printk("\n"); | ||
1437 | } | 1434 | } |
1438 | #endif | 1435 | #endif |
1439 | } /* BuildLAF */ | 1436 | } /* BuildLAF */ |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 652a36888361..9ef1c1bfa83d 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -1727,6 +1727,7 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
1727 | PCMCIA_DEVICE_PROD_ID12("PRETEC", "Ethernet CompactLAN 10BaseT 3.3V", 0xebf91155, 0x7f5a4f50), | 1727 | PCMCIA_DEVICE_PROD_ID12("PRETEC", "Ethernet CompactLAN 10BaseT 3.3V", 0xebf91155, 0x7f5a4f50), |
1728 | PCMCIA_DEVICE_PROD_ID12("Psion Dacom", "Gold Card Ethernet", 0xf5f025c2, 0x3a30e110), | 1728 | PCMCIA_DEVICE_PROD_ID12("Psion Dacom", "Gold Card Ethernet", 0xf5f025c2, 0x3a30e110), |
1729 | PCMCIA_DEVICE_PROD_ID12("=RELIA==", "Ethernet", 0xcdd0644a, 0x00b2e941), | 1729 | PCMCIA_DEVICE_PROD_ID12("=RELIA==", "Ethernet", 0xcdd0644a, 0x00b2e941), |
1730 | PCMCIA_DEVICE_PROD_ID12("RIOS Systems Co.", "PC CARD3 ETHERNET", 0x7dd33481, 0x10b41826), | ||
1730 | PCMCIA_DEVICE_PROD_ID12("RP", "1625B Ethernet NE2000 Compatible", 0xe3e66e22, 0xb96150df), | 1731 | PCMCIA_DEVICE_PROD_ID12("RP", "1625B Ethernet NE2000 Compatible", 0xe3e66e22, 0xb96150df), |
1731 | PCMCIA_DEVICE_PROD_ID12("RPTI", "EP400 Ethernet NE2000 Compatible", 0xdc6f88fd, 0x4a7e2ae0), | 1732 | PCMCIA_DEVICE_PROD_ID12("RPTI", "EP400 Ethernet NE2000 Compatible", 0xdc6f88fd, 0x4a7e2ae0), |
1732 | PCMCIA_DEVICE_PROD_ID12("RPTI", "EP401 Ethernet NE2000 Compatible", 0xdc6f88fd, 0x4bcbd7fd), | 1733 | PCMCIA_DEVICE_PROD_ID12("RPTI", "EP401 Ethernet NE2000 Compatible", 0xdc6f88fd, 0x4bcbd7fd), |
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 1c35e1d637a0..28368157dac4 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -485,7 +485,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev, | |||
485 | &new_ring_dma_addr); | 485 | &new_ring_dma_addr); |
486 | if (new_tx_ring == NULL) { | 486 | if (new_tx_ring == NULL) { |
487 | if (netif_msg_drv(lp)) | 487 | if (netif_msg_drv(lp)) |
488 | printk("\n" KERN_ERR | 488 | printk(KERN_ERR |
489 | "%s: Consistent memory allocation failed.\n", | 489 | "%s: Consistent memory allocation failed.\n", |
490 | dev->name); | 490 | dev->name); |
491 | return; | 491 | return; |
@@ -496,7 +496,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev, | |||
496 | GFP_ATOMIC); | 496 | GFP_ATOMIC); |
497 | if (!new_dma_addr_list) { | 497 | if (!new_dma_addr_list) { |
498 | if (netif_msg_drv(lp)) | 498 | if (netif_msg_drv(lp)) |
499 | printk("\n" KERN_ERR | 499 | printk(KERN_ERR |
500 | "%s: Memory allocation failed.\n", dev->name); | 500 | "%s: Memory allocation failed.\n", dev->name); |
501 | goto free_new_tx_ring; | 501 | goto free_new_tx_ring; |
502 | } | 502 | } |
@@ -505,7 +505,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev, | |||
505 | GFP_ATOMIC); | 505 | GFP_ATOMIC); |
506 | if (!new_skb_list) { | 506 | if (!new_skb_list) { |
507 | if (netif_msg_drv(lp)) | 507 | if (netif_msg_drv(lp)) |
508 | printk("\n" KERN_ERR | 508 | printk(KERN_ERR |
509 | "%s: Memory allocation failed.\n", dev->name); | 509 | "%s: Memory allocation failed.\n", dev->name); |
510 | goto free_new_lists; | 510 | goto free_new_lists; |
511 | } | 511 | } |
@@ -563,7 +563,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, | |||
563 | &new_ring_dma_addr); | 563 | &new_ring_dma_addr); |
564 | if (new_rx_ring == NULL) { | 564 | if (new_rx_ring == NULL) { |
565 | if (netif_msg_drv(lp)) | 565 | if (netif_msg_drv(lp)) |
566 | printk("\n" KERN_ERR | 566 | printk(KERN_ERR |
567 | "%s: Consistent memory allocation failed.\n", | 567 | "%s: Consistent memory allocation failed.\n", |
568 | dev->name); | 568 | dev->name); |
569 | return; | 569 | return; |
@@ -574,7 +574,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, | |||
574 | GFP_ATOMIC); | 574 | GFP_ATOMIC); |
575 | if (!new_dma_addr_list) { | 575 | if (!new_dma_addr_list) { |
576 | if (netif_msg_drv(lp)) | 576 | if (netif_msg_drv(lp)) |
577 | printk("\n" KERN_ERR | 577 | printk(KERN_ERR |
578 | "%s: Memory allocation failed.\n", dev->name); | 578 | "%s: Memory allocation failed.\n", dev->name); |
579 | goto free_new_rx_ring; | 579 | goto free_new_rx_ring; |
580 | } | 580 | } |
@@ -583,7 +583,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, | |||
583 | GFP_ATOMIC); | 583 | GFP_ATOMIC); |
584 | if (!new_skb_list) { | 584 | if (!new_skb_list) { |
585 | if (netif_msg_drv(lp)) | 585 | if (netif_msg_drv(lp)) |
586 | printk("\n" KERN_ERR | 586 | printk(KERN_ERR |
587 | "%s: Memory allocation failed.\n", dev->name); | 587 | "%s: Memory allocation failed.\n", dev->name); |
588 | goto free_new_lists; | 588 | goto free_new_lists; |
589 | } | 589 | } |
@@ -1766,38 +1766,38 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1766 | /* Version 0x2623 and 0x2624 */ | 1766 | /* Version 0x2623 and 0x2624 */ |
1767 | if (((chip_version + 1) & 0xfffe) == 0x2624) { | 1767 | if (((chip_version + 1) & 0xfffe) == 0x2624) { |
1768 | i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ | 1768 | i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ |
1769 | printk("\n" KERN_INFO " tx_start_pt(0x%04x):", i); | 1769 | printk(KERN_INFO " tx_start_pt(0x%04x):", i); |
1770 | switch (i >> 10) { | 1770 | switch (i >> 10) { |
1771 | case 0: | 1771 | case 0: |
1772 | printk(" 20 bytes,"); | 1772 | printk(KERN_CONT " 20 bytes,"); |
1773 | break; | 1773 | break; |
1774 | case 1: | 1774 | case 1: |
1775 | printk(" 64 bytes,"); | 1775 | printk(KERN_CONT " 64 bytes,"); |
1776 | break; | 1776 | break; |
1777 | case 2: | 1777 | case 2: |
1778 | printk(" 128 bytes,"); | 1778 | printk(KERN_CONT " 128 bytes,"); |
1779 | break; | 1779 | break; |
1780 | case 3: | 1780 | case 3: |
1781 | printk("~220 bytes,"); | 1781 | printk(KERN_CONT "~220 bytes,"); |
1782 | break; | 1782 | break; |
1783 | } | 1783 | } |
1784 | i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ | 1784 | i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ |
1785 | printk(" BCR18(%x):", i & 0xffff); | 1785 | printk(KERN_CONT " BCR18(%x):", i & 0xffff); |
1786 | if (i & (1 << 5)) | 1786 | if (i & (1 << 5)) |
1787 | printk("BurstWrEn "); | 1787 | printk(KERN_CONT "BurstWrEn "); |
1788 | if (i & (1 << 6)) | 1788 | if (i & (1 << 6)) |
1789 | printk("BurstRdEn "); | 1789 | printk(KERN_CONT "BurstRdEn "); |
1790 | if (i & (1 << 7)) | 1790 | if (i & (1 << 7)) |
1791 | printk("DWordIO "); | 1791 | printk(KERN_CONT "DWordIO "); |
1792 | if (i & (1 << 11)) | 1792 | if (i & (1 << 11)) |
1793 | printk("NoUFlow "); | 1793 | printk(KERN_CONT "NoUFlow "); |
1794 | i = a->read_bcr(ioaddr, 25); | 1794 | i = a->read_bcr(ioaddr, 25); |
1795 | printk("\n" KERN_INFO " SRAMSIZE=0x%04x,", i << 8); | 1795 | printk(KERN_INFO " SRAMSIZE=0x%04x,", i << 8); |
1796 | i = a->read_bcr(ioaddr, 26); | 1796 | i = a->read_bcr(ioaddr, 26); |
1797 | printk(" SRAM_BND=0x%04x,", i << 8); | 1797 | printk(KERN_CONT " SRAM_BND=0x%04x,", i << 8); |
1798 | i = a->read_bcr(ioaddr, 27); | 1798 | i = a->read_bcr(ioaddr, 27); |
1799 | if (i & (1 << 14)) | 1799 | if (i & (1 << 14)) |
1800 | printk("LowLatRx"); | 1800 | printk(KERN_CONT "LowLatRx"); |
1801 | } | 1801 | } |
1802 | } | 1802 | } |
1803 | 1803 | ||
@@ -1996,7 +1996,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
1996 | &lp->tx_ring_dma_addr); | 1996 | &lp->tx_ring_dma_addr); |
1997 | if (lp->tx_ring == NULL) { | 1997 | if (lp->tx_ring == NULL) { |
1998 | if (netif_msg_drv(lp)) | 1998 | if (netif_msg_drv(lp)) |
1999 | printk("\n" KERN_ERR PFX | 1999 | printk(KERN_ERR PFX |
2000 | "%s: Consistent memory allocation failed.\n", | 2000 | "%s: Consistent memory allocation failed.\n", |
2001 | name); | 2001 | name); |
2002 | return -ENOMEM; | 2002 | return -ENOMEM; |
@@ -2008,7 +2008,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
2008 | &lp->rx_ring_dma_addr); | 2008 | &lp->rx_ring_dma_addr); |
2009 | if (lp->rx_ring == NULL) { | 2009 | if (lp->rx_ring == NULL) { |
2010 | if (netif_msg_drv(lp)) | 2010 | if (netif_msg_drv(lp)) |
2011 | printk("\n" KERN_ERR PFX | 2011 | printk(KERN_ERR PFX |
2012 | "%s: Consistent memory allocation failed.\n", | 2012 | "%s: Consistent memory allocation failed.\n", |
2013 | name); | 2013 | name); |
2014 | return -ENOMEM; | 2014 | return -ENOMEM; |
@@ -2018,7 +2018,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
2018 | GFP_ATOMIC); | 2018 | GFP_ATOMIC); |
2019 | if (!lp->tx_dma_addr) { | 2019 | if (!lp->tx_dma_addr) { |
2020 | if (netif_msg_drv(lp)) | 2020 | if (netif_msg_drv(lp)) |
2021 | printk("\n" KERN_ERR PFX | 2021 | printk(KERN_ERR PFX |
2022 | "%s: Memory allocation failed.\n", name); | 2022 | "%s: Memory allocation failed.\n", name); |
2023 | return -ENOMEM; | 2023 | return -ENOMEM; |
2024 | } | 2024 | } |
@@ -2027,7 +2027,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
2027 | GFP_ATOMIC); | 2027 | GFP_ATOMIC); |
2028 | if (!lp->rx_dma_addr) { | 2028 | if (!lp->rx_dma_addr) { |
2029 | if (netif_msg_drv(lp)) | 2029 | if (netif_msg_drv(lp)) |
2030 | printk("\n" KERN_ERR PFX | 2030 | printk(KERN_ERR PFX |
2031 | "%s: Memory allocation failed.\n", name); | 2031 | "%s: Memory allocation failed.\n", name); |
2032 | return -ENOMEM; | 2032 | return -ENOMEM; |
2033 | } | 2033 | } |
@@ -2036,7 +2036,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
2036 | GFP_ATOMIC); | 2036 | GFP_ATOMIC); |
2037 | if (!lp->tx_skbuff) { | 2037 | if (!lp->tx_skbuff) { |
2038 | if (netif_msg_drv(lp)) | 2038 | if (netif_msg_drv(lp)) |
2039 | printk("\n" KERN_ERR PFX | 2039 | printk(KERN_ERR PFX |
2040 | "%s: Memory allocation failed.\n", name); | 2040 | "%s: Memory allocation failed.\n", name); |
2041 | return -ENOMEM; | 2041 | return -ENOMEM; |
2042 | } | 2042 | } |
@@ -2045,7 +2045,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
2045 | GFP_ATOMIC); | 2045 | GFP_ATOMIC); |
2046 | if (!lp->rx_skbuff) { | 2046 | if (!lp->rx_skbuff) { |
2047 | if (netif_msg_drv(lp)) | 2047 | if (netif_msg_drv(lp)) |
2048 | printk("\n" KERN_ERR PFX | 2048 | printk(KERN_ERR PFX |
2049 | "%s: Memory allocation failed.\n", name); | 2049 | "%s: Memory allocation failed.\n", name); |
2050 | return -ENOMEM; | 2050 | return -ENOMEM; |
2051 | } | 2051 | } |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 61755cbd978e..eda94fcd4065 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -928,13 +928,32 @@ static void phy_state_machine(struct work_struct *work) | |||
928 | * Otherwise, it's 0, and we're | 928 | * Otherwise, it's 0, and we're |
929 | * still waiting for AN */ | 929 | * still waiting for AN */ |
930 | if (err > 0) { | 930 | if (err > 0) { |
931 | phydev->state = PHY_RUNNING; | 931 | err = phy_read_status(phydev); |
932 | if (err) | ||
933 | break; | ||
934 | |||
935 | if (phydev->link) { | ||
936 | phydev->state = PHY_RUNNING; | ||
937 | netif_carrier_on(phydev->attached_dev); | ||
938 | } else | ||
939 | phydev->state = PHY_NOLINK; | ||
940 | phydev->adjust_link(phydev->attached_dev); | ||
932 | } else { | 941 | } else { |
933 | phydev->state = PHY_AN; | 942 | phydev->state = PHY_AN; |
934 | phydev->link_timeout = PHY_AN_TIMEOUT; | 943 | phydev->link_timeout = PHY_AN_TIMEOUT; |
935 | } | 944 | } |
936 | } else | 945 | } else { |
937 | phydev->state = PHY_RUNNING; | 946 | err = phy_read_status(phydev); |
947 | if (err) | ||
948 | break; | ||
949 | |||
950 | if (phydev->link) { | ||
951 | phydev->state = PHY_RUNNING; | ||
952 | netif_carrier_on(phydev->attached_dev); | ||
953 | } else | ||
954 | phydev->state = PHY_NOLINK; | ||
955 | phydev->adjust_link(phydev->attached_dev); | ||
956 | } | ||
938 | break; | 957 | break; |
939 | } | 958 | } |
940 | 959 | ||
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index eba937c46376..b10fedd82143 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -134,8 +134,10 @@ int phy_scan_fixups(struct phy_device *phydev) | |||
134 | 134 | ||
135 | err = fixup->run(phydev); | 135 | err = fixup->run(phydev); |
136 | 136 | ||
137 | if (err < 0) | 137 | if (err < 0) { |
138 | mutex_unlock(&phy_fixup_lock); | ||
138 | return err; | 139 | return err; |
140 | } | ||
139 | } | 141 | } |
140 | } | 142 | } |
141 | mutex_unlock(&phy_fixup_lock); | 143 | mutex_unlock(&phy_fixup_lock); |
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 7a62f781fef2..2ca8b0d84ee2 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -270,6 +270,9 @@ static const struct net_device_ops plip_netdev_ops = { | |||
270 | .ndo_stop = plip_close, | 270 | .ndo_stop = plip_close, |
271 | .ndo_start_xmit = plip_tx_packet, | 271 | .ndo_start_xmit = plip_tx_packet, |
272 | .ndo_do_ioctl = plip_ioctl, | 272 | .ndo_do_ioctl = plip_ioctl, |
273 | .ndo_change_mtu = eth_change_mtu, | ||
274 | .ndo_set_mac_address = eth_mac_addr, | ||
275 | .ndo_validate_addr = eth_validate_addr, | ||
273 | }; | 276 | }; |
274 | 277 | ||
275 | /* Entry point of PLIP driver. | 278 | /* Entry point of PLIP driver. |
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 17c116bb332c..6de8399d6dd9 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c | |||
@@ -356,6 +356,7 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, | |||
356 | if (!skb_queue_empty(&ap->rqueue)) | 356 | if (!skb_queue_empty(&ap->rqueue)) |
357 | tasklet_schedule(&ap->tsk); | 357 | tasklet_schedule(&ap->tsk); |
358 | ap_put(ap); | 358 | ap_put(ap); |
359 | tty_unthrottle(tty); | ||
359 | } | 360 | } |
360 | 361 | ||
361 | static void | 362 | static void |
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index aa3d39f38e22..d2fa2db13586 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c | |||
@@ -397,6 +397,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf, | |||
397 | if (!skb_queue_empty(&ap->rqueue)) | 397 | if (!skb_queue_empty(&ap->rqueue)) |
398 | tasklet_schedule(&ap->tsk); | 398 | tasklet_schedule(&ap->tsk); |
399 | sp_put(ap); | 399 | sp_put(ap); |
400 | tty_unthrottle(tty); | ||
400 | } | 401 | } |
401 | 402 | ||
402 | static void | 403 | static void |
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c index d1a5fb4d6acb..a3932c9f3406 100644 --- a/drivers/net/ps3_gelic_net.c +++ b/drivers/net/ps3_gelic_net.c | |||
@@ -1411,6 +1411,7 @@ static const struct net_device_ops gelic_netdevice_ops = { | |||
1411 | .ndo_set_multicast_list = gelic_net_set_multi, | 1411 | .ndo_set_multicast_list = gelic_net_set_multi, |
1412 | .ndo_change_mtu = gelic_net_change_mtu, | 1412 | .ndo_change_mtu = gelic_net_change_mtu, |
1413 | .ndo_tx_timeout = gelic_net_tx_timeout, | 1413 | .ndo_tx_timeout = gelic_net_tx_timeout, |
1414 | .ndo_set_mac_address = eth_mac_addr, | ||
1414 | .ndo_validate_addr = eth_validate_addr, | 1415 | .ndo_validate_addr = eth_validate_addr, |
1415 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1416 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1416 | .ndo_poll_controller = gelic_net_poll_controller, | 1417 | .ndo_poll_controller = gelic_net_poll_controller, |
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c index b6b3ca9bdb21..6932b08d746b 100644 --- a/drivers/net/ps3_gelic_wireless.c +++ b/drivers/net/ps3_gelic_wireless.c | |||
@@ -2707,6 +2707,7 @@ static const struct net_device_ops gelic_wl_netdevice_ops = { | |||
2707 | .ndo_set_multicast_list = gelic_net_set_multi, | 2707 | .ndo_set_multicast_list = gelic_net_set_multi, |
2708 | .ndo_change_mtu = gelic_net_change_mtu, | 2708 | .ndo_change_mtu = gelic_net_change_mtu, |
2709 | .ndo_tx_timeout = gelic_net_tx_timeout, | 2709 | .ndo_tx_timeout = gelic_net_tx_timeout, |
2710 | .ndo_set_mac_address = eth_mac_addr, | ||
2710 | .ndo_validate_addr = eth_validate_addr, | 2711 | .ndo_validate_addr = eth_validate_addr, |
2711 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2712 | #ifdef CONFIG_NET_POLL_CONTROLLER |
2712 | .ndo_poll_controller = gelic_net_poll_controller, | 2713 | .ndo_poll_controller = gelic_net_poll_controller, |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index bbc6d4d3cc94..3e4b67aaa6ea 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -3142,6 +3142,7 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3142 | (void __iomem *)port_regs; | 3142 | (void __iomem *)port_regs; |
3143 | u32 delay = 10; | 3143 | u32 delay = 10; |
3144 | int status = 0; | 3144 | int status = 0; |
3145 | unsigned long hw_flags = 0; | ||
3145 | 3146 | ||
3146 | if(ql_mii_setup(qdev)) | 3147 | if(ql_mii_setup(qdev)) |
3147 | return -1; | 3148 | return -1; |
@@ -3150,7 +3151,8 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3150 | ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, | 3151 | ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, |
3151 | (ISP_SERIAL_PORT_IF_WE | | 3152 | (ISP_SERIAL_PORT_IF_WE | |
3152 | (ISP_SERIAL_PORT_IF_WE << 16))); | 3153 | (ISP_SERIAL_PORT_IF_WE << 16))); |
3153 | 3154 | /* Give the PHY time to come out of reset. */ | |
3155 | mdelay(100); | ||
3154 | qdev->port_link_state = LS_DOWN; | 3156 | qdev->port_link_state = LS_DOWN; |
3155 | netif_carrier_off(qdev->ndev); | 3157 | netif_carrier_off(qdev->ndev); |
3156 | 3158 | ||
@@ -3350,7 +3352,9 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3350 | value = ql_read_page0_reg(qdev, &port_regs->portStatus); | 3352 | value = ql_read_page0_reg(qdev, &port_regs->portStatus); |
3351 | if (value & PORT_STATUS_IC) | 3353 | if (value & PORT_STATUS_IC) |
3352 | break; | 3354 | break; |
3355 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | ||
3353 | msleep(500); | 3356 | msleep(500); |
3357 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | ||
3354 | } while (--delay); | 3358 | } while (--delay); |
3355 | 3359 | ||
3356 | if (delay == 0) { | 3360 | if (delay == 0) { |
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index 156e02e8905d..6ed5317ab1c0 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -1607,6 +1607,8 @@ int ql_mb_get_fw_state(struct ql_adapter *qdev); | |||
1607 | int ql_cam_route_initialize(struct ql_adapter *qdev); | 1607 | int ql_cam_route_initialize(struct ql_adapter *qdev); |
1608 | int ql_read_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 *data); | 1608 | int ql_read_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 *data); |
1609 | int ql_mb_about_fw(struct ql_adapter *qdev); | 1609 | int ql_mb_about_fw(struct ql_adapter *qdev); |
1610 | void ql_link_on(struct ql_adapter *qdev); | ||
1611 | void ql_link_off(struct ql_adapter *qdev); | ||
1610 | 1612 | ||
1611 | #if 1 | 1613 | #if 1 |
1612 | #define QL_ALL_DUMP | 1614 | #define QL_ALL_DUMP |
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c index 37c99fe79770..eb6a9ee640ed 100644 --- a/drivers/net/qlge/qlge_ethtool.c +++ b/drivers/net/qlge/qlge_ethtool.c | |||
@@ -59,7 +59,7 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev) | |||
59 | cqicb->pkt_delay = | 59 | cqicb->pkt_delay = |
60 | cpu_to_le16(qdev->tx_max_coalesced_frames); | 60 | cpu_to_le16(qdev->tx_max_coalesced_frames); |
61 | cqicb->flags = FLAGS_LI; | 61 | cqicb->flags = FLAGS_LI; |
62 | status = ql_write_cfg(qdev, cqicb, sizeof(cqicb), | 62 | status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb), |
63 | CFG_LCQ, rx_ring->cq_id); | 63 | CFG_LCQ, rx_ring->cq_id); |
64 | if (status) { | 64 | if (status) { |
65 | QPRINTK(qdev, IFUP, ERR, | 65 | QPRINTK(qdev, IFUP, ERR, |
@@ -82,7 +82,7 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev) | |||
82 | cqicb->pkt_delay = | 82 | cqicb->pkt_delay = |
83 | cpu_to_le16(qdev->rx_max_coalesced_frames); | 83 | cpu_to_le16(qdev->rx_max_coalesced_frames); |
84 | cqicb->flags = FLAGS_LI; | 84 | cqicb->flags = FLAGS_LI; |
85 | status = ql_write_cfg(qdev, cqicb, sizeof(cqicb), | 85 | status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb), |
86 | CFG_LCQ, rx_ring->cq_id); | 86 | CFG_LCQ, rx_ring->cq_id); |
87 | if (status) { | 87 | if (status) { |
88 | QPRINTK(qdev, IFUP, ERR, | 88 | QPRINTK(qdev, IFUP, ERR, |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 90d1f76c0e8b..5768af17f168 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -214,6 +214,10 @@ int ql_write_cfg(struct ql_adapter *qdev, void *ptr, int size, u32 bit, | |||
214 | return -ENOMEM; | 214 | return -ENOMEM; |
215 | } | 215 | } |
216 | 216 | ||
217 | status = ql_sem_spinlock(qdev, SEM_ICB_MASK); | ||
218 | if (status) | ||
219 | return status; | ||
220 | |||
217 | status = ql_wait_cfg(qdev, bit); | 221 | status = ql_wait_cfg(qdev, bit); |
218 | if (status) { | 222 | if (status) { |
219 | QPRINTK(qdev, IFUP, ERR, | 223 | QPRINTK(qdev, IFUP, ERR, |
@@ -221,12 +225,8 @@ int ql_write_cfg(struct ql_adapter *qdev, void *ptr, int size, u32 bit, | |||
221 | goto exit; | 225 | goto exit; |
222 | } | 226 | } |
223 | 227 | ||
224 | status = ql_sem_spinlock(qdev, SEM_ICB_MASK); | ||
225 | if (status) | ||
226 | goto exit; | ||
227 | ql_write32(qdev, ICB_L, (u32) map); | 228 | ql_write32(qdev, ICB_L, (u32) map); |
228 | ql_write32(qdev, ICB_H, (u32) (map >> 32)); | 229 | ql_write32(qdev, ICB_H, (u32) (map >> 32)); |
229 | ql_sem_unlock(qdev, SEM_ICB_MASK); /* does flush too */ | ||
230 | 230 | ||
231 | mask = CFG_Q_MASK | (bit << 16); | 231 | mask = CFG_Q_MASK | (bit << 16); |
232 | value = bit | (q_id << CFG_Q_SHIFT); | 232 | value = bit | (q_id << CFG_Q_SHIFT); |
@@ -237,6 +237,7 @@ int ql_write_cfg(struct ql_adapter *qdev, void *ptr, int size, u32 bit, | |||
237 | */ | 237 | */ |
238 | status = ql_wait_cfg(qdev, bit); | 238 | status = ql_wait_cfg(qdev, bit); |
239 | exit: | 239 | exit: |
240 | ql_sem_unlock(qdev, SEM_ICB_MASK); /* does flush too */ | ||
240 | pci_unmap_single(qdev->pdev, map, size, direction); | 241 | pci_unmap_single(qdev->pdev, map, size, direction); |
241 | return status; | 242 | return status; |
242 | } | 243 | } |
@@ -412,6 +413,57 @@ exit: | |||
412 | return status; | 413 | return status; |
413 | } | 414 | } |
414 | 415 | ||
416 | /* Set or clear MAC address in hardware. We sometimes | ||
417 | * have to clear it to prevent wrong frame routing | ||
418 | * especially in a bonding environment. | ||
419 | */ | ||
420 | static int ql_set_mac_addr(struct ql_adapter *qdev, int set) | ||
421 | { | ||
422 | int status; | ||
423 | char zero_mac_addr[ETH_ALEN]; | ||
424 | char *addr; | ||
425 | |||
426 | if (set) { | ||
427 | addr = &qdev->ndev->dev_addr[0]; | ||
428 | QPRINTK(qdev, IFUP, DEBUG, | ||
429 | "Set Mac addr %02x:%02x:%02x:%02x:%02x:%02x\n", | ||
430 | addr[0], addr[1], addr[2], addr[3], | ||
431 | addr[4], addr[5]); | ||
432 | } else { | ||
433 | memset(zero_mac_addr, 0, ETH_ALEN); | ||
434 | addr = &zero_mac_addr[0]; | ||
435 | QPRINTK(qdev, IFUP, DEBUG, | ||
436 | "Clearing MAC address on %s\n", | ||
437 | qdev->ndev->name); | ||
438 | } | ||
439 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); | ||
440 | if (status) | ||
441 | return status; | ||
442 | status = ql_set_mac_addr_reg(qdev, (u8 *) addr, | ||
443 | MAC_ADDR_TYPE_CAM_MAC, qdev->func * MAX_CQ); | ||
444 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); | ||
445 | if (status) | ||
446 | QPRINTK(qdev, IFUP, ERR, "Failed to init mac " | ||
447 | "address.\n"); | ||
448 | return status; | ||
449 | } | ||
450 | |||
451 | void ql_link_on(struct ql_adapter *qdev) | ||
452 | { | ||
453 | QPRINTK(qdev, LINK, ERR, "%s: Link is up.\n", | ||
454 | qdev->ndev->name); | ||
455 | netif_carrier_on(qdev->ndev); | ||
456 | ql_set_mac_addr(qdev, 1); | ||
457 | } | ||
458 | |||
459 | void ql_link_off(struct ql_adapter *qdev) | ||
460 | { | ||
461 | QPRINTK(qdev, LINK, ERR, "%s: Link is down.\n", | ||
462 | qdev->ndev->name); | ||
463 | netif_carrier_off(qdev->ndev); | ||
464 | ql_set_mac_addr(qdev, 0); | ||
465 | } | ||
466 | |||
415 | /* Get a specific frame routing value from the CAM. | 467 | /* Get a specific frame routing value from the CAM. |
416 | * Used for debug and reg dump. | 468 | * Used for debug and reg dump. |
417 | */ | 469 | */ |
@@ -1628,7 +1680,7 @@ static void ql_process_mac_tx_intr(struct ql_adapter *qdev, | |||
1628 | tx_ring = &qdev->tx_ring[mac_rsp->txq_idx]; | 1680 | tx_ring = &qdev->tx_ring[mac_rsp->txq_idx]; |
1629 | tx_ring_desc = &tx_ring->q[mac_rsp->tid]; | 1681 | tx_ring_desc = &tx_ring->q[mac_rsp->tid]; |
1630 | ql_unmap_send(qdev, tx_ring_desc, tx_ring_desc->map_cnt); | 1682 | ql_unmap_send(qdev, tx_ring_desc, tx_ring_desc->map_cnt); |
1631 | qdev->stats.tx_bytes += tx_ring_desc->map_cnt; | 1683 | qdev->stats.tx_bytes += (tx_ring_desc->skb)->len; |
1632 | qdev->stats.tx_packets++; | 1684 | qdev->stats.tx_packets++; |
1633 | dev_kfree_skb(tx_ring_desc->skb); | 1685 | dev_kfree_skb(tx_ring_desc->skb); |
1634 | tx_ring_desc->skb = NULL; | 1686 | tx_ring_desc->skb = NULL; |
@@ -1660,13 +1712,13 @@ static void ql_process_mac_tx_intr(struct ql_adapter *qdev, | |||
1660 | /* Fire up a handler to reset the MPI processor. */ | 1712 | /* Fire up a handler to reset the MPI processor. */ |
1661 | void ql_queue_fw_error(struct ql_adapter *qdev) | 1713 | void ql_queue_fw_error(struct ql_adapter *qdev) |
1662 | { | 1714 | { |
1663 | netif_carrier_off(qdev->ndev); | 1715 | ql_link_off(qdev); |
1664 | queue_delayed_work(qdev->workqueue, &qdev->mpi_reset_work, 0); | 1716 | queue_delayed_work(qdev->workqueue, &qdev->mpi_reset_work, 0); |
1665 | } | 1717 | } |
1666 | 1718 | ||
1667 | void ql_queue_asic_error(struct ql_adapter *qdev) | 1719 | void ql_queue_asic_error(struct ql_adapter *qdev) |
1668 | { | 1720 | { |
1669 | netif_carrier_off(qdev->ndev); | 1721 | ql_link_off(qdev); |
1670 | ql_disable_interrupts(qdev); | 1722 | ql_disable_interrupts(qdev); |
1671 | /* Clear adapter up bit to signal the recovery | 1723 | /* Clear adapter up bit to signal the recovery |
1672 | * process that it shouldn't kill the reset worker | 1724 | * process that it shouldn't kill the reset worker |
@@ -2104,7 +2156,7 @@ static int qlge_send(struct sk_buff *skb, struct net_device *ndev) | |||
2104 | } | 2156 | } |
2105 | tx_ring_desc = &tx_ring->q[tx_ring->prod_idx]; | 2157 | tx_ring_desc = &tx_ring->q[tx_ring->prod_idx]; |
2106 | mac_iocb_ptr = tx_ring_desc->queue_entry; | 2158 | mac_iocb_ptr = tx_ring_desc->queue_entry; |
2107 | memset((void *)mac_iocb_ptr, 0, sizeof(mac_iocb_ptr)); | 2159 | memset((void *)mac_iocb_ptr, 0, sizeof(*mac_iocb_ptr)); |
2108 | 2160 | ||
2109 | mac_iocb_ptr->opcode = OPCODE_OB_MAC_IOCB; | 2161 | mac_iocb_ptr->opcode = OPCODE_OB_MAC_IOCB; |
2110 | mac_iocb_ptr->tid = tx_ring_desc->index; | 2162 | mac_iocb_ptr->tid = tx_ring_desc->index; |
@@ -2743,7 +2795,7 @@ static int ql_start_tx_ring(struct ql_adapter *qdev, struct tx_ring *tx_ring) | |||
2743 | 2795 | ||
2744 | ql_init_tx_ring(qdev, tx_ring); | 2796 | ql_init_tx_ring(qdev, tx_ring); |
2745 | 2797 | ||
2746 | err = ql_write_cfg(qdev, wqicb, sizeof(wqicb), CFG_LRQ, | 2798 | err = ql_write_cfg(qdev, wqicb, sizeof(*wqicb), CFG_LRQ, |
2747 | (u16) tx_ring->wq_id); | 2799 | (u16) tx_ring->wq_id); |
2748 | if (err) { | 2800 | if (err) { |
2749 | QPRINTK(qdev, IFUP, ERR, "Failed to load tx_ring.\n"); | 2801 | QPRINTK(qdev, IFUP, ERR, "Failed to load tx_ring.\n"); |
@@ -3008,7 +3060,7 @@ static int ql_start_rss(struct ql_adapter *qdev) | |||
3008 | int i; | 3060 | int i; |
3009 | u8 *hash_id = (u8 *) ricb->hash_cq_id; | 3061 | u8 *hash_id = (u8 *) ricb->hash_cq_id; |
3010 | 3062 | ||
3011 | memset((void *)ricb, 0, sizeof(ricb)); | 3063 | memset((void *)ricb, 0, sizeof(*ricb)); |
3012 | 3064 | ||
3013 | ricb->base_cq = qdev->rss_ring_first_cq_id | RSS_L4K; | 3065 | ricb->base_cq = qdev->rss_ring_first_cq_id | RSS_L4K; |
3014 | ricb->flags = | 3066 | ricb->flags = |
@@ -3030,7 +3082,7 @@ static int ql_start_rss(struct ql_adapter *qdev) | |||
3030 | 3082 | ||
3031 | QPRINTK(qdev, IFUP, DEBUG, "Initializing RSS.\n"); | 3083 | QPRINTK(qdev, IFUP, DEBUG, "Initializing RSS.\n"); |
3032 | 3084 | ||
3033 | status = ql_write_cfg(qdev, ricb, sizeof(ricb), CFG_LR, 0); | 3085 | status = ql_write_cfg(qdev, ricb, sizeof(*ricb), CFG_LR, 0); |
3034 | if (status) { | 3086 | if (status) { |
3035 | QPRINTK(qdev, IFUP, ERR, "Failed to load RICB.\n"); | 3087 | QPRINTK(qdev, IFUP, ERR, "Failed to load RICB.\n"); |
3036 | return status; | 3088 | return status; |
@@ -3039,25 +3091,40 @@ static int ql_start_rss(struct ql_adapter *qdev) | |||
3039 | return status; | 3091 | return status; |
3040 | } | 3092 | } |
3041 | 3093 | ||
3042 | /* Initialize the frame-to-queue routing. */ | 3094 | static int ql_clear_routing_entries(struct ql_adapter *qdev) |
3043 | static int ql_route_initialize(struct ql_adapter *qdev) | ||
3044 | { | 3095 | { |
3045 | int status = 0; | 3096 | int i, status = 0; |
3046 | int i; | ||
3047 | 3097 | ||
3048 | status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK); | 3098 | status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK); |
3049 | if (status) | 3099 | if (status) |
3050 | return status; | 3100 | return status; |
3051 | |||
3052 | /* Clear all the entries in the routing table. */ | 3101 | /* Clear all the entries in the routing table. */ |
3053 | for (i = 0; i < 16; i++) { | 3102 | for (i = 0; i < 16; i++) { |
3054 | status = ql_set_routing_reg(qdev, i, 0, 0); | 3103 | status = ql_set_routing_reg(qdev, i, 0, 0); |
3055 | if (status) { | 3104 | if (status) { |
3056 | QPRINTK(qdev, IFUP, ERR, | 3105 | QPRINTK(qdev, IFUP, ERR, |
3057 | "Failed to init routing register for CAM packets.\n"); | 3106 | "Failed to init routing register for CAM " |
3058 | goto exit; | 3107 | "packets.\n"); |
3108 | break; | ||
3059 | } | 3109 | } |
3060 | } | 3110 | } |
3111 | ql_sem_unlock(qdev, SEM_RT_IDX_MASK); | ||
3112 | return status; | ||
3113 | } | ||
3114 | |||
3115 | /* Initialize the frame-to-queue routing. */ | ||
3116 | static int ql_route_initialize(struct ql_adapter *qdev) | ||
3117 | { | ||
3118 | int status = 0; | ||
3119 | |||
3120 | status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK); | ||
3121 | if (status) | ||
3122 | return status; | ||
3123 | |||
3124 | /* Clear all the entries in the routing table. */ | ||
3125 | status = ql_clear_routing_entries(qdev); | ||
3126 | if (status) | ||
3127 | goto exit; | ||
3061 | 3128 | ||
3062 | status = ql_set_routing_reg(qdev, RT_IDX_ALL_ERR_SLOT, RT_IDX_ERR, 1); | 3129 | status = ql_set_routing_reg(qdev, RT_IDX_ALL_ERR_SLOT, RT_IDX_ERR, 1); |
3063 | if (status) { | 3130 | if (status) { |
@@ -3096,14 +3163,15 @@ exit: | |||
3096 | 3163 | ||
3097 | int ql_cam_route_initialize(struct ql_adapter *qdev) | 3164 | int ql_cam_route_initialize(struct ql_adapter *qdev) |
3098 | { | 3165 | { |
3099 | int status; | 3166 | int status, set; |
3100 | 3167 | ||
3101 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); | 3168 | /* If check if the link is up and use to |
3102 | if (status) | 3169 | * determine if we are setting or clearing |
3103 | return status; | 3170 | * the MAC address in the CAM. |
3104 | status = ql_set_mac_addr_reg(qdev, (u8 *) qdev->ndev->perm_addr, | 3171 | */ |
3105 | MAC_ADDR_TYPE_CAM_MAC, qdev->func * MAX_CQ); | 3172 | set = ql_read32(qdev, STS); |
3106 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); | 3173 | set &= qdev->port_link_up; |
3174 | status = ql_set_mac_addr(qdev, set); | ||
3107 | if (status) { | 3175 | if (status) { |
3108 | QPRINTK(qdev, IFUP, ERR, "Failed to init mac address.\n"); | 3176 | QPRINTK(qdev, IFUP, ERR, "Failed to init mac address.\n"); |
3109 | return status; | 3177 | return status; |
@@ -3210,9 +3278,17 @@ static int ql_adapter_reset(struct ql_adapter *qdev) | |||
3210 | { | 3278 | { |
3211 | u32 value; | 3279 | u32 value; |
3212 | int status = 0; | 3280 | int status = 0; |
3213 | unsigned long end_jiffies = jiffies + | 3281 | unsigned long end_jiffies; |
3214 | max((unsigned long)1, usecs_to_jiffies(30)); | ||
3215 | 3282 | ||
3283 | /* Clear all the entries in the routing table. */ | ||
3284 | status = ql_clear_routing_entries(qdev); | ||
3285 | if (status) { | ||
3286 | QPRINTK(qdev, IFUP, ERR, "Failed to clear routing bits.\n"); | ||
3287 | return status; | ||
3288 | } | ||
3289 | |||
3290 | end_jiffies = jiffies + | ||
3291 | max((unsigned long)1, usecs_to_jiffies(30)); | ||
3216 | ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); | 3292 | ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); |
3217 | 3293 | ||
3218 | do { | 3294 | do { |
@@ -3252,7 +3328,7 @@ static int ql_adapter_down(struct ql_adapter *qdev) | |||
3252 | int i, status = 0; | 3328 | int i, status = 0; |
3253 | struct rx_ring *rx_ring; | 3329 | struct rx_ring *rx_ring; |
3254 | 3330 | ||
3255 | netif_carrier_off(qdev->ndev); | 3331 | ql_link_off(qdev); |
3256 | 3332 | ||
3257 | /* Don't kill the reset worker thread if we | 3333 | /* Don't kill the reset worker thread if we |
3258 | * are in the process of recovery. | 3334 | * are in the process of recovery. |
@@ -3319,8 +3395,12 @@ static int ql_adapter_up(struct ql_adapter *qdev) | |||
3319 | } | 3395 | } |
3320 | set_bit(QL_ADAPTER_UP, &qdev->flags); | 3396 | set_bit(QL_ADAPTER_UP, &qdev->flags); |
3321 | ql_alloc_rx_buffers(qdev); | 3397 | ql_alloc_rx_buffers(qdev); |
3322 | if ((ql_read32(qdev, STS) & qdev->port_init)) | 3398 | /* If the port is initialized and the |
3323 | netif_carrier_on(qdev->ndev); | 3399 | * link is up the turn on the carrier. |
3400 | */ | ||
3401 | if ((ql_read32(qdev, STS) & qdev->port_init) && | ||
3402 | (ql_read32(qdev, STS) & qdev->port_link_up)) | ||
3403 | ql_link_on(qdev); | ||
3324 | ql_enable_interrupts(qdev); | 3404 | ql_enable_interrupts(qdev); |
3325 | ql_enable_all_completion_interrupts(qdev); | 3405 | ql_enable_all_completion_interrupts(qdev); |
3326 | netif_tx_start_all_queues(qdev->ndev); | 3406 | netif_tx_start_all_queues(qdev->ndev); |
@@ -3346,11 +3426,6 @@ static int ql_get_adapter_resources(struct ql_adapter *qdev) | |||
3346 | return -ENOMEM; | 3426 | return -ENOMEM; |
3347 | } | 3427 | } |
3348 | status = ql_request_irq(qdev); | 3428 | status = ql_request_irq(qdev); |
3349 | if (status) | ||
3350 | goto err_irq; | ||
3351 | return status; | ||
3352 | err_irq: | ||
3353 | ql_free_mem_resources(qdev); | ||
3354 | return status; | 3429 | return status; |
3355 | } | 3430 | } |
3356 | 3431 | ||
@@ -3414,7 +3489,7 @@ static int ql_configure_rings(struct ql_adapter *qdev) | |||
3414 | 3489 | ||
3415 | for (i = 0; i < qdev->tx_ring_count; i++) { | 3490 | for (i = 0; i < qdev->tx_ring_count; i++) { |
3416 | tx_ring = &qdev->tx_ring[i]; | 3491 | tx_ring = &qdev->tx_ring[i]; |
3417 | memset((void *)tx_ring, 0, sizeof(tx_ring)); | 3492 | memset((void *)tx_ring, 0, sizeof(*tx_ring)); |
3418 | tx_ring->qdev = qdev; | 3493 | tx_ring->qdev = qdev; |
3419 | tx_ring->wq_id = i; | 3494 | tx_ring->wq_id = i; |
3420 | tx_ring->wq_len = qdev->tx_ring_size; | 3495 | tx_ring->wq_len = qdev->tx_ring_size; |
@@ -3430,7 +3505,7 @@ static int ql_configure_rings(struct ql_adapter *qdev) | |||
3430 | 3505 | ||
3431 | for (i = 0; i < qdev->rx_ring_count; i++) { | 3506 | for (i = 0; i < qdev->rx_ring_count; i++) { |
3432 | rx_ring = &qdev->rx_ring[i]; | 3507 | rx_ring = &qdev->rx_ring[i]; |
3433 | memset((void *)rx_ring, 0, sizeof(rx_ring)); | 3508 | memset((void *)rx_ring, 0, sizeof(*rx_ring)); |
3434 | rx_ring->qdev = qdev; | 3509 | rx_ring->qdev = qdev; |
3435 | rx_ring->cq_id = i; | 3510 | rx_ring->cq_id = i; |
3436 | rx_ring->cpu = i % cpu_cnt; /* CPU to run handler on. */ | 3511 | rx_ring->cpu = i % cpu_cnt; /* CPU to run handler on. */ |
@@ -3789,7 +3864,7 @@ static int __devinit ql_init_device(struct pci_dev *pdev, | |||
3789 | int pos, err = 0; | 3864 | int pos, err = 0; |
3790 | u16 val16; | 3865 | u16 val16; |
3791 | 3866 | ||
3792 | memset((void *)qdev, 0, sizeof(qdev)); | 3867 | memset((void *)qdev, 0, sizeof(*qdev)); |
3793 | err = pci_enable_device(pdev); | 3868 | err = pci_enable_device(pdev); |
3794 | if (err) { | 3869 | if (err) { |
3795 | dev_err(&pdev->dev, "PCI device enable failed.\n"); | 3870 | dev_err(&pdev->dev, "PCI device enable failed.\n"); |
@@ -3976,7 +4051,7 @@ static int __devinit qlge_probe(struct pci_dev *pdev, | |||
3976 | pci_disable_device(pdev); | 4051 | pci_disable_device(pdev); |
3977 | return err; | 4052 | return err; |
3978 | } | 4053 | } |
3979 | netif_carrier_off(ndev); | 4054 | ql_link_off(qdev); |
3980 | ql_display_dev_info(ndev); | 4055 | ql_display_dev_info(ndev); |
3981 | cards_found++; | 4056 | cards_found++; |
3982 | return 0; | 4057 | return 0; |
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index 71afbf8b9c50..6685bd97da91 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -238,7 +238,7 @@ static void ql_link_up(struct ql_adapter *qdev, struct mbox_params *mbcp) | |||
238 | &qdev->mpi_port_cfg_work, 0); | 238 | &qdev->mpi_port_cfg_work, 0); |
239 | } | 239 | } |
240 | 240 | ||
241 | netif_carrier_on(qdev->ndev); | 241 | ql_link_on(qdev); |
242 | } | 242 | } |
243 | 243 | ||
244 | static void ql_link_down(struct ql_adapter *qdev, struct mbox_params *mbcp) | 244 | static void ql_link_down(struct ql_adapter *qdev, struct mbox_params *mbcp) |
@@ -251,7 +251,7 @@ static void ql_link_down(struct ql_adapter *qdev, struct mbox_params *mbcp) | |||
251 | if (status) | 251 | if (status) |
252 | QPRINTK(qdev, DRV, ERR, "Link down AEN broken!\n"); | 252 | QPRINTK(qdev, DRV, ERR, "Link down AEN broken!\n"); |
253 | 253 | ||
254 | netif_carrier_off(qdev->ndev); | 254 | ql_link_off(qdev); |
255 | } | 255 | } |
256 | 256 | ||
257 | static int ql_sfp_in(struct ql_adapter *qdev, struct mbox_params *mbcp) | 257 | static int ql_sfp_in(struct ql_adapter *qdev, struct mbox_params *mbcp) |
@@ -849,7 +849,7 @@ void ql_mpi_idc_work(struct work_struct *work) | |||
849 | case MB_CMD_PORT_RESET: | 849 | case MB_CMD_PORT_RESET: |
850 | case MB_CMD_SET_PORT_CFG: | 850 | case MB_CMD_SET_PORT_CFG: |
851 | case MB_CMD_STOP_FW: | 851 | case MB_CMD_STOP_FW: |
852 | netif_carrier_off(qdev->ndev); | 852 | ql_link_off(qdev); |
853 | /* Signal the resulting link up AEN | 853 | /* Signal the resulting link up AEN |
854 | * that the frame routing and mac addr | 854 | * that the frame routing and mac addr |
855 | * needs to be set. | 855 | * needs to be set. |
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index ed63d23a6452..961b5397a531 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c | |||
@@ -49,8 +49,8 @@ | |||
49 | #include <asm/processor.h> | 49 | #include <asm/processor.h> |
50 | 50 | ||
51 | #define DRV_NAME "r6040" | 51 | #define DRV_NAME "r6040" |
52 | #define DRV_VERSION "0.23" | 52 | #define DRV_VERSION "0.24" |
53 | #define DRV_RELDATE "05May2009" | 53 | #define DRV_RELDATE "08Jul2009" |
54 | 54 | ||
55 | /* PHY CHIP Address */ | 55 | /* PHY CHIP Address */ |
56 | #define PHY1_ADDR 1 /* For MAC1 */ | 56 | #define PHY1_ADDR 1 /* For MAC1 */ |
@@ -704,8 +704,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) | |||
704 | /* Read MISR status and clear */ | 704 | /* Read MISR status and clear */ |
705 | status = ioread16(ioaddr + MISR); | 705 | status = ioread16(ioaddr + MISR); |
706 | 706 | ||
707 | if (status == 0x0000 || status == 0xffff) | 707 | if (status == 0x0000 || status == 0xffff) { |
708 | /* Restore RDC MAC interrupt */ | ||
709 | iowrite16(misr, ioaddr + MIER); | ||
708 | return IRQ_NONE; | 710 | return IRQ_NONE; |
711 | } | ||
709 | 712 | ||
710 | /* RX interrupt request */ | 713 | /* RX interrupt request */ |
711 | if (status & RX_INTS) { | 714 | if (status & RX_INTS) { |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 341882f959f3..a2d82ddb3b4d 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -865,8 +865,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
865 | struct sh_eth_private *mdp = netdev_priv(ndev); | 865 | struct sh_eth_private *mdp = netdev_priv(ndev); |
866 | struct sh_eth_cpu_data *cd = mdp->cd; | 866 | struct sh_eth_cpu_data *cd = mdp->cd; |
867 | irqreturn_t ret = IRQ_NONE; | 867 | irqreturn_t ret = IRQ_NONE; |
868 | u32 ioaddr, boguscnt = RX_RING_SIZE; | 868 | u32 ioaddr, intr_status = 0; |
869 | u32 intr_status = 0; | ||
870 | 869 | ||
871 | ioaddr = ndev->base_addr; | 870 | ioaddr = ndev->base_addr; |
872 | spin_lock(&mdp->lock); | 871 | spin_lock(&mdp->lock); |
@@ -901,12 +900,6 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
901 | if (intr_status & cd->eesr_err_check) | 900 | if (intr_status & cd->eesr_err_check) |
902 | sh_eth_error(ndev, intr_status); | 901 | sh_eth_error(ndev, intr_status); |
903 | 902 | ||
904 | if (--boguscnt < 0) { | ||
905 | printk(KERN_WARNING | ||
906 | "%s: Too much work at interrupt, status=0x%4.4x.\n", | ||
907 | ndev->name, intr_status); | ||
908 | } | ||
909 | |||
910 | other_irq: | 903 | other_irq: |
911 | spin_unlock(&mdp->lock); | 904 | spin_unlock(&mdp->lock); |
912 | 905 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 7681d28c53d7..daf961ab68bc 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -2495,7 +2495,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2495 | if (likely(status >> 16 == (status & 0xffff))) { | 2495 | if (likely(status >> 16 == (status & 0xffff))) { |
2496 | skb = sky2->rx_ring[sky2->rx_next].skb; | 2496 | skb = sky2->rx_ring[sky2->rx_next].skb; |
2497 | skb->ip_summed = CHECKSUM_COMPLETE; | 2497 | skb->ip_summed = CHECKSUM_COMPLETE; |
2498 | skb->csum = status & 0xffff; | 2498 | skb->csum = le16_to_cpu(status); |
2499 | } else { | 2499 | } else { |
2500 | printk(KERN_NOTICE PFX "%s: hardware receive " | 2500 | printk(KERN_NOTICE PFX "%s: hardware receive " |
2501 | "checksum problem (status = %#x)\n", | 2501 | "checksum problem (status = %#x)\n", |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index fdcbaf8dfa73..1c70e999cc50 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -1774,6 +1774,7 @@ static const struct net_device_ops smc_netdev_ops = { | |||
1774 | .ndo_start_xmit = smc_hard_start_xmit, | 1774 | .ndo_start_xmit = smc_hard_start_xmit, |
1775 | .ndo_tx_timeout = smc_timeout, | 1775 | .ndo_tx_timeout = smc_timeout, |
1776 | .ndo_set_multicast_list = smc_set_multicast_list, | 1776 | .ndo_set_multicast_list = smc_set_multicast_list, |
1777 | .ndo_change_mtu = eth_change_mtu, | ||
1777 | .ndo_validate_addr = eth_validate_addr, | 1778 | .ndo_validate_addr = eth_validate_addr, |
1778 | .ndo_set_mac_address = eth_mac_addr, | 1779 | .ndo_set_mac_address = eth_mac_addr, |
1779 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1780 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index b60639bd181b..94b6d2658ddc 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -1779,6 +1779,7 @@ static const struct net_device_ops smsc911x_netdev_ops = { | |||
1779 | .ndo_get_stats = smsc911x_get_stats, | 1779 | .ndo_get_stats = smsc911x_get_stats, |
1780 | .ndo_set_multicast_list = smsc911x_set_multicast_list, | 1780 | .ndo_set_multicast_list = smsc911x_set_multicast_list, |
1781 | .ndo_do_ioctl = smsc911x_do_ioctl, | 1781 | .ndo_do_ioctl = smsc911x_do_ioctl, |
1782 | .ndo_change_mtu = eth_change_mtu, | ||
1782 | .ndo_validate_addr = eth_validate_addr, | 1783 | .ndo_validate_addr = eth_validate_addr, |
1783 | .ndo_set_mac_address = smsc911x_set_mac_address, | 1784 | .ndo_set_mac_address = smsc911x_set_mac_address, |
1784 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1785 | #ifdef CONFIG_NET_POLL_CONTROLLER |
@@ -1938,7 +1939,7 @@ static int __devexit smsc911x_drv_remove(struct platform_device *pdev) | |||
1938 | if (!res) | 1939 | if (!res) |
1939 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1940 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1940 | 1941 | ||
1941 | release_mem_region(res->start, res->end - res->start); | 1942 | release_mem_region(res->start, resource_size(res)); |
1942 | 1943 | ||
1943 | iounmap(pdata->ioaddr); | 1944 | iounmap(pdata->ioaddr); |
1944 | 1945 | ||
@@ -1976,7 +1977,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) | |||
1976 | retval = -ENODEV; | 1977 | retval = -ENODEV; |
1977 | goto out_0; | 1978 | goto out_0; |
1978 | } | 1979 | } |
1979 | res_size = res->end - res->start + 1; | 1980 | res_size = resource_size(res); |
1980 | 1981 | ||
1981 | irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 1982 | irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
1982 | if (!irq_res) { | 1983 | if (!irq_res) { |
@@ -2104,7 +2105,7 @@ out_unmap_io_3: | |||
2104 | out_free_netdev_2: | 2105 | out_free_netdev_2: |
2105 | free_netdev(dev); | 2106 | free_netdev(dev); |
2106 | out_release_io_1: | 2107 | out_release_io_1: |
2107 | release_mem_region(res->start, res->end - res->start); | 2108 | release_mem_region(res->start, resource_size(res)); |
2108 | out_0: | 2109 | out_0: |
2109 | return retval; | 2110 | return retval; |
2110 | } | 2111 | } |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 838cce8b8fff..669253c7bd41 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -180,7 +180,7 @@ static int full_duplex[MAX_UNITS] = {0, }; | |||
180 | /* These identify the driver base version and may not be removed. */ | 180 | /* These identify the driver base version and may not be removed. */ |
181 | static const char version[] __devinitconst = | 181 | static const char version[] __devinitconst = |
182 | KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n" | 182 | KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n" |
183 | KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n"; | 183 | " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n"; |
184 | 184 | ||
185 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); | 185 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); |
186 | MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); | 186 | MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); |
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 545f81b34ad7..d1521c3875b2 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -1698,13 +1698,13 @@ static int netdev_close(struct net_device *dev) | |||
1698 | 1698 | ||
1699 | #ifdef __i386__ | 1699 | #ifdef __i386__ |
1700 | if (netif_msg_hw(np)) { | 1700 | if (netif_msg_hw(np)) { |
1701 | printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", | 1701 | printk(KERN_DEBUG " Tx ring at %8.8x:\n", |
1702 | (int)(np->tx_ring_dma)); | 1702 | (int)(np->tx_ring_dma)); |
1703 | for (i = 0; i < TX_RING_SIZE; i++) | 1703 | for (i = 0; i < TX_RING_SIZE; i++) |
1704 | printk(" #%d desc. %4.4x %8.8x %8.8x.\n", | 1704 | printk(KERN_DEBUG " #%d desc. %4.4x %8.8x %8.8x.\n", |
1705 | i, np->tx_ring[i].status, np->tx_ring[i].frag[0].addr, | 1705 | i, np->tx_ring[i].status, np->tx_ring[i].frag[0].addr, |
1706 | np->tx_ring[i].frag[0].length); | 1706 | np->tx_ring[i].frag[0].length); |
1707 | printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", | 1707 | printk(KERN_DEBUG " Rx ring %8.8x:\n", |
1708 | (int)(np->rx_ring_dma)); | 1708 | (int)(np->rx_ring_dma)); |
1709 | for (i = 0; i < /*RX_RING_SIZE*/4 ; i++) { | 1709 | for (i = 0; i < /*RX_RING_SIZE*/4 ; i++) { |
1710 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", | 1710 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", |
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c index a82fb2aca4cb..f1e5e4542c2a 100644 --- a/drivers/net/sunvnet.c +++ b/drivers/net/sunvnet.c | |||
@@ -1016,7 +1016,9 @@ static const struct net_device_ops vnet_ops = { | |||
1016 | .ndo_open = vnet_open, | 1016 | .ndo_open = vnet_open, |
1017 | .ndo_stop = vnet_close, | 1017 | .ndo_stop = vnet_close, |
1018 | .ndo_set_multicast_list = vnet_set_rx_mode, | 1018 | .ndo_set_multicast_list = vnet_set_rx_mode, |
1019 | .ndo_change_mtu = eth_change_mtu, | ||
1019 | .ndo_set_mac_address = vnet_set_mac_addr, | 1020 | .ndo_set_mac_address = vnet_set_mac_addr, |
1021 | .ndo_validate_addr = eth_validate_addr, | ||
1020 | .ndo_tx_timeout = vnet_tx_timeout, | 1022 | .ndo_tx_timeout = vnet_tx_timeout, |
1021 | .ndo_change_mtu = vnet_change_mtu, | 1023 | .ndo_change_mtu = vnet_change_mtu, |
1022 | .ndo_start_xmit = vnet_start_xmit, | 1024 | .ndo_start_xmit = vnet_start_xmit, |
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c index 0f78f99f9b20..7030bd5e9848 100644 --- a/drivers/net/tsi108_eth.c +++ b/drivers/net/tsi108_eth.c | |||
@@ -1132,7 +1132,9 @@ static int tsi108_get_mac(struct net_device *dev) | |||
1132 | } | 1132 | } |
1133 | 1133 | ||
1134 | if (!is_valid_ether_addr(dev->dev_addr)) { | 1134 | if (!is_valid_ether_addr(dev->dev_addr)) { |
1135 | printk("KERN_ERR: word1: %08x, word2: %08x\n", word1, word2); | 1135 | printk(KERN_ERR |
1136 | "%s: Invalid MAC address. word1: %08x, word2: %08x\n", | ||
1137 | dev->name, word1, word2); | ||
1136 | return -EINVAL; | 1138 | return -EINVAL; |
1137 | } | 1139 | } |
1138 | 1140 | ||
@@ -1201,8 +1203,8 @@ static void tsi108_set_rx_mode(struct net_device *dev) | |||
1201 | __set_bit(hash, &data->mc_hash[0]); | 1203 | __set_bit(hash, &data->mc_hash[0]); |
1202 | } else { | 1204 | } else { |
1203 | printk(KERN_ERR | 1205 | printk(KERN_ERR |
1204 | "%s: got multicast address of length %d " | 1206 | "%s: got multicast address of length %d instead of 6.\n", |
1205 | "instead of 6.\n", dev->name, | 1207 | dev->name, |
1206 | mc->dmi_addrlen); | 1208 | mc->dmi_addrlen); |
1207 | } | 1209 | } |
1208 | 1210 | ||
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 81f054dbb88d..ef49744a5085 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -944,9 +944,10 @@ static void de_set_media (struct de_private *de) | |||
944 | macmode &= ~FullDuplex; | 944 | macmode &= ~FullDuplex; |
945 | 945 | ||
946 | if (netif_msg_link(de)) { | 946 | if (netif_msg_link(de)) { |
947 | printk(KERN_INFO "%s: set link %s\n" | 947 | printk(KERN_INFO |
948 | KERN_INFO "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n" | 948 | "%s: set link %s\n" |
949 | KERN_INFO "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", | 949 | "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n" |
950 | "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", | ||
950 | de->dev->name, media_name[media], | 951 | de->dev->name, media_name[media], |
951 | de->dev->name, dr32(MacMode), dr32(SIAStatus), | 952 | de->dev->name, dr32(MacMode), dr32(SIAStatus), |
952 | dr32(CSR13), dr32(CSR14), dr32(CSR15), | 953 | dr32(CSR13), dr32(CSR14), dr32(CSR15), |
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 2abb5d3becc6..99a63649f4fc 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -570,16 +570,18 @@ static void tulip_tx_timeout(struct net_device *dev) | |||
570 | (unsigned int)tp->rx_ring[i].buffer2, | 570 | (unsigned int)tp->rx_ring[i].buffer2, |
571 | buf[0], buf[1], buf[2]); | 571 | buf[0], buf[1], buf[2]); |
572 | for (j = 0; buf[j] != 0xee && j < 1600; j++) | 572 | for (j = 0; buf[j] != 0xee && j < 1600; j++) |
573 | if (j < 100) printk(" %2.2x", buf[j]); | 573 | if (j < 100) |
574 | printk(" j=%d.\n", j); | 574 | printk(KERN_CONT " %2.2x", buf[j]); |
575 | printk(KERN_CONT " j=%d.\n", j); | ||
575 | } | 576 | } |
576 | printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring); | 577 | printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring); |
577 | for (i = 0; i < RX_RING_SIZE; i++) | 578 | for (i = 0; i < RX_RING_SIZE; i++) |
578 | printk(" %8.8x", (unsigned int)tp->rx_ring[i].status); | 579 | printk(KERN_CONT " %8.8x", |
579 | printk("\n" KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring); | 580 | (unsigned int)tp->rx_ring[i].status); |
581 | printk(KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring); | ||
580 | for (i = 0; i < TX_RING_SIZE; i++) | 582 | for (i = 0; i < TX_RING_SIZE; i++) |
581 | printk(" %8.8x", (unsigned int)tp->tx_ring[i].status); | 583 | printk(KERN_CONT " %8.8x", (unsigned int)tp->tx_ring[i].status); |
582 | printk("\n"); | 584 | printk(KERN_CONT "\n"); |
583 | } | 585 | } |
584 | #endif | 586 | #endif |
585 | 587 | ||
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c index 842b1a2c40d4..0f15773dae52 100644 --- a/drivers/net/tulip/winbond-840.c +++ b/drivers/net/tulip/winbond-840.c | |||
@@ -142,7 +142,7 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; | |||
142 | static const char version[] __initconst = | 142 | static const char version[] __initconst = |
143 | KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " | 143 | KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " |
144 | DRV_RELDATE " Donald Becker <becker@scyld.com>\n" | 144 | DRV_RELDATE " Donald Becker <becker@scyld.com>\n" |
145 | KERN_INFO " http://www.scyld.com/network/drivers.html\n"; | 145 | " http://www.scyld.com/network/drivers.html\n"; |
146 | 146 | ||
147 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); | 147 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); |
148 | MODULE_DESCRIPTION("Winbond W89c840 Ethernet driver"); | 148 | MODULE_DESCRIPTION("Winbond W89c840 Ethernet driver"); |
@@ -939,7 +939,7 @@ static void tx_timeout(struct net_device *dev) | |||
939 | printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); | 939 | printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); |
940 | for (i = 0; i < RX_RING_SIZE; i++) | 940 | for (i = 0; i < RX_RING_SIZE; i++) |
941 | printk(" %8.8x", (unsigned int)np->rx_ring[i].status); | 941 | printk(" %8.8x", (unsigned int)np->rx_ring[i].status); |
942 | printk("\n"KERN_DEBUG" Tx ring %p: ", np->tx_ring); | 942 | printk(KERN_DEBUG" Tx ring %p: ", np->tx_ring); |
943 | for (i = 0; i < TX_RING_SIZE; i++) | 943 | for (i = 0; i < TX_RING_SIZE; i++) |
944 | printk(" %8.8x", np->tx_ring[i].status); | 944 | printk(" %8.8x", np->tx_ring[i].status); |
945 | printk("\n"); | 945 | printk("\n"); |
@@ -1520,7 +1520,7 @@ static int netdev_close(struct net_device *dev) | |||
1520 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x.\n", | 1520 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x.\n", |
1521 | i, np->tx_ring[i].length, | 1521 | i, np->tx_ring[i].length, |
1522 | np->tx_ring[i].status, np->tx_ring[i].buffer1); | 1522 | np->tx_ring[i].status, np->tx_ring[i].buffer1); |
1523 | printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", | 1523 | printk(KERN_DEBUG " Rx ring %8.8x:\n", |
1524 | (int)np->rx_ring); | 1524 | (int)np->rx_ring); |
1525 | for (i = 0; i < RX_RING_SIZE; i++) { | 1525 | for (i = 0; i < RX_RING_SIZE; i++) { |
1526 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", | 1526 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 11a0ba47b677..027f7aba26af 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -486,12 +486,14 @@ static unsigned int tun_chr_poll(struct file *file, poll_table * wait) | |||
486 | { | 486 | { |
487 | struct tun_file *tfile = file->private_data; | 487 | struct tun_file *tfile = file->private_data; |
488 | struct tun_struct *tun = __tun_get(tfile); | 488 | struct tun_struct *tun = __tun_get(tfile); |
489 | struct sock *sk = tun->sk; | 489 | struct sock *sk; |
490 | unsigned int mask = 0; | 490 | unsigned int mask = 0; |
491 | 491 | ||
492 | if (!tun) | 492 | if (!tun) |
493 | return POLLERR; | 493 | return POLLERR; |
494 | 494 | ||
495 | sk = tun->sk; | ||
496 | |||
495 | DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name); | 497 | DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name); |
496 | 498 | ||
497 | poll_wait(file, &tun->socket.wait, wait); | 499 | poll_wait(file, &tun->socket.wait, wait); |
@@ -1324,20 +1326,22 @@ static int tun_chr_close(struct inode *inode, struct file *file) | |||
1324 | struct tun_file *tfile = file->private_data; | 1326 | struct tun_file *tfile = file->private_data; |
1325 | struct tun_struct *tun; | 1327 | struct tun_struct *tun; |
1326 | 1328 | ||
1327 | |||
1328 | rtnl_lock(); | ||
1329 | tun = __tun_get(tfile); | 1329 | tun = __tun_get(tfile); |
1330 | if (tun) { | 1330 | if (tun) { |
1331 | DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name); | 1331 | struct net_device *dev = tun->dev; |
1332 | |||
1333 | DBG(KERN_INFO "%s: tun_chr_close\n", dev->name); | ||
1332 | 1334 | ||
1333 | __tun_detach(tun); | 1335 | __tun_detach(tun); |
1334 | 1336 | ||
1335 | /* If desireable, unregister the netdevice. */ | 1337 | /* If desireable, unregister the netdevice. */ |
1336 | if (!(tun->flags & TUN_PERSIST)) | 1338 | if (!(tun->flags & TUN_PERSIST)) { |
1337 | unregister_netdevice(tun->dev); | 1339 | rtnl_lock(); |
1338 | 1340 | if (dev->reg_state == NETREG_REGISTERED) | |
1341 | unregister_netdevice(dev); | ||
1342 | rtnl_unlock(); | ||
1343 | } | ||
1339 | } | 1344 | } |
1340 | rtnl_unlock(); | ||
1341 | 1345 | ||
1342 | tun = tfile->tun; | 1346 | tun = tfile->tun; |
1343 | if (tun) | 1347 | if (tun) |
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c index 80e01778dd3b..cd35d50e46d4 100644 --- a/drivers/net/usb/cdc_eem.c +++ b/drivers/net/usb/cdc_eem.c | |||
@@ -319,7 +319,7 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
319 | return crc == crc2; | 319 | return crc == crc2; |
320 | 320 | ||
321 | if (unlikely(crc != crc2)) { | 321 | if (unlikely(crc != crc2)) { |
322 | dev->stats.rx_errors++; | 322 | dev->net->stats.rx_errors++; |
323 | dev_kfree_skb_any(skb2); | 323 | dev_kfree_skb_any(skb2); |
324 | } else | 324 | } else |
325 | usbnet_skb_return(dev, skb2); | 325 | usbnet_skb_return(dev, skb2); |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 7ae82446b93a..1d3730d6690f 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -513,11 +513,11 @@ static int dm9601_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
513 | len = (skb->data[1] | (skb->data[2] << 8)) - 4; | 513 | len = (skb->data[1] | (skb->data[2] << 8)) - 4; |
514 | 514 | ||
515 | if (unlikely(status & 0xbf)) { | 515 | if (unlikely(status & 0xbf)) { |
516 | if (status & 0x01) dev->stats.rx_fifo_errors++; | 516 | if (status & 0x01) dev->net->stats.rx_fifo_errors++; |
517 | if (status & 0x02) dev->stats.rx_crc_errors++; | 517 | if (status & 0x02) dev->net->stats.rx_crc_errors++; |
518 | if (status & 0x04) dev->stats.rx_frame_errors++; | 518 | if (status & 0x04) dev->net->stats.rx_frame_errors++; |
519 | if (status & 0x20) dev->stats.rx_missed_errors++; | 519 | if (status & 0x20) dev->net->stats.rx_missed_errors++; |
520 | if (status & 0x90) dev->stats.rx_length_errors++; | 520 | if (status & 0x90) dev->net->stats.rx_length_errors++; |
521 | return 0; | 521 | return 0; |
522 | } | 522 | } |
523 | 523 | ||
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index e01314789718..1f9ec29fce50 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
@@ -999,6 +999,9 @@ static const struct net_device_ops kaweth_netdev_ops = { | |||
999 | .ndo_tx_timeout = kaweth_tx_timeout, | 999 | .ndo_tx_timeout = kaweth_tx_timeout, |
1000 | .ndo_set_multicast_list = kaweth_set_rx_mode, | 1000 | .ndo_set_multicast_list = kaweth_set_rx_mode, |
1001 | .ndo_get_stats = kaweth_netdev_stats, | 1001 | .ndo_get_stats = kaweth_netdev_stats, |
1002 | .ndo_change_mtu = eth_change_mtu, | ||
1003 | .ndo_set_mac_address = eth_mac_addr, | ||
1004 | .ndo_validate_addr = eth_validate_addr, | ||
1002 | }; | 1005 | }; |
1003 | 1006 | ||
1004 | static int kaweth_probe( | 1007 | static int kaweth_probe( |
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c index 034e8a73ca6b..aeb1ab03a9ee 100644 --- a/drivers/net/usb/net1080.c +++ b/drivers/net/usb/net1080.c | |||
@@ -433,7 +433,7 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
433 | dbg("rx framesize %d range %d..%d mtu %d", skb->len, | 433 | dbg("rx framesize %d range %d..%d mtu %d", skb->len, |
434 | net->hard_header_len, dev->hard_mtu, net->mtu); | 434 | net->hard_header_len, dev->hard_mtu, net->mtu); |
435 | #endif | 435 | #endif |
436 | dev->stats.rx_frame_errors++; | 436 | dev->net->stats.rx_frame_errors++; |
437 | nc_ensure_sync(dev); | 437 | nc_ensure_sync(dev); |
438 | return 0; | 438 | return 0; |
439 | } | 439 | } |
@@ -442,12 +442,12 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
442 | hdr_len = le16_to_cpup(&header->hdr_len); | 442 | hdr_len = le16_to_cpup(&header->hdr_len); |
443 | packet_len = le16_to_cpup(&header->packet_len); | 443 | packet_len = le16_to_cpup(&header->packet_len); |
444 | if (FRAMED_SIZE(packet_len) > NC_MAX_PACKET) { | 444 | if (FRAMED_SIZE(packet_len) > NC_MAX_PACKET) { |
445 | dev->stats.rx_frame_errors++; | 445 | dev->net->stats.rx_frame_errors++; |
446 | dbg("packet too big, %d", packet_len); | 446 | dbg("packet too big, %d", packet_len); |
447 | nc_ensure_sync(dev); | 447 | nc_ensure_sync(dev); |
448 | return 0; | 448 | return 0; |
449 | } else if (hdr_len < MIN_HEADER) { | 449 | } else if (hdr_len < MIN_HEADER) { |
450 | dev->stats.rx_frame_errors++; | 450 | dev->net->stats.rx_frame_errors++; |
451 | dbg("header too short, %d", hdr_len); | 451 | dbg("header too short, %d", hdr_len); |
452 | nc_ensure_sync(dev); | 452 | nc_ensure_sync(dev); |
453 | return 0; | 453 | return 0; |
@@ -465,21 +465,21 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
465 | 465 | ||
466 | if ((packet_len & 0x01) == 0) { | 466 | if ((packet_len & 0x01) == 0) { |
467 | if (skb->data [packet_len] != PAD_BYTE) { | 467 | if (skb->data [packet_len] != PAD_BYTE) { |
468 | dev->stats.rx_frame_errors++; | 468 | dev->net->stats.rx_frame_errors++; |
469 | dbg("bad pad"); | 469 | dbg("bad pad"); |
470 | return 0; | 470 | return 0; |
471 | } | 471 | } |
472 | skb_trim(skb, skb->len - 1); | 472 | skb_trim(skb, skb->len - 1); |
473 | } | 473 | } |
474 | if (skb->len != packet_len) { | 474 | if (skb->len != packet_len) { |
475 | dev->stats.rx_frame_errors++; | 475 | dev->net->stats.rx_frame_errors++; |
476 | dbg("bad packet len %d (expected %d)", | 476 | dbg("bad packet len %d (expected %d)", |
477 | skb->len, packet_len); | 477 | skb->len, packet_len); |
478 | nc_ensure_sync(dev); | 478 | nc_ensure_sync(dev); |
479 | return 0; | 479 | return 0; |
480 | } | 480 | } |
481 | if (header->packet_id != get_unaligned(&trailer->packet_id)) { | 481 | if (header->packet_id != get_unaligned(&trailer->packet_id)) { |
482 | dev->stats.rx_fifo_errors++; | 482 | dev->net->stats.rx_fifo_errors++; |
483 | dbg("(2+ dropped) rx packet_id mismatch 0x%x 0x%x", | 483 | dbg("(2+ dropped) rx packet_id mismatch 0x%x 0x%x", |
484 | le16_to_cpu(header->packet_id), | 484 | le16_to_cpu(header->packet_id), |
485 | le16_to_cpu(trailer->packet_id)); | 485 | le16_to_cpu(trailer->packet_id)); |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 73acbd244aa1..631d269ac980 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -1493,6 +1493,9 @@ static const struct net_device_ops pegasus_netdev_ops = { | |||
1493 | .ndo_set_multicast_list = pegasus_set_multicast, | 1493 | .ndo_set_multicast_list = pegasus_set_multicast, |
1494 | .ndo_get_stats = pegasus_netdev_stats, | 1494 | .ndo_get_stats = pegasus_netdev_stats, |
1495 | .ndo_tx_timeout = pegasus_tx_timeout, | 1495 | .ndo_tx_timeout = pegasus_tx_timeout, |
1496 | .ndo_change_mtu = eth_change_mtu, | ||
1497 | .ndo_set_mac_address = eth_mac_addr, | ||
1498 | .ndo_validate_addr = eth_validate_addr, | ||
1496 | }; | 1499 | }; |
1497 | 1500 | ||
1498 | static struct usb_driver pegasus_driver = { | 1501 | static struct usb_driver pegasus_driver = { |
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 1bf243ef950e..2232232b7989 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -487,7 +487,7 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
487 | if (unlikely(hdr->msg_type != RNDIS_MSG_PACKET | 487 | if (unlikely(hdr->msg_type != RNDIS_MSG_PACKET |
488 | || skb->len < msg_len | 488 | || skb->len < msg_len |
489 | || (data_offset + data_len + 8) > msg_len)) { | 489 | || (data_offset + data_len + 8) > msg_len)) { |
490 | dev->stats.rx_frame_errors++; | 490 | dev->net->stats.rx_frame_errors++; |
491 | devdbg(dev, "bad rndis message %d/%d/%d/%d, len %d", | 491 | devdbg(dev, "bad rndis message %d/%d/%d/%d, len %d", |
492 | le32_to_cpu(hdr->msg_type), | 492 | le32_to_cpu(hdr->msg_type), |
493 | msg_len, data_offset, data_len, skb->len); | 493 | msg_len, data_offset, data_len, skb->len); |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 89a91f8c22de..fe045896406b 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -1108,18 +1108,18 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1108 | if (unlikely(header & RX_STS_ES_)) { | 1108 | if (unlikely(header & RX_STS_ES_)) { |
1109 | if (netif_msg_rx_err(dev)) | 1109 | if (netif_msg_rx_err(dev)) |
1110 | devdbg(dev, "Error header=0x%08x", header); | 1110 | devdbg(dev, "Error header=0x%08x", header); |
1111 | dev->stats.rx_errors++; | 1111 | dev->net->stats.rx_errors++; |
1112 | dev->stats.rx_dropped++; | 1112 | dev->net->stats.rx_dropped++; |
1113 | 1113 | ||
1114 | if (header & RX_STS_CRC_) { | 1114 | if (header & RX_STS_CRC_) { |
1115 | dev->stats.rx_crc_errors++; | 1115 | dev->net->stats.rx_crc_errors++; |
1116 | } else { | 1116 | } else { |
1117 | if (header & (RX_STS_TL_ | RX_STS_RF_)) | 1117 | if (header & (RX_STS_TL_ | RX_STS_RF_)) |
1118 | dev->stats.rx_frame_errors++; | 1118 | dev->net->stats.rx_frame_errors++; |
1119 | 1119 | ||
1120 | if ((header & RX_STS_LE_) && | 1120 | if ((header & RX_STS_LE_) && |
1121 | (!(header & RX_STS_FT_))) | 1121 | (!(header & RX_STS_FT_))) |
1122 | dev->stats.rx_length_errors++; | 1122 | dev->net->stats.rx_length_errors++; |
1123 | } | 1123 | } |
1124 | } else { | 1124 | } else { |
1125 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ | 1125 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 22c0585a0319..edfd9e10ceba 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -234,8 +234,8 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb) | |||
234 | int status; | 234 | int status; |
235 | 235 | ||
236 | skb->protocol = eth_type_trans (skb, dev->net); | 236 | skb->protocol = eth_type_trans (skb, dev->net); |
237 | dev->stats.rx_packets++; | 237 | dev->net->stats.rx_packets++; |
238 | dev->stats.rx_bytes += skb->len; | 238 | dev->net->stats.rx_bytes += skb->len; |
239 | 239 | ||
240 | if (netif_msg_rx_status (dev)) | 240 | if (netif_msg_rx_status (dev)) |
241 | devdbg (dev, "< rx, len %zu, type 0x%x", | 241 | devdbg (dev, "< rx, len %zu, type 0x%x", |
@@ -397,7 +397,7 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) | |||
397 | if (netif_msg_rx_err (dev)) | 397 | if (netif_msg_rx_err (dev)) |
398 | devdbg (dev, "drop"); | 398 | devdbg (dev, "drop"); |
399 | error: | 399 | error: |
400 | dev->stats.rx_errors++; | 400 | dev->net->stats.rx_errors++; |
401 | skb_queue_tail (&dev->done, skb); | 401 | skb_queue_tail (&dev->done, skb); |
402 | } | 402 | } |
403 | } | 403 | } |
@@ -420,8 +420,8 @@ static void rx_complete (struct urb *urb) | |||
420 | case 0: | 420 | case 0: |
421 | if (skb->len < dev->net->hard_header_len) { | 421 | if (skb->len < dev->net->hard_header_len) { |
422 | entry->state = rx_cleanup; | 422 | entry->state = rx_cleanup; |
423 | dev->stats.rx_errors++; | 423 | dev->net->stats.rx_errors++; |
424 | dev->stats.rx_length_errors++; | 424 | dev->net->stats.rx_length_errors++; |
425 | if (netif_msg_rx_err (dev)) | 425 | if (netif_msg_rx_err (dev)) |
426 | devdbg (dev, "rx length %d", skb->len); | 426 | devdbg (dev, "rx length %d", skb->len); |
427 | } | 427 | } |
@@ -433,7 +433,7 @@ static void rx_complete (struct urb *urb) | |||
433 | * storm, recovering as needed. | 433 | * storm, recovering as needed. |
434 | */ | 434 | */ |
435 | case -EPIPE: | 435 | case -EPIPE: |
436 | dev->stats.rx_errors++; | 436 | dev->net->stats.rx_errors++; |
437 | usbnet_defer_kevent (dev, EVENT_RX_HALT); | 437 | usbnet_defer_kevent (dev, EVENT_RX_HALT); |
438 | // FALLTHROUGH | 438 | // FALLTHROUGH |
439 | 439 | ||
@@ -451,7 +451,7 @@ static void rx_complete (struct urb *urb) | |||
451 | case -EPROTO: | 451 | case -EPROTO: |
452 | case -ETIME: | 452 | case -ETIME: |
453 | case -EILSEQ: | 453 | case -EILSEQ: |
454 | dev->stats.rx_errors++; | 454 | dev->net->stats.rx_errors++; |
455 | if (!timer_pending (&dev->delay)) { | 455 | if (!timer_pending (&dev->delay)) { |
456 | mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); | 456 | mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); |
457 | if (netif_msg_link (dev)) | 457 | if (netif_msg_link (dev)) |
@@ -465,12 +465,12 @@ block: | |||
465 | 465 | ||
466 | /* data overrun ... flush fifo? */ | 466 | /* data overrun ... flush fifo? */ |
467 | case -EOVERFLOW: | 467 | case -EOVERFLOW: |
468 | dev->stats.rx_over_errors++; | 468 | dev->net->stats.rx_over_errors++; |
469 | // FALLTHROUGH | 469 | // FALLTHROUGH |
470 | 470 | ||
471 | default: | 471 | default: |
472 | entry->state = rx_cleanup; | 472 | entry->state = rx_cleanup; |
473 | dev->stats.rx_errors++; | 473 | dev->net->stats.rx_errors++; |
474 | if (netif_msg_rx_err (dev)) | 474 | if (netif_msg_rx_err (dev)) |
475 | devdbg (dev, "rx status %d", urb_status); | 475 | devdbg (dev, "rx status %d", urb_status); |
476 | break; | 476 | break; |
@@ -583,8 +583,8 @@ int usbnet_stop (struct net_device *net) | |||
583 | 583 | ||
584 | if (netif_msg_ifdown (dev)) | 584 | if (netif_msg_ifdown (dev)) |
585 | devinfo (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld", | 585 | devinfo (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld", |
586 | dev->stats.rx_packets, dev->stats.tx_packets, | 586 | net->stats.rx_packets, net->stats.tx_packets, |
587 | dev->stats.rx_errors, dev->stats.tx_errors | 587 | net->stats.rx_errors, net->stats.tx_errors |
588 | ); | 588 | ); |
589 | 589 | ||
590 | // ensure there are no more active urbs | 590 | // ensure there are no more active urbs |
@@ -891,10 +891,10 @@ static void tx_complete (struct urb *urb) | |||
891 | struct usbnet *dev = entry->dev; | 891 | struct usbnet *dev = entry->dev; |
892 | 892 | ||
893 | if (urb->status == 0) { | 893 | if (urb->status == 0) { |
894 | dev->stats.tx_packets++; | 894 | dev->net->stats.tx_packets++; |
895 | dev->stats.tx_bytes += entry->length; | 895 | dev->net->stats.tx_bytes += entry->length; |
896 | } else { | 896 | } else { |
897 | dev->stats.tx_errors++; | 897 | dev->net->stats.tx_errors++; |
898 | 898 | ||
899 | switch (urb->status) { | 899 | switch (urb->status) { |
900 | case -EPIPE: | 900 | case -EPIPE: |
@@ -1020,7 +1020,7 @@ int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net) | |||
1020 | devdbg (dev, "drop, code %d", retval); | 1020 | devdbg (dev, "drop, code %d", retval); |
1021 | drop: | 1021 | drop: |
1022 | retval = NET_XMIT_SUCCESS; | 1022 | retval = NET_XMIT_SUCCESS; |
1023 | dev->stats.tx_dropped++; | 1023 | dev->net->stats.tx_dropped++; |
1024 | if (skb) | 1024 | if (skb) |
1025 | dev_kfree_skb_any (skb); | 1025 | dev_kfree_skb_any (skb); |
1026 | usb_free_urb (urb); | 1026 | usb_free_urb (urb); |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 87197dd9c788..1097c72e44d5 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -208,11 +208,14 @@ rx_drop: | |||
208 | 208 | ||
209 | static struct net_device_stats *veth_get_stats(struct net_device *dev) | 209 | static struct net_device_stats *veth_get_stats(struct net_device *dev) |
210 | { | 210 | { |
211 | struct veth_priv *priv = netdev_priv(dev); | 211 | struct veth_priv *priv; |
212 | struct net_device_stats *dev_stats = &dev->stats; | 212 | struct net_device_stats *dev_stats; |
213 | unsigned int cpu; | 213 | int cpu; |
214 | struct veth_net_stats *stats; | 214 | struct veth_net_stats *stats; |
215 | 215 | ||
216 | priv = netdev_priv(dev); | ||
217 | dev_stats = &dev->stats; | ||
218 | |||
216 | dev_stats->rx_packets = 0; | 219 | dev_stats->rx_packets = 0; |
217 | dev_stats->tx_packets = 0; | 220 | dev_stats->tx_packets = 0; |
218 | dev_stats->rx_bytes = 0; | 221 | dev_stats->rx_bytes = 0; |
@@ -220,17 +223,16 @@ static struct net_device_stats *veth_get_stats(struct net_device *dev) | |||
220 | dev_stats->tx_dropped = 0; | 223 | dev_stats->tx_dropped = 0; |
221 | dev_stats->rx_dropped = 0; | 224 | dev_stats->rx_dropped = 0; |
222 | 225 | ||
223 | if (priv->stats) | 226 | for_each_online_cpu(cpu) { |
224 | for_each_online_cpu(cpu) { | 227 | stats = per_cpu_ptr(priv->stats, cpu); |
225 | stats = per_cpu_ptr(priv->stats, cpu); | ||
226 | 228 | ||
227 | dev_stats->rx_packets += stats->rx_packets; | 229 | dev_stats->rx_packets += stats->rx_packets; |
228 | dev_stats->tx_packets += stats->tx_packets; | 230 | dev_stats->tx_packets += stats->tx_packets; |
229 | dev_stats->rx_bytes += stats->rx_bytes; | 231 | dev_stats->rx_bytes += stats->rx_bytes; |
230 | dev_stats->tx_bytes += stats->tx_bytes; | 232 | dev_stats->tx_bytes += stats->tx_bytes; |
231 | dev_stats->tx_dropped += stats->tx_dropped; | 233 | dev_stats->tx_dropped += stats->tx_dropped; |
232 | dev_stats->rx_dropped += stats->rx_dropped; | 234 | dev_stats->rx_dropped += stats->rx_dropped; |
233 | } | 235 | } |
234 | 236 | ||
235 | return dev_stats; | 237 | return dev_stats; |
236 | } | 238 | } |
@@ -257,8 +259,6 @@ static int veth_close(struct net_device *dev) | |||
257 | netif_carrier_off(dev); | 259 | netif_carrier_off(dev); |
258 | netif_carrier_off(priv->peer); | 260 | netif_carrier_off(priv->peer); |
259 | 261 | ||
260 | free_percpu(priv->stats); | ||
261 | priv->stats = NULL; | ||
262 | return 0; | 262 | return 0; |
263 | } | 263 | } |
264 | 264 | ||
@@ -289,6 +289,15 @@ static int veth_dev_init(struct net_device *dev) | |||
289 | return 0; | 289 | return 0; |
290 | } | 290 | } |
291 | 291 | ||
292 | static void veth_dev_free(struct net_device *dev) | ||
293 | { | ||
294 | struct veth_priv *priv; | ||
295 | |||
296 | priv = netdev_priv(dev); | ||
297 | free_percpu(priv->stats); | ||
298 | free_netdev(dev); | ||
299 | } | ||
300 | |||
292 | static const struct net_device_ops veth_netdev_ops = { | 301 | static const struct net_device_ops veth_netdev_ops = { |
293 | .ndo_init = veth_dev_init, | 302 | .ndo_init = veth_dev_init, |
294 | .ndo_open = veth_open, | 303 | .ndo_open = veth_open, |
@@ -306,7 +315,7 @@ static void veth_setup(struct net_device *dev) | |||
306 | dev->netdev_ops = &veth_netdev_ops; | 315 | dev->netdev_ops = &veth_netdev_ops; |
307 | dev->ethtool_ops = &veth_ethtool_ops; | 316 | dev->ethtool_ops = &veth_ethtool_ops; |
308 | dev->features |= NETIF_F_LLTX; | 317 | dev->features |= NETIF_F_LLTX; |
309 | dev->destructor = free_netdev; | 318 | dev->destructor = veth_dev_free; |
310 | } | 319 | } |
311 | 320 | ||
312 | /* | 321 | /* |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index d3489a3c4c03..88c30a58b4bd 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -621,6 +621,7 @@ static const struct net_device_ops rhine_netdev_ops = { | |||
621 | .ndo_start_xmit = rhine_start_tx, | 621 | .ndo_start_xmit = rhine_start_tx, |
622 | .ndo_get_stats = rhine_get_stats, | 622 | .ndo_get_stats = rhine_get_stats, |
623 | .ndo_set_multicast_list = rhine_set_rx_mode, | 623 | .ndo_set_multicast_list = rhine_set_rx_mode, |
624 | .ndo_change_mtu = eth_change_mtu, | ||
624 | .ndo_validate_addr = eth_validate_addr, | 625 | .ndo_validate_addr = eth_validate_addr, |
625 | .ndo_set_mac_address = eth_mac_addr, | 626 | .ndo_set_mac_address = eth_mac_addr, |
626 | .ndo_do_ioctl = netdev_ioctl, | 627 | .ndo_do_ioctl = netdev_ioctl, |
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c index 223238de475c..1ea1ef6c3b96 100644 --- a/drivers/net/wan/hd64570.c +++ b/drivers/net/wan/hd64570.c | |||
@@ -584,8 +584,9 @@ static void sca_dump_rings(struct net_device *dev) | |||
584 | sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); | 584 | sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); |
585 | for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) | 585 | for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) |
586 | printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); | 586 | printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); |
587 | printk(KERN_CONT "\n"); | ||
587 | 588 | ||
588 | printk("\n" KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " | 589 | printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " |
589 | "last=%u %sactive", | 590 | "last=%u %sactive", |
590 | sca_inw(get_dmac_tx(port) + CDAL, card), | 591 | sca_inw(get_dmac_tx(port) + CDAL, card), |
591 | sca_inw(get_dmac_tx(port) + EDAL, card), | 592 | sca_inw(get_dmac_tx(port) + EDAL, card), |
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index 497b003d7239..f099c34a3ae2 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c | |||
@@ -529,8 +529,9 @@ static void sca_dump_rings(struct net_device *dev) | |||
529 | sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in"); | 529 | sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in"); |
530 | for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++) | 530 | for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++) |
531 | printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); | 531 | printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); |
532 | printk(KERN_CONT "\n"); | ||
532 | 533 | ||
533 | printk("\n" KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " | 534 | printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " |
534 | "last=%u %sactive", | 535 | "last=%u %sactive", |
535 | sca_inl(get_dmac_tx(port) + CDAL, card), | 536 | sca_inl(get_dmac_tx(port) + CDAL, card), |
536 | sca_inl(get_dmac_tx(port) + EDAL, card), | 537 | sca_inl(get_dmac_tx(port) + EDAL, card), |
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 3fb9dbc88a1a..d14e95a08d66 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
@@ -326,11 +326,9 @@ sbni_pci_probe( struct net_device *dev ) | |||
326 | } | 326 | } |
327 | 327 | ||
328 | if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs) | 328 | if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs) |
329 | printk( KERN_WARNING " WARNING: The PCI BIOS assigned " | 329 | printk( KERN_WARNING |
330 | "this PCI card to IRQ %d, which is unlikely " | 330 | " WARNING: The PCI BIOS assigned this PCI card to IRQ %d, which is unlikely to work!.\n" |
331 | "to work!.\n" | 331 | " You should use the PCI BIOS setup to assign a valid IRQ line.\n", |
332 | KERN_WARNING " You should use the PCI BIOS " | ||
333 | "setup to assign a valid IRQ line.\n", | ||
334 | pci_irq_line ); | 332 | pci_irq_line ); |
335 | 333 | ||
336 | /* avoiding re-enable dual adapters */ | 334 | /* avoiding re-enable dual adapters */ |
diff --git a/drivers/net/wireless/ath/Kconfig b/drivers/net/wireless/ath/Kconfig index d26e7b485315..eb0337c49546 100644 --- a/drivers/net/wireless/ath/Kconfig +++ b/drivers/net/wireless/ath/Kconfig | |||
@@ -1,5 +1,6 @@ | |||
1 | config ATH_COMMON | 1 | config ATH_COMMON |
2 | tristate "Atheros Wireless Cards" | 2 | tristate "Atheros Wireless Cards" |
3 | depends on WLAN_80211 | ||
3 | depends on ATH5K || ATH9K || AR9170_USB | 4 | depends on ATH5K || ATH9K || AR9170_USB |
4 | 5 | ||
5 | source "drivers/net/wireless/ath/ath5k/Kconfig" | 6 | source "drivers/net/wireless/ath/ath5k/Kconfig" |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index b61a071788a5..4ccf48e396df 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -355,7 +355,14 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
355 | } | 355 | } |
356 | 356 | ||
357 | if (bf_next == NULL) { | 357 | if (bf_next == NULL) { |
358 | INIT_LIST_HEAD(&bf_head); | 358 | /* |
359 | * Make sure the last desc is reclaimed if it | ||
360 | * not a holding desc. | ||
361 | */ | ||
362 | if (!bf_last->bf_stale) | ||
363 | list_move_tail(&bf->list, &bf_head); | ||
364 | else | ||
365 | INIT_LIST_HEAD(&bf_head); | ||
359 | } else { | 366 | } else { |
360 | ASSERT(!list_empty(bf_q)); | 367 | ASSERT(!list_empty(bf_q)); |
361 | list_move_tail(&bf->list, &bf_head); | 368 | list_move_tail(&bf->list, &bf_head); |
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index f580c2812d91..40448067e4cc 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -648,6 +648,7 @@ struct b43_wl { | |||
648 | u8 nr_devs; | 648 | u8 nr_devs; |
649 | 649 | ||
650 | bool radiotap_enabled; | 650 | bool radiotap_enabled; |
651 | bool radio_enabled; | ||
651 | 652 | ||
652 | /* The beacon we are currently using (AP or IBSS mode). | 653 | /* The beacon we are currently using (AP or IBSS mode). |
653 | * This beacon stuff is protected by the irq_lock. */ | 654 | * This beacon stuff is protected by the irq_lock. */ |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 6456afebdba1..e71c8d9cd706 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -3497,8 +3497,8 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed) | |||
3497 | if (phy->ops->set_rx_antenna) | 3497 | if (phy->ops->set_rx_antenna) |
3498 | phy->ops->set_rx_antenna(dev, antenna); | 3498 | phy->ops->set_rx_antenna(dev, antenna); |
3499 | 3499 | ||
3500 | if (!!conf->radio_enabled != phy->radio_on) { | 3500 | if (wl->radio_enabled != phy->radio_on) { |
3501 | if (conf->radio_enabled) { | 3501 | if (wl->radio_enabled) { |
3502 | b43_software_rfkill(dev, false); | 3502 | b43_software_rfkill(dev, false); |
3503 | b43info(dev->wl, "Radio turned on by software\n"); | 3503 | b43info(dev->wl, "Radio turned on by software\n"); |
3504 | if (!dev->radio_hw_enable) { | 3504 | if (!dev->radio_hw_enable) { |
@@ -4339,6 +4339,7 @@ static int b43_op_start(struct ieee80211_hw *hw) | |||
4339 | wl->beacon0_uploaded = 0; | 4339 | wl->beacon0_uploaded = 0; |
4340 | wl->beacon1_uploaded = 0; | 4340 | wl->beacon1_uploaded = 0; |
4341 | wl->beacon_templates_virgin = 1; | 4341 | wl->beacon_templates_virgin = 1; |
4342 | wl->radio_enabled = 1; | ||
4342 | 4343 | ||
4343 | mutex_lock(&wl->mutex); | 4344 | mutex_lock(&wl->mutex); |
4344 | 4345 | ||
@@ -4378,6 +4379,7 @@ static void b43_op_stop(struct ieee80211_hw *hw) | |||
4378 | if (b43_status(dev) >= B43_STAT_STARTED) | 4379 | if (b43_status(dev) >= B43_STAT_STARTED) |
4379 | b43_wireless_core_stop(dev); | 4380 | b43_wireless_core_stop(dev); |
4380 | b43_wireless_core_exit(dev); | 4381 | b43_wireless_core_exit(dev); |
4382 | wl->radio_enabled = 0; | ||
4381 | mutex_unlock(&wl->mutex); | 4383 | mutex_unlock(&wl->mutex); |
4382 | 4384 | ||
4383 | cancel_work_sync(&(wl->txpower_adjust_work)); | 4385 | cancel_work_sync(&(wl->txpower_adjust_work)); |
@@ -4560,6 +4562,7 @@ static int b43_wireless_core_attach(struct b43_wldev *dev) | |||
4560 | B43_WARN_ON(1); | 4562 | B43_WARN_ON(1); |
4561 | 4563 | ||
4562 | dev->phy.gmode = have_2ghz_phy; | 4564 | dev->phy.gmode = have_2ghz_phy; |
4565 | dev->phy.radio_on = 1; | ||
4563 | tmp = dev->phy.gmode ? B43_TMSLOW_GMODE : 0; | 4566 | tmp = dev->phy.gmode ? B43_TMSLOW_GMODE : 0; |
4564 | b43_wireless_core_reset(dev, tmp); | 4567 | b43_wireless_core_reset(dev, tmp); |
4565 | 4568 | ||
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index 3cfc30307a27..6c3a74964ab8 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
@@ -35,6 +35,7 @@ | |||
35 | 35 | ||
36 | static /*const */ struct pcmcia_device_id b43_pcmcia_tbl[] = { | 36 | static /*const */ struct pcmcia_device_id b43_pcmcia_tbl[] = { |
37 | PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448), | 37 | PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448), |
38 | PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x476), | ||
38 | PCMCIA_DEVICE_NULL, | 39 | PCMCIA_DEVICE_NULL, |
39 | }; | 40 | }; |
40 | 41 | ||
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h index 77fda148ac46..038baa8869e2 100644 --- a/drivers/net/wireless/b43legacy/b43legacy.h +++ b/drivers/net/wireless/b43legacy/b43legacy.h | |||
@@ -607,6 +607,7 @@ struct b43legacy_wl { | |||
607 | u8 nr_devs; | 607 | u8 nr_devs; |
608 | 608 | ||
609 | bool radiotap_enabled; | 609 | bool radiotap_enabled; |
610 | bool radio_enabled; | ||
610 | 611 | ||
611 | /* The beacon we are currently using (AP or IBSS mode). | 612 | /* The beacon we are currently using (AP or IBSS mode). |
612 | * This beacon stuff is protected by the irq_lock. */ | 613 | * This beacon stuff is protected by the irq_lock. */ |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index e5136fb65ddd..c4973c1942bf 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -2689,8 +2689,8 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw, | |||
2689 | /* Antennas for RX and management frame TX. */ | 2689 | /* Antennas for RX and management frame TX. */ |
2690 | b43legacy_mgmtframe_txantenna(dev, antenna_tx); | 2690 | b43legacy_mgmtframe_txantenna(dev, antenna_tx); |
2691 | 2691 | ||
2692 | if (!!conf->radio_enabled != phy->radio_on) { | 2692 | if (wl->radio_enabled != phy->radio_on) { |
2693 | if (conf->radio_enabled) { | 2693 | if (wl->radio_enabled) { |
2694 | b43legacy_radio_turn_on(dev); | 2694 | b43legacy_radio_turn_on(dev); |
2695 | b43legacyinfo(dev->wl, "Radio turned on by software\n"); | 2695 | b43legacyinfo(dev->wl, "Radio turned on by software\n"); |
2696 | if (!dev->radio_hw_enable) | 2696 | if (!dev->radio_hw_enable) |
@@ -3441,6 +3441,7 @@ static int b43legacy_op_start(struct ieee80211_hw *hw) | |||
3441 | wl->beacon0_uploaded = 0; | 3441 | wl->beacon0_uploaded = 0; |
3442 | wl->beacon1_uploaded = 0; | 3442 | wl->beacon1_uploaded = 0; |
3443 | wl->beacon_templates_virgin = 1; | 3443 | wl->beacon_templates_virgin = 1; |
3444 | wl->radio_enabled = 1; | ||
3444 | 3445 | ||
3445 | mutex_lock(&wl->mutex); | 3446 | mutex_lock(&wl->mutex); |
3446 | 3447 | ||
@@ -3479,6 +3480,7 @@ static void b43legacy_op_stop(struct ieee80211_hw *hw) | |||
3479 | if (b43legacy_status(dev) >= B43legacy_STAT_STARTED) | 3480 | if (b43legacy_status(dev) >= B43legacy_STAT_STARTED) |
3480 | b43legacy_wireless_core_stop(dev); | 3481 | b43legacy_wireless_core_stop(dev); |
3481 | b43legacy_wireless_core_exit(dev); | 3482 | b43legacy_wireless_core_exit(dev); |
3483 | wl->radio_enabled = 0; | ||
3482 | mutex_unlock(&wl->mutex); | 3484 | mutex_unlock(&wl->mutex); |
3483 | } | 3485 | } |
3484 | 3486 | ||
@@ -3620,6 +3622,7 @@ static int b43legacy_wireless_core_attach(struct b43legacy_wldev *dev) | |||
3620 | have_bphy = 1; | 3622 | have_bphy = 1; |
3621 | 3623 | ||
3622 | dev->phy.gmode = (have_gphy || have_bphy); | 3624 | dev->phy.gmode = (have_gphy || have_bphy); |
3625 | dev->phy.radio_on = 1; | ||
3623 | tmp = dev->phy.gmode ? B43legacy_TMSLOW_GMODE : 0; | 3626 | tmp = dev->phy.gmode ? B43legacy_TMSLOW_GMODE : 0; |
3624 | b43legacy_wireless_core_reset(dev, tmp); | 3627 | b43legacy_wireless_core_reset(dev, tmp); |
3625 | 3628 | ||
diff --git a/drivers/net/wireless/iwmc3200wifi/Kconfig b/drivers/net/wireless/iwmc3200wifi/Kconfig index 1eccb6df46dd..030401d367d3 100644 --- a/drivers/net/wireless/iwmc3200wifi/Kconfig +++ b/drivers/net/wireless/iwmc3200wifi/Kconfig | |||
@@ -4,6 +4,15 @@ config IWM | |||
4 | depends on CFG80211 | 4 | depends on CFG80211 |
5 | select WIRELESS_EXT | 5 | select WIRELESS_EXT |
6 | select FW_LOADER | 6 | select FW_LOADER |
7 | help | ||
8 | The Intel Wireless Multicomm 3200 hardware is a combo | ||
9 | card with GPS, Bluetooth, WiMax and 802.11 radios. It | ||
10 | runs over SDIO and is typically found on Moorestown | ||
11 | based platform. This driver takes care of the 802.11 | ||
12 | part, which is a fullmac one. | ||
13 | |||
14 | If you choose to build it as a module, it'll be called | ||
15 | iwmc3200wifi.ko. | ||
7 | 16 | ||
8 | config IWM_DEBUG | 17 | config IWM_DEBUG |
9 | bool "Enable full debugging output in iwmc3200wifi" | 18 | bool "Enable full debugging output in iwmc3200wifi" |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index e789c6e9938c..a111bda392e2 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -418,6 +418,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw, | |||
418 | continue; | 418 | continue; |
419 | 419 | ||
420 | if (!data2->started || !hwsim_ps_rx_ok(data2, skb) || | 420 | if (!data2->started || !hwsim_ps_rx_ok(data2, skb) || |
421 | !data->channel || !data2->channel || | ||
421 | data->channel->center_freq != data2->channel->center_freq || | 422 | data->channel->center_freq != data2->channel->center_freq || |
422 | !(data->group & data2->group)) | 423 | !(data->group & data2->group)) |
423 | continue; | 424 | continue; |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index 345593c4accb..a370e510f19f 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -2521,6 +2521,8 @@ static const struct net_device_ops orinoco_netdev_ops = { | |||
2521 | .ndo_start_xmit = orinoco_xmit, | 2521 | .ndo_start_xmit = orinoco_xmit, |
2522 | .ndo_set_multicast_list = orinoco_set_multicast_list, | 2522 | .ndo_set_multicast_list = orinoco_set_multicast_list, |
2523 | .ndo_change_mtu = orinoco_change_mtu, | 2523 | .ndo_change_mtu = orinoco_change_mtu, |
2524 | .ndo_set_mac_address = eth_mac_addr, | ||
2525 | .ndo_validate_addr = eth_validate_addr, | ||
2524 | .ndo_tx_timeout = orinoco_tx_timeout, | 2526 | .ndo_tx_timeout = orinoco_tx_timeout, |
2525 | .ndo_get_stats = orinoco_get_stats, | 2527 | .ndo_get_stats = orinoco_get_stats, |
2526 | }; | 2528 | }; |
@@ -2555,7 +2557,6 @@ struct net_device | |||
2555 | priv->wireless_data.spy_data = &priv->spy_data; | 2557 | priv->wireless_data.spy_data = &priv->spy_data; |
2556 | dev->wireless_data = &priv->wireless_data; | 2558 | dev->wireless_data = &priv->wireless_data; |
2557 | #endif | 2559 | #endif |
2558 | /* we use the default eth_mac_addr for setting the MAC addr */ | ||
2559 | 2560 | ||
2560 | /* Reserve space in skb for the SNAP header */ | 2561 | /* Reserve space in skb for the SNAP header */ |
2561 | dev->hard_header_len += ENCAPS_OVERHEAD; | 2562 | dev->hard_header_len += ENCAPS_OVERHEAD; |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index b618bd14583f..22ca122bd798 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -823,30 +823,30 @@ void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
823 | struct p54_tx_info *range; | 823 | struct p54_tx_info *range; |
824 | unsigned long flags; | 824 | unsigned long flags; |
825 | 825 | ||
826 | if (unlikely(!skb || !dev || skb_queue_empty(&priv->tx_queue))) | 826 | if (unlikely(!skb || !dev || !skb_queue_len(&priv->tx_queue))) |
827 | return; | 827 | return; |
828 | 828 | ||
829 | /* There used to be a check here to see if the SKB was on the | 829 | /* |
830 | * TX queue or not. This can never happen because all SKBs we | 830 | * don't try to free an already unlinked skb |
831 | * see here successfully went through p54_assign_address() | ||
832 | * which means the SKB is on the ->tx_queue. | ||
833 | */ | 831 | */ |
832 | if (unlikely((!skb->next) || (!skb->prev))) | ||
833 | return; | ||
834 | 834 | ||
835 | spin_lock_irqsave(&priv->tx_queue.lock, flags); | 835 | spin_lock_irqsave(&priv->tx_queue.lock, flags); |
836 | info = IEEE80211_SKB_CB(skb); | 836 | info = IEEE80211_SKB_CB(skb); |
837 | range = (void *)info->rate_driver_data; | 837 | range = (void *)info->rate_driver_data; |
838 | if (!skb_queue_is_first(&priv->tx_queue, skb)) { | 838 | if (skb->prev != (struct sk_buff *)&priv->tx_queue) { |
839 | struct ieee80211_tx_info *ni; | 839 | struct ieee80211_tx_info *ni; |
840 | struct p54_tx_info *mr; | 840 | struct p54_tx_info *mr; |
841 | 841 | ||
842 | ni = IEEE80211_SKB_CB(skb_queue_prev(&priv->tx_queue, skb)); | 842 | ni = IEEE80211_SKB_CB(skb->prev); |
843 | mr = (struct p54_tx_info *)ni->rate_driver_data; | 843 | mr = (struct p54_tx_info *)ni->rate_driver_data; |
844 | } | 844 | } |
845 | if (!skb_queue_is_last(&priv->tx_queue, skb)) { | 845 | if (skb->next != (struct sk_buff *)&priv->tx_queue) { |
846 | struct ieee80211_tx_info *ni; | 846 | struct ieee80211_tx_info *ni; |
847 | struct p54_tx_info *mr; | 847 | struct p54_tx_info *mr; |
848 | 848 | ||
849 | ni = IEEE80211_SKB_CB(skb_queue_next(&priv->tx_queue, skb)); | 849 | ni = IEEE80211_SKB_CB(skb->next); |
850 | mr = (struct p54_tx_info *)ni->rate_driver_data; | 850 | mr = (struct p54_tx_info *)ni->rate_driver_data; |
851 | } | 851 | } |
852 | __skb_unlink(skb, &priv->tx_queue); | 852 | __skb_unlink(skb, &priv->tx_queue); |
@@ -864,13 +864,15 @@ static struct sk_buff *p54_find_tx_entry(struct ieee80211_hw *dev, | |||
864 | unsigned long flags; | 864 | unsigned long flags; |
865 | 865 | ||
866 | spin_lock_irqsave(&priv->tx_queue.lock, flags); | 866 | spin_lock_irqsave(&priv->tx_queue.lock, flags); |
867 | skb_queue_walk(&priv->tx_queue, entry) { | 867 | entry = priv->tx_queue.next; |
868 | while (entry != (struct sk_buff *)&priv->tx_queue) { | ||
868 | struct p54_hdr *hdr = (struct p54_hdr *) entry->data; | 869 | struct p54_hdr *hdr = (struct p54_hdr *) entry->data; |
869 | 870 | ||
870 | if (hdr->req_id == req_id) { | 871 | if (hdr->req_id == req_id) { |
871 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | 872 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); |
872 | return entry; | 873 | return entry; |
873 | } | 874 | } |
875 | entry = entry->next; | ||
874 | } | 876 | } |
875 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | 877 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); |
876 | return NULL; | 878 | return NULL; |
@@ -888,33 +890,36 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
888 | int count, idx; | 890 | int count, idx; |
889 | 891 | ||
890 | spin_lock_irqsave(&priv->tx_queue.lock, flags); | 892 | spin_lock_irqsave(&priv->tx_queue.lock, flags); |
891 | skb_queue_walk(&priv->tx_queue, entry) { | 893 | entry = (struct sk_buff *) priv->tx_queue.next; |
894 | while (entry != (struct sk_buff *)&priv->tx_queue) { | ||
892 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry); | 895 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry); |
893 | struct p54_hdr *entry_hdr; | 896 | struct p54_hdr *entry_hdr; |
894 | struct p54_tx_data *entry_data; | 897 | struct p54_tx_data *entry_data; |
895 | unsigned int pad = 0, frame_len; | 898 | unsigned int pad = 0, frame_len; |
896 | 899 | ||
897 | range = (void *)info->rate_driver_data; | 900 | range = (void *)info->rate_driver_data; |
898 | if (range->start_addr != addr) | 901 | if (range->start_addr != addr) { |
902 | entry = entry->next; | ||
899 | continue; | 903 | continue; |
904 | } | ||
900 | 905 | ||
901 | if (!skb_queue_is_last(&priv->tx_queue, entry)) { | 906 | if (entry->next != (struct sk_buff *)&priv->tx_queue) { |
902 | struct ieee80211_tx_info *ni; | 907 | struct ieee80211_tx_info *ni; |
903 | struct p54_tx_info *mr; | 908 | struct p54_tx_info *mr; |
904 | 909 | ||
905 | ni = IEEE80211_SKB_CB(skb_queue_next(&priv->tx_queue, | 910 | ni = IEEE80211_SKB_CB(entry->next); |
906 | entry)); | ||
907 | mr = (struct p54_tx_info *)ni->rate_driver_data; | 911 | mr = (struct p54_tx_info *)ni->rate_driver_data; |
908 | } | 912 | } |
909 | 913 | ||
910 | __skb_unlink(entry, &priv->tx_queue); | 914 | __skb_unlink(entry, &priv->tx_queue); |
911 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | ||
912 | 915 | ||
913 | frame_len = entry->len; | 916 | frame_len = entry->len; |
914 | entry_hdr = (struct p54_hdr *) entry->data; | 917 | entry_hdr = (struct p54_hdr *) entry->data; |
915 | entry_data = (struct p54_tx_data *) entry_hdr->data; | 918 | entry_data = (struct p54_tx_data *) entry_hdr->data; |
916 | priv->tx_stats[entry_data->hw_queue].len--; | 919 | if (priv->tx_stats[entry_data->hw_queue].len) |
920 | priv->tx_stats[entry_data->hw_queue].len--; | ||
917 | priv->stats.dot11ACKFailureCount += payload->tries - 1; | 921 | priv->stats.dot11ACKFailureCount += payload->tries - 1; |
922 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | ||
918 | 923 | ||
919 | /* | 924 | /* |
920 | * Frames in P54_QUEUE_FWSCAN and P54_QUEUE_BEACON are | 925 | * Frames in P54_QUEUE_FWSCAN and P54_QUEUE_BEACON are |
@@ -1164,21 +1169,23 @@ static int p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
1164 | } | 1169 | } |
1165 | } | 1170 | } |
1166 | 1171 | ||
1167 | skb_queue_walk(&priv->tx_queue, entry) { | 1172 | entry = priv->tx_queue.next; |
1173 | while (left--) { | ||
1168 | u32 hole_size; | 1174 | u32 hole_size; |
1169 | info = IEEE80211_SKB_CB(entry); | 1175 | info = IEEE80211_SKB_CB(entry); |
1170 | range = (void *)info->rate_driver_data; | 1176 | range = (void *)info->rate_driver_data; |
1171 | hole_size = range->start_addr - last_addr; | 1177 | hole_size = range->start_addr - last_addr; |
1172 | if (!target_skb && hole_size >= len) { | 1178 | if (!target_skb && hole_size >= len) { |
1173 | target_skb = skb_queue_prev(&priv->tx_queue, entry); | 1179 | target_skb = entry->prev; |
1174 | hole_size -= len; | 1180 | hole_size -= len; |
1175 | target_addr = last_addr; | 1181 | target_addr = last_addr; |
1176 | } | 1182 | } |
1177 | largest_hole = max(largest_hole, hole_size); | 1183 | largest_hole = max(largest_hole, hole_size); |
1178 | last_addr = range->end_addr; | 1184 | last_addr = range->end_addr; |
1185 | entry = entry->next; | ||
1179 | } | 1186 | } |
1180 | if (!target_skb && priv->rx_end - last_addr >= len) { | 1187 | if (!target_skb && priv->rx_end - last_addr >= len) { |
1181 | target_skb = skb_peek_tail(&priv->tx_queue); | 1188 | target_skb = priv->tx_queue.prev; |
1182 | largest_hole = max(largest_hole, priv->rx_end - last_addr - len); | 1189 | largest_hole = max(largest_hole, priv->rx_end - last_addr - len); |
1183 | if (!skb_queue_empty(&priv->tx_queue)) { | 1190 | if (!skb_queue_empty(&priv->tx_queue)) { |
1184 | info = IEEE80211_SKB_CB(target_skb); | 1191 | info = IEEE80211_SKB_CB(target_skb); |
@@ -2084,6 +2091,7 @@ out: | |||
2084 | static void p54_stop(struct ieee80211_hw *dev) | 2091 | static void p54_stop(struct ieee80211_hw *dev) |
2085 | { | 2092 | { |
2086 | struct p54_common *priv = dev->priv; | 2093 | struct p54_common *priv = dev->priv; |
2094 | struct sk_buff *skb; | ||
2087 | 2095 | ||
2088 | mutex_lock(&priv->conf_mutex); | 2096 | mutex_lock(&priv->conf_mutex); |
2089 | priv->mode = NL80211_IFTYPE_UNSPECIFIED; | 2097 | priv->mode = NL80211_IFTYPE_UNSPECIFIED; |
@@ -2098,7 +2106,8 @@ static void p54_stop(struct ieee80211_hw *dev) | |||
2098 | p54_tx_cancel(dev, priv->cached_beacon); | 2106 | p54_tx_cancel(dev, priv->cached_beacon); |
2099 | 2107 | ||
2100 | priv->stop(dev); | 2108 | priv->stop(dev); |
2101 | skb_queue_purge(&priv->tx_queue); | 2109 | while ((skb = skb_dequeue(&priv->tx_queue))) |
2110 | kfree_skb(skb); | ||
2102 | priv->cached_beacon = NULL; | 2111 | priv->cached_beacon = NULL; |
2103 | priv->tsf_high32 = priv->tsf_low32 = 0; | 2112 | priv->tsf_high32 = priv->tsf_low32 = 0; |
2104 | mutex_unlock(&priv->conf_mutex); | 2113 | mutex_unlock(&priv->conf_mutex); |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index b10b0383dfa5..698b11b1cadb 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -2427,11 +2427,10 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len) | |||
2427 | 2427 | ||
2428 | #ifdef PCMCIA_DEBUG | 2428 | #ifdef PCMCIA_DEBUG |
2429 | if (pc_debug > 3) { | 2429 | if (pc_debug > 3) { |
2430 | int i; | 2430 | print_hex_dump(KERN_DEBUG, "skb->data before untranslate: ", |
2431 | printk(KERN_DEBUG "skb->data before untranslate"); | 2431 | DUMP_PREFIX_NONE, 16, 1, |
2432 | for (i = 0; i < 64; i++) | 2432 | skb->data, 64, true); |
2433 | printk("%02x ", skb->data[i]); | 2433 | printk(KERN_DEBUG |
2434 | printk("\n" KERN_DEBUG | ||
2435 | "type = %08x, xsap = %02x%02x%02x, org = %02x02x02x\n", | 2434 | "type = %08x, xsap = %02x%02x%02x, org = %02x02x02x\n", |
2436 | ntohs(type), psnap->dsap, psnap->ssap, psnap->ctrl, | 2435 | ntohs(type), psnap->dsap, psnap->ssap, psnap->ctrl, |
2437 | psnap->org[0], psnap->org[1], psnap->org[2]); | 2436 | psnap->org[0], psnap->org[1], psnap->org[2]); |
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 6af706408ac0..c6d300666ad8 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -3556,17 +3556,8 @@ wv_82593_config(struct net_device * dev) | |||
3556 | cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */ | 3556 | cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */ |
3557 | 3557 | ||
3558 | #ifdef DEBUG_I82593_SHOW | 3558 | #ifdef DEBUG_I82593_SHOW |
3559 | { | 3559 | print_hex_dump(KERN_DEBUG, "wavelan_cs: config block: ", DUMP_PREFIX_NONE, |
3560 | u_char *c = (u_char *) &cfblk; | 3560 | 16, 1, &cfblk, sizeof(struct i82593_conf_block), false); |
3561 | int i; | ||
3562 | printk(KERN_DEBUG "wavelan_cs: config block:"); | ||
3563 | for(i = 0; i < sizeof(struct i82593_conf_block); i++,c++) | ||
3564 | { | ||
3565 | if((i % 16) == 0) printk("\n" KERN_DEBUG); | ||
3566 | printk("%02x ", *c); | ||
3567 | } | ||
3568 | printk("\n"); | ||
3569 | } | ||
3570 | #endif | 3561 | #endif |
3571 | 3562 | ||
3572 | /* Copy the config block to the i82593 */ | 3563 | /* Copy the config block to the i82593 */ |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 14a19baff214..0e6e44689cc6 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -38,7 +38,6 @@ static struct usb_device_id usb_ids[] = { | |||
38 | /* ZD1211 */ | 38 | /* ZD1211 */ |
39 | { USB_DEVICE(0x0ace, 0x1211), .driver_info = DEVICE_ZD1211 }, | 39 | { USB_DEVICE(0x0ace, 0x1211), .driver_info = DEVICE_ZD1211 }, |
40 | { USB_DEVICE(0x0ace, 0xa211), .driver_info = DEVICE_ZD1211 }, | 40 | { USB_DEVICE(0x0ace, 0xa211), .driver_info = DEVICE_ZD1211 }, |
41 | { USB_DEVICE(0x07b8, 0x6001), .driver_info = DEVICE_ZD1211 }, | ||
42 | { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 }, | 41 | { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 }, |
43 | { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 }, | 42 | { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 }, |
44 | { USB_DEVICE(0x0df6, 0x9071), .driver_info = DEVICE_ZD1211 }, | 43 | { USB_DEVICE(0x0df6, 0x9071), .driver_info = DEVICE_ZD1211 }, |
@@ -61,6 +60,7 @@ static struct usb_device_id usb_ids[] = { | |||
61 | { USB_DEVICE(0x157e, 0x300a), .driver_info = DEVICE_ZD1211 }, | 60 | { USB_DEVICE(0x157e, 0x300a), .driver_info = DEVICE_ZD1211 }, |
62 | { USB_DEVICE(0x0105, 0x145f), .driver_info = DEVICE_ZD1211 }, | 61 | { USB_DEVICE(0x0105, 0x145f), .driver_info = DEVICE_ZD1211 }, |
63 | /* ZD1211B */ | 62 | /* ZD1211B */ |
63 | { USB_DEVICE(0x054c, 0x0257), .driver_info = DEVICE_ZD1211B }, | ||
64 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, | 64 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, |
65 | { USB_DEVICE(0x0ace, 0xb215), .driver_info = DEVICE_ZD1211B }, | 65 | { USB_DEVICE(0x0ace, 0xb215), .driver_info = DEVICE_ZD1211B }, |
66 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, | 66 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, |
@@ -87,6 +87,7 @@ static struct usb_device_id usb_ids[] = { | |||
87 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, | 87 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, |
88 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, | 88 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, |
89 | { USB_DEVICE(0x0df6, 0x0036), .driver_info = DEVICE_ZD1211B }, | 89 | { USB_DEVICE(0x0df6, 0x0036), .driver_info = DEVICE_ZD1211B }, |
90 | { USB_DEVICE(0x07b8, 0x6001), .driver_info = DEVICE_ZD1211B }, | ||
90 | /* "Driverless" devices that need ejecting */ | 91 | /* "Driverless" devices that need ejecting */ |
91 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, | 92 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, |
92 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, | 93 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, |
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index 3c7a5053f1da..a07580138e81 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
@@ -109,7 +109,7 @@ static int gx_fix; | |||
109 | /* These identify the driver base version and may not be removed. */ | 109 | /* These identify the driver base version and may not be removed. */ |
110 | static const char version[] __devinitconst = | 110 | static const char version[] __devinitconst = |
111 | KERN_INFO DRV_NAME ".c:v1.05 1/09/2001 Written by Donald Becker <becker@scyld.com>\n" | 111 | KERN_INFO DRV_NAME ".c:v1.05 1/09/2001 Written by Donald Becker <becker@scyld.com>\n" |
112 | KERN_INFO " (unofficial 2.4.x port, " DRV_VERSION ", " DRV_RELDATE ")\n"; | 112 | " (unofficial 2.4.x port, " DRV_VERSION ", " DRV_RELDATE ")\n"; |
113 | 113 | ||
114 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); | 114 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); |
115 | MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver"); | 115 | MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver"); |
@@ -700,12 +700,15 @@ static void yellowfin_tx_timeout(struct net_device *dev) | |||
700 | int i; | 700 | int i; |
701 | printk(KERN_WARNING " Rx ring %p: ", yp->rx_ring); | 701 | printk(KERN_WARNING " Rx ring %p: ", yp->rx_ring); |
702 | for (i = 0; i < RX_RING_SIZE; i++) | 702 | for (i = 0; i < RX_RING_SIZE; i++) |
703 | printk(" %8.8x", yp->rx_ring[i].result_status); | 703 | printk(KERN_CONT " %8.8x", |
704 | printk("\n"KERN_WARNING" Tx ring %p: ", yp->tx_ring); | 704 | yp->rx_ring[i].result_status); |
705 | printk(KERN_CONT "\n"); | ||
706 | printk(KERN_WARNING" Tx ring %p: ", yp->tx_ring); | ||
705 | for (i = 0; i < TX_RING_SIZE; i++) | 707 | for (i = 0; i < TX_RING_SIZE; i++) |
706 | printk(" %4.4x /%8.8x", yp->tx_status[i].tx_errs, | 708 | printk(KERN_CONT " %4.4x /%8.8x", |
707 | yp->tx_ring[i].result_status); | 709 | yp->tx_status[i].tx_errs, |
708 | printk("\n"); | 710 | yp->tx_ring[i].result_status); |
711 | printk(KERN_CONT "\n"); | ||
709 | } | 712 | } |
710 | 713 | ||
711 | /* If the hardware is found to hang regularly, we will update the code | 714 | /* If the hardware is found to hang regularly, we will update the code |
@@ -1216,20 +1219,20 @@ static int yellowfin_close(struct net_device *dev) | |||
1216 | 1219 | ||
1217 | #if defined(__i386__) | 1220 | #if defined(__i386__) |
1218 | if (yellowfin_debug > 2) { | 1221 | if (yellowfin_debug > 2) { |
1219 | printk("\n"KERN_DEBUG" Tx ring at %8.8llx:\n", | 1222 | printk(KERN_DEBUG" Tx ring at %8.8llx:\n", |
1220 | (unsigned long long)yp->tx_ring_dma); | 1223 | (unsigned long long)yp->tx_ring_dma); |
1221 | for (i = 0; i < TX_RING_SIZE*2; i++) | 1224 | for (i = 0; i < TX_RING_SIZE*2; i++) |
1222 | printk(" %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n", | 1225 | printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n", |
1223 | ioread32(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ', | 1226 | ioread32(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ', |
1224 | i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr, | 1227 | i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr, |
1225 | yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status); | 1228 | yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status); |
1226 | printk(KERN_DEBUG " Tx status %p:\n", yp->tx_status); | 1229 | printk(KERN_DEBUG " Tx status %p:\n", yp->tx_status); |
1227 | for (i = 0; i < TX_RING_SIZE; i++) | 1230 | for (i = 0; i < TX_RING_SIZE; i++) |
1228 | printk(" #%d status %4.4x %4.4x %4.4x %4.4x.\n", | 1231 | printk(KERN_DEBUG " #%d status %4.4x %4.4x %4.4x %4.4x.\n", |
1229 | i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs, | 1232 | i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs, |
1230 | yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused); | 1233 | yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused); |
1231 | 1234 | ||
1232 | printk("\n"KERN_DEBUG " Rx ring %8.8llx:\n", | 1235 | printk(KERN_DEBUG " Rx ring %8.8llx:\n", |
1233 | (unsigned long long)yp->rx_ring_dma); | 1236 | (unsigned long long)yp->rx_ring_dma); |
1234 | for (i = 0; i < RX_RING_SIZE; i++) { | 1237 | for (i = 0; i < RX_RING_SIZE; i++) { |
1235 | printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n", | 1238 | printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n", |