diff options
Diffstat (limited to 'drivers/net')
152 files changed, 775 insertions, 601 deletions
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 0a4fc62a381d..c998e1afebc6 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c | |||
@@ -978,7 +978,7 @@ static void cfhsi_setup(struct net_device *dev) | |||
978 | dev->netdev_ops = &cfhsi_ops; | 978 | dev->netdev_ops = &cfhsi_ops; |
979 | dev->type = ARPHRD_CAIF; | 979 | dev->type = ARPHRD_CAIF; |
980 | dev->flags = IFF_POINTOPOINT | IFF_NOARP; | 980 | dev->flags = IFF_POINTOPOINT | IFF_NOARP; |
981 | dev->mtu = CFHSI_MAX_PAYLOAD_SZ; | 981 | dev->mtu = CFHSI_MAX_CAIF_FRAME_SZ; |
982 | dev->tx_queue_len = 0; | 982 | dev->tx_queue_len = 0; |
983 | dev->destructor = free_netdev; | 983 | dev->destructor = free_netdev; |
984 | skb_queue_head_init(&cfhsi->qhead); | 984 | skb_queue_head_init(&cfhsi->qhead); |
diff --git a/drivers/net/can/cc770/cc770.c b/drivers/net/can/cc770/cc770.c index 766896747643..c30f0e6f1048 100644 --- a/drivers/net/can/cc770/cc770.c +++ b/drivers/net/can/cc770/cc770.c | |||
@@ -440,12 +440,14 @@ static netdev_tx_t cc770_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
440 | for (i = 0; i < dlc; i++) | 440 | for (i = 0; i < dlc; i++) |
441 | cc770_write_reg(priv, msgobj[mo].data[i], cf->data[i]); | 441 | cc770_write_reg(priv, msgobj[mo].data[i], cf->data[i]); |
442 | 442 | ||
443 | /* Store echo skb before starting the transfer */ | ||
444 | can_put_echo_skb(skb, dev, 0); | ||
445 | |||
443 | cc770_write_reg(priv, msgobj[mo].ctrl1, | 446 | cc770_write_reg(priv, msgobj[mo].ctrl1, |
444 | RMTPND_RES | TXRQST_SET | CPUUPD_RES | NEWDAT_UNC); | 447 | RMTPND_RES | TXRQST_SET | CPUUPD_RES | NEWDAT_UNC); |
445 | 448 | ||
446 | stats->tx_bytes += dlc; | 449 | stats->tx_bytes += dlc; |
447 | 450 | ||
448 | can_put_echo_skb(skb, dev, 0); | ||
449 | 451 | ||
450 | /* | 452 | /* |
451 | * HM: We had some cases of repeated IRQs so make sure the | 453 | * HM: We had some cases of repeated IRQs so make sure the |
diff --git a/drivers/net/can/cc770/cc770_isa.c b/drivers/net/can/cc770/cc770_isa.c index 4be5fe2c40a5..9f3a25ccd665 100644 --- a/drivers/net/can/cc770/cc770_isa.c +++ b/drivers/net/can/cc770/cc770_isa.c | |||
@@ -110,6 +110,11 @@ MODULE_PARM_DESC(bcr, "Bus configuration register (default=0x40 [CBY])"); | |||
110 | #define CC770_IOSIZE 0x20 | 110 | #define CC770_IOSIZE 0x20 |
111 | #define CC770_IOSIZE_INDIRECT 0x02 | 111 | #define CC770_IOSIZE_INDIRECT 0x02 |
112 | 112 | ||
113 | /* Spinlock for cc770_isa_port_write_reg_indirect | ||
114 | * and cc770_isa_port_read_reg_indirect | ||
115 | */ | ||
116 | static DEFINE_SPINLOCK(cc770_isa_port_lock); | ||
117 | |||
113 | static struct platform_device *cc770_isa_devs[MAXDEV]; | 118 | static struct platform_device *cc770_isa_devs[MAXDEV]; |
114 | 119 | ||
115 | static u8 cc770_isa_mem_read_reg(const struct cc770_priv *priv, int reg) | 120 | static u8 cc770_isa_mem_read_reg(const struct cc770_priv *priv, int reg) |
@@ -138,18 +143,27 @@ static u8 cc770_isa_port_read_reg_indirect(const struct cc770_priv *priv, | |||
138 | int reg) | 143 | int reg) |
139 | { | 144 | { |
140 | unsigned long base = (unsigned long)priv->reg_base; | 145 | unsigned long base = (unsigned long)priv->reg_base; |
146 | unsigned long flags; | ||
147 | u8 val; | ||
141 | 148 | ||
149 | spin_lock_irqsave(&cc770_isa_port_lock, flags); | ||
142 | outb(reg, base); | 150 | outb(reg, base); |
143 | return inb(base + 1); | 151 | val = inb(base + 1); |
152 | spin_unlock_irqrestore(&cc770_isa_port_lock, flags); | ||
153 | |||
154 | return val; | ||
144 | } | 155 | } |
145 | 156 | ||
146 | static void cc770_isa_port_write_reg_indirect(const struct cc770_priv *priv, | 157 | static void cc770_isa_port_write_reg_indirect(const struct cc770_priv *priv, |
147 | int reg, u8 val) | 158 | int reg, u8 val) |
148 | { | 159 | { |
149 | unsigned long base = (unsigned long)priv->reg_base; | 160 | unsigned long base = (unsigned long)priv->reg_base; |
161 | unsigned long flags; | ||
150 | 162 | ||
163 | spin_lock_irqsave(&cc770_isa_port_lock, flags); | ||
151 | outb(reg, base); | 164 | outb(reg, base); |
152 | outb(val, base + 1); | 165 | outb(val, base + 1); |
166 | spin_unlock_irqrestore(&cc770_isa_port_lock, flags); | ||
153 | } | 167 | } |
154 | 168 | ||
155 | static int __devinit cc770_isa_probe(struct platform_device *pdev) | 169 | static int __devinit cc770_isa_probe(struct platform_device *pdev) |
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 7fd8089946fb..96d235799ec1 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -118,6 +118,9 @@ | |||
118 | (FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | FLEXCAN_ESR_BOFF_INT) | 118 | (FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | FLEXCAN_ESR_BOFF_INT) |
119 | #define FLEXCAN_ESR_ERR_ALL \ | 119 | #define FLEXCAN_ESR_ERR_ALL \ |
120 | (FLEXCAN_ESR_ERR_BUS | FLEXCAN_ESR_ERR_STATE) | 120 | (FLEXCAN_ESR_ERR_BUS | FLEXCAN_ESR_ERR_STATE) |
121 | #define FLEXCAN_ESR_ALL_INT \ | ||
122 | (FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | \ | ||
123 | FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT) | ||
121 | 124 | ||
122 | /* FLEXCAN interrupt flag register (IFLAG) bits */ | 125 | /* FLEXCAN interrupt flag register (IFLAG) bits */ |
123 | #define FLEXCAN_TX_BUF_ID 8 | 126 | #define FLEXCAN_TX_BUF_ID 8 |
@@ -577,7 +580,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id) | |||
577 | 580 | ||
578 | reg_iflag1 = flexcan_read(®s->iflag1); | 581 | reg_iflag1 = flexcan_read(®s->iflag1); |
579 | reg_esr = flexcan_read(®s->esr); | 582 | reg_esr = flexcan_read(®s->esr); |
580 | flexcan_write(FLEXCAN_ESR_ERR_INT, ®s->esr); /* ACK err IRQ */ | 583 | /* ACK all bus error and state change IRQ sources */ |
584 | if (reg_esr & FLEXCAN_ESR_ALL_INT) | ||
585 | flexcan_write(reg_esr & FLEXCAN_ESR_ALL_INT, ®s->esr); | ||
581 | 586 | ||
582 | /* | 587 | /* |
583 | * schedule NAPI in case of: | 588 | * schedule NAPI in case of: |
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c index d11fbb2b95ff..6edc25e0dd15 100644 --- a/drivers/net/can/pch_can.c +++ b/drivers/net/can/pch_can.c | |||
@@ -66,6 +66,7 @@ | |||
66 | #define PCH_IF_CREQ_BUSY BIT(15) | 66 | #define PCH_IF_CREQ_BUSY BIT(15) |
67 | 67 | ||
68 | #define PCH_STATUS_INT 0x8000 | 68 | #define PCH_STATUS_INT 0x8000 |
69 | #define PCH_RP 0x00008000 | ||
69 | #define PCH_REC 0x00007f00 | 70 | #define PCH_REC 0x00007f00 |
70 | #define PCH_TEC 0x000000ff | 71 | #define PCH_TEC 0x000000ff |
71 | 72 | ||
@@ -527,7 +528,7 @@ static void pch_can_error(struct net_device *ndev, u32 status) | |||
527 | priv->can.can_stats.error_passive++; | 528 | priv->can.can_stats.error_passive++; |
528 | state = CAN_STATE_ERROR_PASSIVE; | 529 | state = CAN_STATE_ERROR_PASSIVE; |
529 | cf->can_id |= CAN_ERR_CRTL; | 530 | cf->can_id |= CAN_ERR_CRTL; |
530 | if (((errc & PCH_REC) >> 8) > 127) | 531 | if (errc & PCH_RP) |
531 | cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE; | 532 | cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE; |
532 | if ((errc & PCH_TEC) > 127) | 533 | if ((errc & PCH_TEC) > 127) |
533 | cf->data[1] |= CAN_ERR_CRTL_TX_PASSIVE; | 534 | cf->data[1] |= CAN_ERR_CRTL_TX_PASSIVE; |
diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c index 2c7f5036f570..214795945bc4 100644 --- a/drivers/net/can/sja1000/peak_pci.c +++ b/drivers/net/can/sja1000/peak_pci.c | |||
@@ -39,9 +39,9 @@ MODULE_LICENSE("GPL v2"); | |||
39 | #define DRV_NAME "peak_pci" | 39 | #define DRV_NAME "peak_pci" |
40 | 40 | ||
41 | struct peak_pci_chan { | 41 | struct peak_pci_chan { |
42 | void __iomem *cfg_base; /* Common for all channels */ | 42 | void __iomem *cfg_base; /* Common for all channels */ |
43 | struct net_device *next_dev; /* Chain of network devices */ | 43 | struct net_device *prev_dev; /* Chain of network devices */ |
44 | u16 icr_mask; /* Interrupt mask for fast ack */ | 44 | u16 icr_mask; /* Interrupt mask for fast ack */ |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #define PEAK_PCI_CAN_CLOCK (16000000 / 2) | 47 | #define PEAK_PCI_CAN_CLOCK (16000000 / 2) |
@@ -98,7 +98,7 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev, | |||
98 | { | 98 | { |
99 | struct sja1000_priv *priv; | 99 | struct sja1000_priv *priv; |
100 | struct peak_pci_chan *chan; | 100 | struct peak_pci_chan *chan; |
101 | struct net_device *dev, *dev0 = NULL; | 101 | struct net_device *dev; |
102 | void __iomem *cfg_base, *reg_base; | 102 | void __iomem *cfg_base, *reg_base; |
103 | u16 sub_sys_id, icr; | 103 | u16 sub_sys_id, icr; |
104 | int i, err, channels; | 104 | int i, err, channels; |
@@ -196,18 +196,14 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev, | |||
196 | } | 196 | } |
197 | 197 | ||
198 | /* Create chain of SJA1000 devices */ | 198 | /* Create chain of SJA1000 devices */ |
199 | if (i == 0) | 199 | chan->prev_dev = pci_get_drvdata(pdev); |
200 | dev0 = dev; | 200 | pci_set_drvdata(pdev, dev); |
201 | else | ||
202 | chan->next_dev = dev; | ||
203 | 201 | ||
204 | dev_info(&pdev->dev, | 202 | dev_info(&pdev->dev, |
205 | "%s at reg_base=0x%p cfg_base=0x%p irq=%d\n", | 203 | "%s at reg_base=0x%p cfg_base=0x%p irq=%d\n", |
206 | dev->name, priv->reg_base, chan->cfg_base, dev->irq); | 204 | dev->name, priv->reg_base, chan->cfg_base, dev->irq); |
207 | } | 205 | } |
208 | 206 | ||
209 | pci_set_drvdata(pdev, dev0); | ||
210 | |||
211 | /* Enable interrupts */ | 207 | /* Enable interrupts */ |
212 | writew(icr, cfg_base + PITA_ICR + 2); | 208 | writew(icr, cfg_base + PITA_ICR + 2); |
213 | 209 | ||
@@ -217,12 +213,11 @@ failure_remove_channels: | |||
217 | /* Disable interrupts */ | 213 | /* Disable interrupts */ |
218 | writew(0x0, cfg_base + PITA_ICR + 2); | 214 | writew(0x0, cfg_base + PITA_ICR + 2); |
219 | 215 | ||
220 | for (dev = dev0; dev; dev = chan->next_dev) { | 216 | for (dev = pci_get_drvdata(pdev); dev; dev = chan->prev_dev) { |
221 | unregister_sja1000dev(dev); | 217 | unregister_sja1000dev(dev); |
222 | free_sja1000dev(dev); | 218 | free_sja1000dev(dev); |
223 | priv = netdev_priv(dev); | 219 | priv = netdev_priv(dev); |
224 | chan = priv->priv; | 220 | chan = priv->priv; |
225 | dev = chan->next_dev; | ||
226 | } | 221 | } |
227 | 222 | ||
228 | pci_iounmap(pdev, reg_base); | 223 | pci_iounmap(pdev, reg_base); |
@@ -241,7 +236,7 @@ failure_disable_pci: | |||
241 | 236 | ||
242 | static void __devexit peak_pci_remove(struct pci_dev *pdev) | 237 | static void __devexit peak_pci_remove(struct pci_dev *pdev) |
243 | { | 238 | { |
244 | struct net_device *dev = pci_get_drvdata(pdev); /* First device */ | 239 | struct net_device *dev = pci_get_drvdata(pdev); /* Last device */ |
245 | struct sja1000_priv *priv = netdev_priv(dev); | 240 | struct sja1000_priv *priv = netdev_priv(dev); |
246 | struct peak_pci_chan *chan = priv->priv; | 241 | struct peak_pci_chan *chan = priv->priv; |
247 | void __iomem *cfg_base = chan->cfg_base; | 242 | void __iomem *cfg_base = chan->cfg_base; |
@@ -255,7 +250,7 @@ static void __devexit peak_pci_remove(struct pci_dev *pdev) | |||
255 | dev_info(&pdev->dev, "removing device %s\n", dev->name); | 250 | dev_info(&pdev->dev, "removing device %s\n", dev->name); |
256 | unregister_sja1000dev(dev); | 251 | unregister_sja1000dev(dev); |
257 | free_sja1000dev(dev); | 252 | free_sja1000dev(dev); |
258 | dev = chan->next_dev; | 253 | dev = chan->prev_dev; |
259 | if (!dev) | 254 | if (!dev) |
260 | break; | 255 | break; |
261 | priv = netdev_priv(dev); | 256 | priv = netdev_priv(dev); |
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index 04a3f1b756a8..192b0d118df4 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c | |||
@@ -95,11 +95,16 @@ static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val) | |||
95 | spin_unlock_irqrestore(&priv->cmdreg_lock, flags); | 95 | spin_unlock_irqrestore(&priv->cmdreg_lock, flags); |
96 | } | 96 | } |
97 | 97 | ||
98 | static int sja1000_is_absent(struct sja1000_priv *priv) | ||
99 | { | ||
100 | return (priv->read_reg(priv, REG_MOD) == 0xFF); | ||
101 | } | ||
102 | |||
98 | static int sja1000_probe_chip(struct net_device *dev) | 103 | static int sja1000_probe_chip(struct net_device *dev) |
99 | { | 104 | { |
100 | struct sja1000_priv *priv = netdev_priv(dev); | 105 | struct sja1000_priv *priv = netdev_priv(dev); |
101 | 106 | ||
102 | if (priv->reg_base && (priv->read_reg(priv, 0) == 0xFF)) { | 107 | if (priv->reg_base && sja1000_is_absent(priv)) { |
103 | printk(KERN_INFO "%s: probing @0x%lX failed\n", | 108 | printk(KERN_INFO "%s: probing @0x%lX failed\n", |
104 | DRV_NAME, dev->base_addr); | 109 | DRV_NAME, dev->base_addr); |
105 | return 0; | 110 | return 0; |
@@ -493,6 +498,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) | |||
493 | while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) { | 498 | while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) { |
494 | n++; | 499 | n++; |
495 | status = priv->read_reg(priv, REG_SR); | 500 | status = priv->read_reg(priv, REG_SR); |
501 | /* check for absent controller due to hw unplug */ | ||
502 | if (status == 0xFF && sja1000_is_absent(priv)) | ||
503 | return IRQ_NONE; | ||
496 | 504 | ||
497 | if (isrc & IRQ_WUI) | 505 | if (isrc & IRQ_WUI) |
498 | dev_warn(dev->dev.parent, "wakeup interrupt\n"); | 506 | dev_warn(dev->dev.parent, "wakeup interrupt\n"); |
@@ -509,6 +517,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) | |||
509 | while (status & SR_RBS) { | 517 | while (status & SR_RBS) { |
510 | sja1000_rx(dev); | 518 | sja1000_rx(dev); |
511 | status = priv->read_reg(priv, REG_SR); | 519 | status = priv->read_reg(priv, REG_SR); |
520 | /* check for absent controller */ | ||
521 | if (status == 0xFF && sja1000_is_absent(priv)) | ||
522 | return IRQ_NONE; | ||
512 | } | 523 | } |
513 | } | 524 | } |
514 | if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) { | 525 | if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) { |
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c index df809e3f130e..5a2e1e3588a1 100644 --- a/drivers/net/can/ti_hecc.c +++ b/drivers/net/can/ti_hecc.c | |||
@@ -745,9 +745,10 @@ static int ti_hecc_error(struct net_device *ndev, int int_status, | |||
745 | } | 745 | } |
746 | } | 746 | } |
747 | 747 | ||
748 | netif_receive_skb(skb); | 748 | netif_rx(skb); |
749 | stats->rx_packets++; | 749 | stats->rx_packets++; |
750 | stats->rx_bytes += cf->can_dlc; | 750 | stats->rx_bytes += cf->can_dlc; |
751 | |||
751 | return 0; | 752 | return 0; |
752 | } | 753 | } |
753 | 754 | ||
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index 9697c14b8dc6..7dae64d44e83 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c | |||
@@ -627,9 +627,6 @@ static int ems_usb_start(struct ems_usb *dev) | |||
627 | 627 | ||
628 | err = usb_submit_urb(urb, GFP_KERNEL); | 628 | err = usb_submit_urb(urb, GFP_KERNEL); |
629 | if (err) { | 629 | if (err) { |
630 | if (err == -ENODEV) | ||
631 | netif_device_detach(dev->netdev); | ||
632 | |||
633 | usb_unanchor_urb(urb); | 630 | usb_unanchor_urb(urb); |
634 | usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf, | 631 | usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf, |
635 | urb->transfer_dma); | 632 | urb->transfer_dma); |
@@ -659,9 +656,6 @@ static int ems_usb_start(struct ems_usb *dev) | |||
659 | 656 | ||
660 | err = usb_submit_urb(dev->intr_urb, GFP_KERNEL); | 657 | err = usb_submit_urb(dev->intr_urb, GFP_KERNEL); |
661 | if (err) { | 658 | if (err) { |
662 | if (err == -ENODEV) | ||
663 | netif_device_detach(dev->netdev); | ||
664 | |||
665 | dev_warn(netdev->dev.parent, "intr URB submit failed: %d\n", | 659 | dev_warn(netdev->dev.parent, "intr URB submit failed: %d\n", |
666 | err); | 660 | err); |
667 | 661 | ||
@@ -692,9 +686,6 @@ static int ems_usb_start(struct ems_usb *dev) | |||
692 | return 0; | 686 | return 0; |
693 | 687 | ||
694 | failed: | 688 | failed: |
695 | if (err == -ENODEV) | ||
696 | netif_device_detach(dev->netdev); | ||
697 | |||
698 | dev_warn(netdev->dev.parent, "couldn't submit control: %d\n", err); | 689 | dev_warn(netdev->dev.parent, "couldn't submit control: %d\n", err); |
699 | 690 | ||
700 | return err; | 691 | return err; |
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c index 8153a3e0a1a4..f9b74c0a8492 100644 --- a/drivers/net/ethernet/3com/3c59x.c +++ b/drivers/net/ethernet/3com/3c59x.c | |||
@@ -1842,7 +1842,7 @@ vortex_timer(unsigned long data) | |||
1842 | ok = 1; | 1842 | ok = 1; |
1843 | } | 1843 | } |
1844 | 1844 | ||
1845 | if (!netif_carrier_ok(dev)) | 1845 | if (dev->flags & IFF_SLAVE || !netif_carrier_ok(dev)) |
1846 | next_tick = 5*HZ; | 1846 | next_tick = 5*HZ; |
1847 | 1847 | ||
1848 | if (vp->medialock) | 1848 | if (vp->medialock) |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index b8591246eb4c..47a9bb2c813c 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -1710,7 +1710,7 @@ static irqreturn_t atl1c_intr(int irq, void *data) | |||
1710 | "atl1c hardware error (status = 0x%x)\n", | 1710 | "atl1c hardware error (status = 0x%x)\n", |
1711 | status & ISR_ERROR); | 1711 | status & ISR_ERROR); |
1712 | /* reset MAC */ | 1712 | /* reset MAC */ |
1713 | adapter->work_event |= ATL1C_WORK_EVENT_RESET; | 1713 | set_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event); |
1714 | schedule_work(&adapter->common_task); | 1714 | schedule_work(&adapter->common_task); |
1715 | return IRQ_HANDLED; | 1715 | return IRQ_HANDLED; |
1716 | } | 1716 | } |
@@ -2244,10 +2244,6 @@ static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb, | |||
2244 | dev_info(&adapter->pdev->dev, "tx locked\n"); | 2244 | dev_info(&adapter->pdev->dev, "tx locked\n"); |
2245 | return NETDEV_TX_LOCKED; | 2245 | return NETDEV_TX_LOCKED; |
2246 | } | 2246 | } |
2247 | if (skb->mark == 0x01) | ||
2248 | type = atl1c_trans_high; | ||
2249 | else | ||
2250 | type = atl1c_trans_normal; | ||
2251 | 2247 | ||
2252 | if (atl1c_tpd_avail(adapter, type) < tpd_req) { | 2248 | if (atl1c_tpd_avail(adapter, type) < tpd_req) { |
2253 | /* no enough descriptor, just stop queue */ | 2249 | /* no enough descriptor, just stop queue */ |
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 3fb66d09ece5..cab87456a34a 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c | |||
@@ -2339,7 +2339,7 @@ static inline int __init b44_pci_init(void) | |||
2339 | return err; | 2339 | return err; |
2340 | } | 2340 | } |
2341 | 2341 | ||
2342 | static inline void __exit b44_pci_exit(void) | 2342 | static inline void b44_pci_exit(void) |
2343 | { | 2343 | { |
2344 | #ifdef CONFIG_B44_PCI | 2344 | #ifdef CONFIG_B44_PCI |
2345 | ssb_pcihost_unregister(&b44_pci_driver); | 2345 | ssb_pcihost_unregister(&b44_pci_driver); |
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 986019b2c849..c7ca7ec065ee 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c | |||
@@ -797,7 +797,7 @@ static int bcm_enet_open(struct net_device *dev) | |||
797 | if (priv->has_phy) { | 797 | if (priv->has_phy) { |
798 | /* connect to PHY */ | 798 | /* connect to PHY */ |
799 | snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, | 799 | snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, |
800 | priv->mac_id ? "1" : "0", priv->phy_id); | 800 | priv->mii_bus->id, priv->phy_id); |
801 | 801 | ||
802 | phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0, | 802 | phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0, |
803 | PHY_INTERFACE_MODE_MII); | 803 | PHY_INTERFACE_MODE_MII); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 03f3935fd8c2..7aee46983be4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -523,7 +523,6 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
523 | skb = build_skb(data); | 523 | skb = build_skb(data); |
524 | 524 | ||
525 | if (likely(skb)) { | 525 | if (likely(skb)) { |
526 | |||
527 | #ifdef BNX2X_STOP_ON_ERROR | 526 | #ifdef BNX2X_STOP_ON_ERROR |
528 | if (pad + len > fp->rx_buf_size) { | 527 | if (pad + len > fp->rx_buf_size) { |
529 | BNX2X_ERR("skb_put is about to fail... " | 528 | BNX2X_ERR("skb_put is about to fail... " |
@@ -557,7 +556,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
557 | 556 | ||
558 | return; | 557 | return; |
559 | } | 558 | } |
560 | 559 | kfree(new_data); | |
561 | drop: | 560 | drop: |
562 | /* drop the packet and keep the buffer in the bin */ | 561 | /* drop the packet and keep the buffer in the bin */ |
563 | DP(NETIF_MSG_RX_STATUS, | 562 | DP(NETIF_MSG_RX_STATUS, |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 1e3f978ee6da..254521319150 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -117,10 +117,6 @@ static int dropless_fc; | |||
117 | module_param(dropless_fc, int, 0); | 117 | module_param(dropless_fc, int, 0); |
118 | MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring"); | 118 | MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring"); |
119 | 119 | ||
120 | static int poll; | ||
121 | module_param(poll, int, 0); | ||
122 | MODULE_PARM_DESC(poll, " Use polling (for debug)"); | ||
123 | |||
124 | static int mrrs = -1; | 120 | static int mrrs = -1; |
125 | module_param(mrrs, int, 0); | 121 | module_param(mrrs, int, 0); |
126 | MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)"); | 122 | MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)"); |
@@ -4834,20 +4830,11 @@ void bnx2x_drv_pulse(struct bnx2x *bp) | |||
4834 | 4830 | ||
4835 | static void bnx2x_timer(unsigned long data) | 4831 | static void bnx2x_timer(unsigned long data) |
4836 | { | 4832 | { |
4837 | u8 cos; | ||
4838 | struct bnx2x *bp = (struct bnx2x *) data; | 4833 | struct bnx2x *bp = (struct bnx2x *) data; |
4839 | 4834 | ||
4840 | if (!netif_running(bp->dev)) | 4835 | if (!netif_running(bp->dev)) |
4841 | return; | 4836 | return; |
4842 | 4837 | ||
4843 | if (poll) { | ||
4844 | struct bnx2x_fastpath *fp = &bp->fp[0]; | ||
4845 | |||
4846 | for_each_cos_in_tx_queue(fp, cos) | ||
4847 | bnx2x_tx_int(bp, &fp->txdata[cos]); | ||
4848 | bnx2x_rx_int(fp, 1000); | ||
4849 | } | ||
4850 | |||
4851 | if (!BP_NOMCP(bp)) { | 4838 | if (!BP_NOMCP(bp)) { |
4852 | int mb_idx = BP_FW_MB_IDX(bp); | 4839 | int mb_idx = BP_FW_MB_IDX(bp); |
4853 | u32 drv_pulse; | 4840 | u32 drv_pulse; |
@@ -10063,7 +10050,6 @@ static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp) | |||
10063 | static int __devinit bnx2x_init_bp(struct bnx2x *bp) | 10050 | static int __devinit bnx2x_init_bp(struct bnx2x *bp) |
10064 | { | 10051 | { |
10065 | int func; | 10052 | int func; |
10066 | int timer_interval; | ||
10067 | int rc; | 10053 | int rc; |
10068 | 10054 | ||
10069 | mutex_init(&bp->port.phy_mutex); | 10055 | mutex_init(&bp->port.phy_mutex); |
@@ -10139,8 +10125,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
10139 | bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR; | 10125 | bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR; |
10140 | bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR; | 10126 | bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR; |
10141 | 10127 | ||
10142 | timer_interval = (CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ); | 10128 | bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ; |
10143 | bp->current_interval = (poll ? poll : timer_interval); | ||
10144 | 10129 | ||
10145 | init_timer(&bp->timer); | 10130 | init_timer(&bp->timer); |
10146 | bp->timer.expires = jiffies + bp->current_interval; | 10131 | bp->timer.expires = jiffies + bp->current_interval; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c index bc0121ac291e..1adef266fcd5 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | |||
@@ -1081,17 +1081,17 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) | |||
1081 | estats->rx_stat_ifhcinbadoctets_lo); | 1081 | estats->rx_stat_ifhcinbadoctets_lo); |
1082 | 1082 | ||
1083 | ADD_64(fstats->total_bytes_received_hi, | 1083 | ADD_64(fstats->total_bytes_received_hi, |
1084 | tfunc->rcv_error_bytes.hi, | 1084 | le32_to_cpu(tfunc->rcv_error_bytes.hi), |
1085 | fstats->total_bytes_received_lo, | 1085 | fstats->total_bytes_received_lo, |
1086 | tfunc->rcv_error_bytes.lo); | 1086 | le32_to_cpu(tfunc->rcv_error_bytes.lo)); |
1087 | 1087 | ||
1088 | memcpy(estats, &(fstats->total_bytes_received_hi), | 1088 | memcpy(estats, &(fstats->total_bytes_received_hi), |
1089 | sizeof(struct host_func_stats) - 2*sizeof(u32)); | 1089 | sizeof(struct host_func_stats) - 2*sizeof(u32)); |
1090 | 1090 | ||
1091 | ADD_64(estats->error_bytes_received_hi, | 1091 | ADD_64(estats->error_bytes_received_hi, |
1092 | tfunc->rcv_error_bytes.hi, | 1092 | le32_to_cpu(tfunc->rcv_error_bytes.hi), |
1093 | estats->error_bytes_received_lo, | 1093 | estats->error_bytes_received_lo, |
1094 | tfunc->rcv_error_bytes.lo); | 1094 | le32_to_cpu(tfunc->rcv_error_bytes.lo)); |
1095 | 1095 | ||
1096 | ADD_64(estats->etherstatsoverrsizepkts_hi, | 1096 | ADD_64(estats->etherstatsoverrsizepkts_hi, |
1097 | estats->rx_stat_dot3statsframestoolong_hi, | 1097 | estats->rx_stat_dot3statsframestoolong_hi, |
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index dd3a0a232ea0..818a573669e6 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -3584,7 +3584,11 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr, | |||
3584 | fl6.flowi6_oif = dst_addr->sin6_scope_id; | 3584 | fl6.flowi6_oif = dst_addr->sin6_scope_id; |
3585 | 3585 | ||
3586 | *dst = ip6_route_output(&init_net, NULL, &fl6); | 3586 | *dst = ip6_route_output(&init_net, NULL, &fl6); |
3587 | if (*dst) | 3587 | if ((*dst)->error) { |
3588 | dst_release(*dst); | ||
3589 | *dst = NULL; | ||
3590 | return -ENETUNREACH; | ||
3591 | } else | ||
3588 | return 0; | 3592 | return 0; |
3589 | #endif | 3593 | #endif |
3590 | 3594 | ||
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index a1f2e0fed78b..35c2a202d67a 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -5352,7 +5352,7 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
5352 | } | 5352 | } |
5353 | } | 5353 | } |
5354 | 5354 | ||
5355 | netdev_completed_queue(tp->dev, pkts_compl, bytes_compl); | 5355 | netdev_tx_completed_queue(txq, pkts_compl, bytes_compl); |
5356 | 5356 | ||
5357 | tnapi->tx_cons = sw_idx; | 5357 | tnapi->tx_cons = sw_idx; |
5358 | 5358 | ||
@@ -6793,7 +6793,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
6793 | } | 6793 | } |
6794 | 6794 | ||
6795 | skb_tx_timestamp(skb); | 6795 | skb_tx_timestamp(skb); |
6796 | netdev_sent_queue(tp->dev, skb->len); | 6796 | netdev_tx_sent_queue(txq, skb->len); |
6797 | 6797 | ||
6798 | /* Packets are ready, update Tx producer idx local and on card. */ | 6798 | /* Packets are ready, update Tx producer idx local and on card. */ |
6799 | tw32_tx_mbox(tnapi->prodmbox, entry); | 6799 | tw32_tx_mbox(tnapi->prodmbox, entry); |
@@ -7275,8 +7275,8 @@ static void tg3_free_rings(struct tg3 *tp) | |||
7275 | 7275 | ||
7276 | dev_kfree_skb_any(skb); | 7276 | dev_kfree_skb_any(skb); |
7277 | } | 7277 | } |
7278 | netdev_tx_reset_queue(netdev_get_tx_queue(tp->dev, j)); | ||
7278 | } | 7279 | } |
7279 | netdev_reset_queue(tp->dev); | ||
7280 | } | 7280 | } |
7281 | 7281 | ||
7282 | /* Initialize tx/rx rings for packet processing. | 7282 | /* Initialize tx/rx rings for packet processing. |
@@ -7886,10 +7886,8 @@ static int tg3_chip_reset(struct tg3 *tp) | |||
7886 | return 0; | 7886 | return 0; |
7887 | } | 7887 | } |
7888 | 7888 | ||
7889 | static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *, | 7889 | static void tg3_get_nstats(struct tg3 *, struct rtnl_link_stats64 *); |
7890 | struct rtnl_link_stats64 *); | 7890 | static void tg3_get_estats(struct tg3 *, struct tg3_ethtool_stats *); |
7891 | static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *, | ||
7892 | struct tg3_ethtool_stats *); | ||
7893 | 7891 | ||
7894 | /* tp->lock is held. */ | 7892 | /* tp->lock is held. */ |
7895 | static int tg3_halt(struct tg3 *tp, int kind, int silent) | 7893 | static int tg3_halt(struct tg3 *tp, int kind, int silent) |
@@ -7910,7 +7908,7 @@ static int tg3_halt(struct tg3 *tp, int kind, int silent) | |||
7910 | 7908 | ||
7911 | if (tp->hw_stats) { | 7909 | if (tp->hw_stats) { |
7912 | /* Save the stats across chip resets... */ | 7910 | /* Save the stats across chip resets... */ |
7913 | tg3_get_stats64(tp->dev, &tp->net_stats_prev), | 7911 | tg3_get_nstats(tp, &tp->net_stats_prev), |
7914 | tg3_get_estats(tp, &tp->estats_prev); | 7912 | tg3_get_estats(tp, &tp->estats_prev); |
7915 | 7913 | ||
7916 | /* And make sure the next sample is new data */ | 7914 | /* And make sure the next sample is new data */ |
@@ -9847,7 +9845,7 @@ static inline u64 get_stat64(tg3_stat64_t *val) | |||
9847 | return ((u64)val->high << 32) | ((u64)val->low); | 9845 | return ((u64)val->high << 32) | ((u64)val->low); |
9848 | } | 9846 | } |
9849 | 9847 | ||
9850 | static u64 calc_crc_errors(struct tg3 *tp) | 9848 | static u64 tg3_calc_crc_errors(struct tg3 *tp) |
9851 | { | 9849 | { |
9852 | struct tg3_hw_stats *hw_stats = tp->hw_stats; | 9850 | struct tg3_hw_stats *hw_stats = tp->hw_stats; |
9853 | 9851 | ||
@@ -9856,14 +9854,12 @@ static u64 calc_crc_errors(struct tg3 *tp) | |||
9856 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) { | 9854 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) { |
9857 | u32 val; | 9855 | u32 val; |
9858 | 9856 | ||
9859 | spin_lock_bh(&tp->lock); | ||
9860 | if (!tg3_readphy(tp, MII_TG3_TEST1, &val)) { | 9857 | if (!tg3_readphy(tp, MII_TG3_TEST1, &val)) { |
9861 | tg3_writephy(tp, MII_TG3_TEST1, | 9858 | tg3_writephy(tp, MII_TG3_TEST1, |
9862 | val | MII_TG3_TEST1_CRC_EN); | 9859 | val | MII_TG3_TEST1_CRC_EN); |
9863 | tg3_readphy(tp, MII_TG3_RXR_COUNTERS, &val); | 9860 | tg3_readphy(tp, MII_TG3_RXR_COUNTERS, &val); |
9864 | } else | 9861 | } else |
9865 | val = 0; | 9862 | val = 0; |
9866 | spin_unlock_bh(&tp->lock); | ||
9867 | 9863 | ||
9868 | tp->phy_crc_errors += val; | 9864 | tp->phy_crc_errors += val; |
9869 | 9865 | ||
@@ -9877,14 +9873,13 @@ static u64 calc_crc_errors(struct tg3 *tp) | |||
9877 | estats->member = old_estats->member + \ | 9873 | estats->member = old_estats->member + \ |
9878 | get_stat64(&hw_stats->member) | 9874 | get_stat64(&hw_stats->member) |
9879 | 9875 | ||
9880 | static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp, | 9876 | static void tg3_get_estats(struct tg3 *tp, struct tg3_ethtool_stats *estats) |
9881 | struct tg3_ethtool_stats *estats) | ||
9882 | { | 9877 | { |
9883 | struct tg3_ethtool_stats *old_estats = &tp->estats_prev; | 9878 | struct tg3_ethtool_stats *old_estats = &tp->estats_prev; |
9884 | struct tg3_hw_stats *hw_stats = tp->hw_stats; | 9879 | struct tg3_hw_stats *hw_stats = tp->hw_stats; |
9885 | 9880 | ||
9886 | if (!hw_stats) | 9881 | if (!hw_stats) |
9887 | return old_estats; | 9882 | return; |
9888 | 9883 | ||
9889 | ESTAT_ADD(rx_octets); | 9884 | ESTAT_ADD(rx_octets); |
9890 | ESTAT_ADD(rx_fragments); | 9885 | ESTAT_ADD(rx_fragments); |
@@ -9963,20 +9958,13 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp, | |||
9963 | ESTAT_ADD(nic_tx_threshold_hit); | 9958 | ESTAT_ADD(nic_tx_threshold_hit); |
9964 | 9959 | ||
9965 | ESTAT_ADD(mbuf_lwm_thresh_hit); | 9960 | ESTAT_ADD(mbuf_lwm_thresh_hit); |
9966 | |||
9967 | return estats; | ||
9968 | } | 9961 | } |
9969 | 9962 | ||
9970 | static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, | 9963 | static void tg3_get_nstats(struct tg3 *tp, struct rtnl_link_stats64 *stats) |
9971 | struct rtnl_link_stats64 *stats) | ||
9972 | { | 9964 | { |
9973 | struct tg3 *tp = netdev_priv(dev); | ||
9974 | struct rtnl_link_stats64 *old_stats = &tp->net_stats_prev; | 9965 | struct rtnl_link_stats64 *old_stats = &tp->net_stats_prev; |
9975 | struct tg3_hw_stats *hw_stats = tp->hw_stats; | 9966 | struct tg3_hw_stats *hw_stats = tp->hw_stats; |
9976 | 9967 | ||
9977 | if (!hw_stats) | ||
9978 | return old_stats; | ||
9979 | |||
9980 | stats->rx_packets = old_stats->rx_packets + | 9968 | stats->rx_packets = old_stats->rx_packets + |
9981 | get_stat64(&hw_stats->rx_ucast_packets) + | 9969 | get_stat64(&hw_stats->rx_ucast_packets) + |
9982 | get_stat64(&hw_stats->rx_mcast_packets) + | 9970 | get_stat64(&hw_stats->rx_mcast_packets) + |
@@ -10019,15 +10007,13 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, | |||
10019 | get_stat64(&hw_stats->tx_carrier_sense_errors); | 10007 | get_stat64(&hw_stats->tx_carrier_sense_errors); |
10020 | 10008 | ||
10021 | stats->rx_crc_errors = old_stats->rx_crc_errors + | 10009 | stats->rx_crc_errors = old_stats->rx_crc_errors + |
10022 | calc_crc_errors(tp); | 10010 | tg3_calc_crc_errors(tp); |
10023 | 10011 | ||
10024 | stats->rx_missed_errors = old_stats->rx_missed_errors + | 10012 | stats->rx_missed_errors = old_stats->rx_missed_errors + |
10025 | get_stat64(&hw_stats->rx_discards); | 10013 | get_stat64(&hw_stats->rx_discards); |
10026 | 10014 | ||
10027 | stats->rx_dropped = tp->rx_dropped; | 10015 | stats->rx_dropped = tp->rx_dropped; |
10028 | stats->tx_dropped = tp->tx_dropped; | 10016 | stats->tx_dropped = tp->tx_dropped; |
10029 | |||
10030 | return stats; | ||
10031 | } | 10017 | } |
10032 | 10018 | ||
10033 | static inline u32 calc_crc(unsigned char *buf, int len) | 10019 | static inline u32 calc_crc(unsigned char *buf, int len) |
@@ -15409,6 +15395,21 @@ static void __devinit tg3_init_coal(struct tg3 *tp) | |||
15409 | } | 15395 | } |
15410 | } | 15396 | } |
15411 | 15397 | ||
15398 | static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, | ||
15399 | struct rtnl_link_stats64 *stats) | ||
15400 | { | ||
15401 | struct tg3 *tp = netdev_priv(dev); | ||
15402 | |||
15403 | if (!tp->hw_stats) | ||
15404 | return &tp->net_stats_prev; | ||
15405 | |||
15406 | spin_lock_bh(&tp->lock); | ||
15407 | tg3_get_nstats(tp, stats); | ||
15408 | spin_unlock_bh(&tp->lock); | ||
15409 | |||
15410 | return stats; | ||
15411 | } | ||
15412 | |||
15412 | static const struct net_device_ops tg3_netdev_ops = { | 15413 | static const struct net_device_ops tg3_netdev_ops = { |
15413 | .ndo_open = tg3_open, | 15414 | .ndo_open = tg3_open, |
15414 | .ndo_stop = tg3_close, | 15415 | .ndo_stop = tg3_close, |
diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c index 9b44ec8096ba..803ea32aa99d 100644 --- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c +++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c | |||
@@ -946,7 +946,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, | |||
946 | 946 | ||
947 | flash_attr = kzalloc(sizeof(struct bfa_flash_attr), GFP_KERNEL); | 947 | flash_attr = kzalloc(sizeof(struct bfa_flash_attr), GFP_KERNEL); |
948 | if (!flash_attr) | 948 | if (!flash_attr) |
949 | return -ENOMEM; | 949 | return 0; |
950 | 950 | ||
951 | fcomp.bnad = bnad; | 951 | fcomp.bnad = bnad; |
952 | fcomp.comp_status = 0; | 952 | fcomp.comp_status = 0; |
@@ -958,7 +958,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, | |||
958 | if (ret != BFA_STATUS_OK) { | 958 | if (ret != BFA_STATUS_OK) { |
959 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 959 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |
960 | kfree(flash_attr); | 960 | kfree(flash_attr); |
961 | goto out_err; | 961 | return 0; |
962 | } | 962 | } |
963 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 963 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |
964 | wait_for_completion(&fcomp.comp); | 964 | wait_for_completion(&fcomp.comp); |
@@ -978,8 +978,6 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, | |||
978 | } | 978 | } |
979 | kfree(flash_attr); | 979 | kfree(flash_attr); |
980 | return flash_part; | 980 | return flash_part; |
981 | out_err: | ||
982 | return -EINVAL; | ||
983 | } | 981 | } |
984 | 982 | ||
985 | static int | 983 | static int |
@@ -1006,7 +1004,7 @@ bnad_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, | |||
1006 | /* Query the flash partition based on the offset */ | 1004 | /* Query the flash partition based on the offset */ |
1007 | flash_part = bnad_get_flash_partition_by_offset(bnad, | 1005 | flash_part = bnad_get_flash_partition_by_offset(bnad, |
1008 | eeprom->offset, &base_offset); | 1006 | eeprom->offset, &base_offset); |
1009 | if (flash_part <= 0) | 1007 | if (flash_part == 0) |
1010 | return -EFAULT; | 1008 | return -EFAULT; |
1011 | 1009 | ||
1012 | fcomp.bnad = bnad; | 1010 | fcomp.bnad = bnad; |
@@ -1048,7 +1046,7 @@ bnad_set_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, | |||
1048 | /* Query the flash partition based on the offset */ | 1046 | /* Query the flash partition based on the offset */ |
1049 | flash_part = bnad_get_flash_partition_by_offset(bnad, | 1047 | flash_part = bnad_get_flash_partition_by_offset(bnad, |
1050 | eeprom->offset, &base_offset); | 1048 | eeprom->offset, &base_offset); |
1051 | if (flash_part <= 0) | 1049 | if (flash_part == 0) |
1052 | return -EFAULT; | 1050 | return -EFAULT; |
1053 | 1051 | ||
1054 | fcomp.bnad = bnad; | 1052 | fcomp.bnad = bnad; |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index e83d12c7bf20..9d76e59d9526 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -196,6 +196,8 @@ static DEFINE_PCI_DEVICE_TABLE(cxgb4_pci_tbl) = { | |||
196 | CH_DEVICE(0x4408, 4), | 196 | CH_DEVICE(0x4408, 4), |
197 | CH_DEVICE(0x4409, 4), | 197 | CH_DEVICE(0x4409, 4), |
198 | CH_DEVICE(0x440a, 4), | 198 | CH_DEVICE(0x440a, 4), |
199 | CH_DEVICE(0x440d, 4), | ||
200 | CH_DEVICE(0x440e, 4), | ||
199 | { 0, } | 201 | { 0, } |
200 | }; | 202 | }; |
201 | 203 | ||
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index e53365a71484..d963c1d57f71 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | |||
@@ -2892,6 +2892,8 @@ static struct pci_device_id cxgb4vf_pci_tbl[] = { | |||
2892 | CH_DEVICE(0x4808, 0), /* T420-cx */ | 2892 | CH_DEVICE(0x4808, 0), /* T420-cx */ |
2893 | CH_DEVICE(0x4809, 0), /* T420-bt */ | 2893 | CH_DEVICE(0x4809, 0), /* T420-bt */ |
2894 | CH_DEVICE(0x480a, 0), /* T404-bt */ | 2894 | CH_DEVICE(0x480a, 0), /* T404-bt */ |
2895 | CH_DEVICE(0x480d, 0), /* T480-cr */ | ||
2896 | CH_DEVICE(0x480e, 0), /* T440-lp-cr */ | ||
2895 | { 0, } | 2897 | { 0, } |
2896 | }; | 2898 | }; |
2897 | 2899 | ||
diff --git a/drivers/net/ethernet/cisco/enic/cq_enet_desc.h b/drivers/net/ethernet/cisco/enic/cq_enet_desc.h index c2c0680a1146..ac37cacc6136 100644 --- a/drivers/net/ethernet/cisco/enic/cq_enet_desc.h +++ b/drivers/net/ethernet/cisco/enic/cq_enet_desc.h | |||
@@ -157,7 +157,7 @@ static inline void cq_enet_rq_desc_dec(struct cq_enet_rq_desc *desc, | |||
157 | CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0; | 157 | CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0; |
158 | *fcoe_enc_error = (desc->flags & | 158 | *fcoe_enc_error = (desc->flags & |
159 | CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0; | 159 | CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0; |
160 | *fcoe_eof = (u8)((desc->checksum_fcoe >> | 160 | *fcoe_eof = (u8)((le16_to_cpu(desc->checksum_fcoe) >> |
161 | CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) & | 161 | CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) & |
162 | CQ_ENET_RQ_DESC_FCOE_EOF_MASK); | 162 | CQ_ENET_RQ_DESC_FCOE_EOF_MASK); |
163 | *checksum = 0; | 163 | *checksum = 0; |
diff --git a/drivers/net/ethernet/cisco/enic/enic.h b/drivers/net/ethernet/cisco/enic/enic.h index ee93a2087fe6..c52295cd05ef 100644 --- a/drivers/net/ethernet/cisco/enic/enic.h +++ b/drivers/net/ethernet/cisco/enic/enic.h | |||
@@ -94,7 +94,7 @@ struct enic { | |||
94 | u32 rx_coalesce_usecs; | 94 | u32 rx_coalesce_usecs; |
95 | u32 tx_coalesce_usecs; | 95 | u32 tx_coalesce_usecs; |
96 | #ifdef CONFIG_PCI_IOV | 96 | #ifdef CONFIG_PCI_IOV |
97 | u32 num_vfs; | 97 | u16 num_vfs; |
98 | #endif | 98 | #endif |
99 | struct enic_port_profile *pp; | 99 | struct enic_port_profile *pp; |
100 | 100 | ||
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index ab3f67f980d8..0e4edd3b6bee 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c | |||
@@ -2370,7 +2370,7 @@ static int __devinit enic_probe(struct pci_dev *pdev, | |||
2370 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV); | 2370 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV); |
2371 | if (pos) { | 2371 | if (pos) { |
2372 | pci_read_config_word(pdev, pos + PCI_SRIOV_TOTAL_VF, | 2372 | pci_read_config_word(pdev, pos + PCI_SRIOV_TOTAL_VF, |
2373 | (u16 *)&enic->num_vfs); | 2373 | &enic->num_vfs); |
2374 | if (enic->num_vfs) { | 2374 | if (enic->num_vfs) { |
2375 | err = pci_enable_sriov(pdev, enic->num_vfs); | 2375 | err = pci_enable_sriov(pdev, enic->num_vfs); |
2376 | if (err) { | 2376 | if (err) { |
diff --git a/drivers/net/ethernet/cisco/enic/enic_pp.c b/drivers/net/ethernet/cisco/enic/enic_pp.c index 22bf03a1829e..c347b6236f8f 100644 --- a/drivers/net/ethernet/cisco/enic/enic_pp.c +++ b/drivers/net/ethernet/cisco/enic/enic_pp.c | |||
@@ -72,7 +72,7 @@ static int enic_set_port_profile(struct enic *enic, int vf) | |||
72 | struct enic_port_profile *pp; | 72 | struct enic_port_profile *pp; |
73 | struct vic_provinfo *vp; | 73 | struct vic_provinfo *vp; |
74 | const u8 oui[3] = VIC_PROVINFO_CISCO_OUI; | 74 | const u8 oui[3] = VIC_PROVINFO_CISCO_OUI; |
75 | const u16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX); | 75 | const __be16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX); |
76 | char uuid_str[38]; | 76 | char uuid_str[38]; |
77 | char client_mac_str[18]; | 77 | char client_mac_str[18]; |
78 | u8 *client_mac; | 78 | u8 *client_mac; |
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c index 6db6b6ae5e9b..802e5ddef8a8 100644 --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c | |||
@@ -716,12 +716,8 @@ static int | |||
716 | be_do_flash(struct net_device *netdev, struct ethtool_flash *efl) | 716 | be_do_flash(struct net_device *netdev, struct ethtool_flash *efl) |
717 | { | 717 | { |
718 | struct be_adapter *adapter = netdev_priv(netdev); | 718 | struct be_adapter *adapter = netdev_priv(netdev); |
719 | char file_name[ETHTOOL_FLASH_MAX_FILENAME]; | ||
720 | 719 | ||
721 | file_name[ETHTOOL_FLASH_MAX_FILENAME - 1] = 0; | 720 | return be_load_fw(adapter, efl->data); |
722 | strcpy(file_name, efl->data); | ||
723 | |||
724 | return be_load_fw(adapter, file_name); | ||
725 | } | 721 | } |
726 | 722 | ||
727 | static int | 723 | static int |
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index 7b25e9cf13f6..e92ef1bd732a 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c | |||
@@ -986,11 +986,11 @@ static int fec_enet_mii_probe(struct net_device *ndev) | |||
986 | printk(KERN_INFO | 986 | printk(KERN_INFO |
987 | "%s: no PHY, assuming direct connection to switch\n", | 987 | "%s: no PHY, assuming direct connection to switch\n", |
988 | ndev->name); | 988 | ndev->name); |
989 | strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); | 989 | strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); |
990 | phy_id = 0; | 990 | phy_id = 0; |
991 | } | 991 | } |
992 | 992 | ||
993 | snprintf(phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); | 993 | snprintf(phy_name, sizeof(phy_name), PHY_ID_FMT, mdio_bus_id, phy_id); |
994 | phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, 0, | 994 | phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, 0, |
995 | fep->phy_interface); | 995 | fep->phy_interface); |
996 | if (IS_ERR(phy_dev)) { | 996 | if (IS_ERR(phy_dev)) { |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 5d5fb2627184..e6893cdfd13b 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
@@ -336,7 +336,9 @@ static struct rtnl_link_stats64 *ehea_get_stats64(struct net_device *dev, | |||
336 | stats->tx_bytes = tx_bytes; | 336 | stats->tx_bytes = tx_bytes; |
337 | stats->rx_packets = rx_packets; | 337 | stats->rx_packets = rx_packets; |
338 | 338 | ||
339 | return &port->stats; | 339 | stats->multicast = port->stats.multicast; |
340 | stats->rx_errors = port->stats.rx_errors; | ||
341 | return stats; | ||
340 | } | 342 | } |
341 | 343 | ||
342 | static void ehea_update_stats(struct work_struct *work) | 344 | static void ehea_update_stats(struct work_struct *work) |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 669ca3800c01..d94d64b5d695 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -4740,12 +4740,14 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
4740 | e1000_setup_rctl(adapter); | 4740 | e1000_setup_rctl(adapter); |
4741 | e1000_set_rx_mode(netdev); | 4741 | e1000_set_rx_mode(netdev); |
4742 | 4742 | ||
4743 | rctl = er32(RCTL); | ||
4744 | |||
4743 | /* turn on all-multi mode if wake on multicast is enabled */ | 4745 | /* turn on all-multi mode if wake on multicast is enabled */ |
4744 | if (wufc & E1000_WUFC_MC) { | 4746 | if (wufc & E1000_WUFC_MC) |
4745 | rctl = er32(RCTL); | ||
4746 | rctl |= E1000_RCTL_MPE; | 4747 | rctl |= E1000_RCTL_MPE; |
4747 | ew32(RCTL, rctl); | 4748 | |
4748 | } | 4749 | /* enable receives in the hardware */ |
4750 | ew32(RCTL, rctl | E1000_RCTL_EN); | ||
4749 | 4751 | ||
4750 | if (hw->mac_type >= e1000_82540) { | 4752 | if (hw->mac_type >= e1000_82540) { |
4751 | ctrl = er32(CTRL); | 4753 | ctrl = er32(CTRL); |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index e91d73c8aa4e..94be6c32fa7d 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -5012,7 +5012,8 @@ static int igb_find_enabled_vfs(struct igb_adapter *adapter) | |||
5012 | vf_devfn = pdev->devfn + 0x80; | 5012 | vf_devfn = pdev->devfn + 0x80; |
5013 | pvfdev = pci_get_device(hw->vendor_id, device_id, NULL); | 5013 | pvfdev = pci_get_device(hw->vendor_id, device_id, NULL); |
5014 | while (pvfdev) { | 5014 | while (pvfdev) { |
5015 | if (pvfdev->devfn == vf_devfn) | 5015 | if (pvfdev->devfn == vf_devfn && |
5016 | (pvfdev->bus->number >= pdev->bus->number)) | ||
5016 | vfs_found++; | 5017 | vfs_found++; |
5017 | vf_devfn += vf_stride; | 5018 | vf_devfn += vf_stride; |
5018 | pvfdev = pci_get_device(hw->vendor_id, | 5019 | pvfdev = pci_get_device(hw->vendor_id, |
diff --git a/drivers/net/ethernet/intel/igbvf/Makefile b/drivers/net/ethernet/intel/igbvf/Makefile index 0fa3db3dd8b6..044b0ad5fcb9 100644 --- a/drivers/net/ethernet/intel/igbvf/Makefile +++ b/drivers/net/ethernet/intel/igbvf/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | ################################################################################ | 1 | ################################################################################ |
2 | # | 2 | # |
3 | # Intel(R) 82576 Virtual Function Linux driver | 3 | # Intel(R) 82576 Virtual Function Linux driver |
4 | # Copyright(c) 2009 - 2010 Intel Corporation. | 4 | # Copyright(c) 2009 - 2012 Intel Corporation. |
5 | # | 5 | # |
6 | # This program is free software; you can redistribute it and/or modify it | 6 | # This program is free software; you can redistribute it and/or modify it |
7 | # under the terms and conditions of the GNU General Public License, | 7 | # under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/igbvf/defines.h b/drivers/net/ethernet/intel/igbvf/defines.h index 79f2604673fe..33f40d3474ae 100644 --- a/drivers/net/ethernet/intel/igbvf/defines.h +++ b/drivers/net/ethernet/intel/igbvf/defines.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel(R) 82576 Virtual Function Linux driver | 3 | Intel(R) 82576 Virtual Function Linux driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/igbvf/ethtool.c b/drivers/net/ethernet/intel/igbvf/ethtool.c index 2dba53446064..db7dce2351c2 100644 --- a/drivers/net/ethernet/intel/igbvf/ethtool.c +++ b/drivers/net/ethernet/intel/igbvf/ethtool.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel(R) 82576 Virtual Function Linux driver | 3 | Intel(R) 82576 Virtual Function Linux driver |
4 | Copyright(c) 2009 - 2010 Intel Corporation. | 4 | Copyright(c) 2009 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/igbvf/igbvf.h b/drivers/net/ethernet/intel/igbvf/igbvf.h index fd4a7b780fdd..2c6d87e4d3d9 100644 --- a/drivers/net/ethernet/intel/igbvf/igbvf.h +++ b/drivers/net/ethernet/intel/igbvf/igbvf.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel(R) 82576 Virtual Function Linux driver | 3 | Intel(R) 82576 Virtual Function Linux driver |
4 | Copyright(c) 2009 - 2010 Intel Corporation. | 4 | Copyright(c) 2009 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/igbvf/mbx.c b/drivers/net/ethernet/intel/igbvf/mbx.c index 048aae248d06..b4b65bc9fc5d 100644 --- a/drivers/net/ethernet/intel/igbvf/mbx.c +++ b/drivers/net/ethernet/intel/igbvf/mbx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel(R) 82576 Virtual Function Linux driver | 3 | Intel(R) 82576 Virtual Function Linux driver |
4 | Copyright(c) 2009 - 2010 Intel Corporation. | 4 | Copyright(c) 2009 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/igbvf/mbx.h b/drivers/net/ethernet/intel/igbvf/mbx.h index c2883c45d477..24370bcb0e22 100644 --- a/drivers/net/ethernet/intel/igbvf/mbx.h +++ b/drivers/net/ethernet/intel/igbvf/mbx.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel(R) 82576 Virtual Function Linux driver | 3 | Intel(R) 82576 Virtual Function Linux driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index a4b20c865759..4e9141cfe81d 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel(R) 82576 Virtual Function Linux driver | 3 | Intel(R) 82576 Virtual Function Linux driver |
4 | Copyright(c) 2009 - 2010 Intel Corporation. | 4 | Copyright(c) 2009 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -53,7 +53,7 @@ const char igbvf_driver_version[] = DRV_VERSION; | |||
53 | static const char igbvf_driver_string[] = | 53 | static const char igbvf_driver_string[] = |
54 | "Intel(R) Gigabit Virtual Function Network Driver"; | 54 | "Intel(R) Gigabit Virtual Function Network Driver"; |
55 | static const char igbvf_copyright[] = | 55 | static const char igbvf_copyright[] = |
56 | "Copyright (c) 2009 - 2011 Intel Corporation."; | 56 | "Copyright (c) 2009 - 2012 Intel Corporation."; |
57 | 57 | ||
58 | static int igbvf_poll(struct napi_struct *napi, int budget); | 58 | static int igbvf_poll(struct napi_struct *napi, int budget); |
59 | static void igbvf_reset(struct igbvf_adapter *); | 59 | static void igbvf_reset(struct igbvf_adapter *); |
diff --git a/drivers/net/ethernet/intel/igbvf/regs.h b/drivers/net/ethernet/intel/igbvf/regs.h index 77e18d3d6b15..7dc6341715dc 100644 --- a/drivers/net/ethernet/intel/igbvf/regs.h +++ b/drivers/net/ethernet/intel/igbvf/regs.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel(R) 82576 Virtual Function Linux driver | 3 | Intel(R) 82576 Virtual Function Linux driver |
4 | Copyright(c) 2009 - 2010 Intel Corporation. | 4 | Copyright(c) 2009 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/igbvf/vf.c b/drivers/net/ethernet/intel/igbvf/vf.c index af3822f9ea9a..19551977b352 100644 --- a/drivers/net/ethernet/intel/igbvf/vf.c +++ b/drivers/net/ethernet/intel/igbvf/vf.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel(R) 82576 Virtual Function Linux driver | 3 | Intel(R) 82576 Virtual Function Linux driver |
4 | Copyright(c) 2009 - 2010 Intel Corporation. | 4 | Copyright(c) 2009 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/igbvf/vf.h b/drivers/net/ethernet/intel/igbvf/vf.h index d7ed58fcd9bb..57db3c68dfcd 100644 --- a/drivers/net/ethernet/intel/igbvf/vf.h +++ b/drivers/net/ethernet/intel/igbvf/vf.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel(R) 82576 Virtual Function Linux driver | 3 | Intel(R) 82576 Virtual Function Linux driver |
4 | Copyright(c) 2009 - 2010 Intel Corporation. | 4 | Copyright(c) 2009 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/Makefile b/drivers/net/ethernet/intel/ixgbe/Makefile index 7d7387fbdecd..7a16177a12a5 100644 --- a/drivers/net/ethernet/intel/ixgbe/Makefile +++ b/drivers/net/ethernet/intel/ixgbe/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | ################################################################################ | 1 | ################################################################################ |
2 | # | 2 | # |
3 | # Intel 10 Gigabit PCI Express Linux driver | 3 | # Intel 10 Gigabit PCI Express Linux driver |
4 | # Copyright(c) 1999 - 2010 Intel Corporation. | 4 | # Copyright(c) 1999 - 2012 Intel Corporation. |
5 | # | 5 | # |
6 | # This program is free software; you can redistribute it and/or modify it | 6 | # This program is free software; you can redistribute it and/or modify it |
7 | # under the terms and conditions of the GNU General Public License, | 7 | # under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index 258164d6d45a..e6aeb64105a4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c index ef2afefb0cd4..b406c367b190 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c index 772072147bea..4e59083a3de2 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c index a3aa6333073f..383b9413292e 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h index 863f9c1f145b..2c834c46bba1 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -75,7 +75,7 @@ s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, | |||
75 | s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw); | 75 | s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw); |
76 | s32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw); | 76 | s32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw); |
77 | s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval); | 77 | s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval); |
78 | s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packtetbuf_num); | 78 | s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packetbuf_num); |
79 | s32 ixgbe_fc_autoneg(struct ixgbe_hw *hw); | 79 | s32 ixgbe_fc_autoneg(struct ixgbe_hw *hw); |
80 | 80 | ||
81 | s32 ixgbe_validate_mac_addr(u8 *mac_addr); | 81 | s32 ixgbe_validate_mac_addr(u8 *mac_addr); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c index 318caf4bf623..8bfaaee5ac5b 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.h index e162775064da..24333b718166 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c index fcd0e479721f..d3695edfcb8b 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.h index 2f318935561a..ba835708fcac 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c index 32cd97bc794d..888a419dc3d9 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.h index a59d5dc59d04..4dec47faeb00 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c index da31735311f1..79a92fe987b9 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -112,6 +112,8 @@ static u8 ixgbe_dcbnl_get_state(struct net_device *netdev) | |||
112 | static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | 112 | static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) |
113 | { | 113 | { |
114 | u8 err = 0; | 114 | u8 err = 0; |
115 | u8 prio_tc[MAX_USER_PRIORITY] = {0}; | ||
116 | int i; | ||
115 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 117 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
116 | 118 | ||
117 | /* Fail command if not in CEE mode */ | 119 | /* Fail command if not in CEE mode */ |
@@ -122,10 +124,15 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
122 | if (!!state != !(adapter->flags & IXGBE_FLAG_DCB_ENABLED)) | 124 | if (!!state != !(adapter->flags & IXGBE_FLAG_DCB_ENABLED)) |
123 | return err; | 125 | return err; |
124 | 126 | ||
125 | if (state > 0) | 127 | if (state > 0) { |
126 | err = ixgbe_setup_tc(netdev, adapter->dcb_cfg.num_tcs.pg_tcs); | 128 | err = ixgbe_setup_tc(netdev, adapter->dcb_cfg.num_tcs.pg_tcs); |
127 | else | 129 | ixgbe_dcb_unpack_map(&adapter->dcb_cfg, DCB_TX_CONFIG, prio_tc); |
130 | } else { | ||
128 | err = ixgbe_setup_tc(netdev, 0); | 131 | err = ixgbe_setup_tc(netdev, 0); |
132 | } | ||
133 | |||
134 | for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) | ||
135 | netdev_set_prio_tc_map(netdev, i, prio_tc[i]); | ||
129 | 136 | ||
130 | return err; | 137 | return err; |
131 | } | 138 | } |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index da7e580f517a..a62975480e37 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -58,7 +58,7 @@ struct ixgbe_stats { | |||
58 | sizeof(((struct rtnl_link_stats64 *)0)->m), \ | 58 | sizeof(((struct rtnl_link_stats64 *)0)->m), \ |
59 | offsetof(struct rtnl_link_stats64, m) | 59 | offsetof(struct rtnl_link_stats64, m) |
60 | 60 | ||
61 | static struct ixgbe_stats ixgbe_gstrings_stats[] = { | 61 | static const struct ixgbe_stats ixgbe_gstrings_stats[] = { |
62 | {"rx_packets", IXGBE_NETDEV_STAT(rx_packets)}, | 62 | {"rx_packets", IXGBE_NETDEV_STAT(rx_packets)}, |
63 | {"tx_packets", IXGBE_NETDEV_STAT(tx_packets)}, | 63 | {"tx_packets", IXGBE_NETDEV_STAT(tx_packets)}, |
64 | {"rx_bytes", IXGBE_NETDEV_STAT(rx_bytes)}, | 64 | {"rx_bytes", IXGBE_NETDEV_STAT(rx_bytes)}, |
@@ -120,19 +120,23 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = { | |||
120 | #endif /* IXGBE_FCOE */ | 120 | #endif /* IXGBE_FCOE */ |
121 | }; | 121 | }; |
122 | 122 | ||
123 | #define IXGBE_QUEUE_STATS_LEN \ | 123 | /* ixgbe allocates num_tx_queues and num_rx_queues symmetrically so |
124 | ((((struct ixgbe_adapter *)netdev_priv(netdev))->num_tx_queues + \ | 124 | * we set the num_rx_queues to evaluate to num_tx_queues. This is |
125 | ((struct ixgbe_adapter *)netdev_priv(netdev))->num_rx_queues) * \ | 125 | * used because we do not have a good way to get the max number of |
126 | * rx queues with CONFIG_RPS disabled. | ||
127 | */ | ||
128 | #define IXGBE_NUM_RX_QUEUES netdev->num_tx_queues | ||
129 | |||
130 | #define IXGBE_QUEUE_STATS_LEN ( \ | ||
131 | (netdev->num_tx_queues + IXGBE_NUM_RX_QUEUES) * \ | ||
126 | (sizeof(struct ixgbe_queue_stats) / sizeof(u64))) | 132 | (sizeof(struct ixgbe_queue_stats) / sizeof(u64))) |
127 | #define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats) | 133 | #define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats) |
128 | #define IXGBE_PB_STATS_LEN ( \ | 134 | #define IXGBE_PB_STATS_LEN ( \ |
129 | (((struct ixgbe_adapter *)netdev_priv(netdev))->flags & \ | 135 | (sizeof(((struct ixgbe_adapter *)0)->stats.pxonrxc) + \ |
130 | IXGBE_FLAG_DCB_ENABLED) ? \ | 136 | sizeof(((struct ixgbe_adapter *)0)->stats.pxontxc) + \ |
131 | (sizeof(((struct ixgbe_adapter *)0)->stats.pxonrxc) + \ | 137 | sizeof(((struct ixgbe_adapter *)0)->stats.pxoffrxc) + \ |
132 | sizeof(((struct ixgbe_adapter *)0)->stats.pxontxc) + \ | 138 | sizeof(((struct ixgbe_adapter *)0)->stats.pxofftxc)) \ |
133 | sizeof(((struct ixgbe_adapter *)0)->stats.pxoffrxc) + \ | 139 | / sizeof(u64)) |
134 | sizeof(((struct ixgbe_adapter *)0)->stats.pxofftxc)) \ | ||
135 | / sizeof(u64) : 0) | ||
136 | #define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + \ | 140 | #define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + \ |
137 | IXGBE_PB_STATS_LEN + \ | 141 | IXGBE_PB_STATS_LEN + \ |
138 | IXGBE_QUEUE_STATS_LEN) | 142 | IXGBE_QUEUE_STATS_LEN) |
@@ -1078,8 +1082,15 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev, | |||
1078 | data[i] = (ixgbe_gstrings_stats[i].sizeof_stat == | 1082 | data[i] = (ixgbe_gstrings_stats[i].sizeof_stat == |
1079 | sizeof(u64)) ? *(u64 *)p : *(u32 *)p; | 1083 | sizeof(u64)) ? *(u64 *)p : *(u32 *)p; |
1080 | } | 1084 | } |
1081 | for (j = 0; j < adapter->num_tx_queues; j++) { | 1085 | for (j = 0; j < IXGBE_NUM_RX_QUEUES; j++) { |
1082 | ring = adapter->tx_ring[j]; | 1086 | ring = adapter->tx_ring[j]; |
1087 | if (!ring) { | ||
1088 | data[i] = 0; | ||
1089 | data[i+1] = 0; | ||
1090 | i += 2; | ||
1091 | continue; | ||
1092 | } | ||
1093 | |||
1083 | do { | 1094 | do { |
1084 | start = u64_stats_fetch_begin_bh(&ring->syncp); | 1095 | start = u64_stats_fetch_begin_bh(&ring->syncp); |
1085 | data[i] = ring->stats.packets; | 1096 | data[i] = ring->stats.packets; |
@@ -1087,8 +1098,15 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev, | |||
1087 | } while (u64_stats_fetch_retry_bh(&ring->syncp, start)); | 1098 | } while (u64_stats_fetch_retry_bh(&ring->syncp, start)); |
1088 | i += 2; | 1099 | i += 2; |
1089 | } | 1100 | } |
1090 | for (j = 0; j < adapter->num_rx_queues; j++) { | 1101 | for (j = 0; j < IXGBE_NUM_RX_QUEUES; j++) { |
1091 | ring = adapter->rx_ring[j]; | 1102 | ring = adapter->rx_ring[j]; |
1103 | if (!ring) { | ||
1104 | data[i] = 0; | ||
1105 | data[i+1] = 0; | ||
1106 | i += 2; | ||
1107 | continue; | ||
1108 | } | ||
1109 | |||
1092 | do { | 1110 | do { |
1093 | start = u64_stats_fetch_begin_bh(&ring->syncp); | 1111 | start = u64_stats_fetch_begin_bh(&ring->syncp); |
1094 | data[i] = ring->stats.packets; | 1112 | data[i] = ring->stats.packets; |
@@ -1096,22 +1114,20 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev, | |||
1096 | } while (u64_stats_fetch_retry_bh(&ring->syncp, start)); | 1114 | } while (u64_stats_fetch_retry_bh(&ring->syncp, start)); |
1097 | i += 2; | 1115 | i += 2; |
1098 | } | 1116 | } |
1099 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 1117 | |
1100 | for (j = 0; j < MAX_TX_PACKET_BUFFERS; j++) { | 1118 | for (j = 0; j < IXGBE_MAX_PACKET_BUFFERS; j++) { |
1101 | data[i++] = adapter->stats.pxontxc[j]; | 1119 | data[i++] = adapter->stats.pxontxc[j]; |
1102 | data[i++] = adapter->stats.pxofftxc[j]; | 1120 | data[i++] = adapter->stats.pxofftxc[j]; |
1103 | } | 1121 | } |
1104 | for (j = 0; j < MAX_RX_PACKET_BUFFERS; j++) { | 1122 | for (j = 0; j < IXGBE_MAX_PACKET_BUFFERS; j++) { |
1105 | data[i++] = adapter->stats.pxonrxc[j]; | 1123 | data[i++] = adapter->stats.pxonrxc[j]; |
1106 | data[i++] = adapter->stats.pxoffrxc[j]; | 1124 | data[i++] = adapter->stats.pxoffrxc[j]; |
1107 | } | ||
1108 | } | 1125 | } |
1109 | } | 1126 | } |
1110 | 1127 | ||
1111 | static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, | 1128 | static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, |
1112 | u8 *data) | 1129 | u8 *data) |
1113 | { | 1130 | { |
1114 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1115 | char *p = (char *)data; | 1131 | char *p = (char *)data; |
1116 | int i; | 1132 | int i; |
1117 | 1133 | ||
@@ -1126,31 +1142,29 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, | |||
1126 | ETH_GSTRING_LEN); | 1142 | ETH_GSTRING_LEN); |
1127 | p += ETH_GSTRING_LEN; | 1143 | p += ETH_GSTRING_LEN; |
1128 | } | 1144 | } |
1129 | for (i = 0; i < adapter->num_tx_queues; i++) { | 1145 | for (i = 0; i < netdev->num_tx_queues; i++) { |
1130 | sprintf(p, "tx_queue_%u_packets", i); | 1146 | sprintf(p, "tx_queue_%u_packets", i); |
1131 | p += ETH_GSTRING_LEN; | 1147 | p += ETH_GSTRING_LEN; |
1132 | sprintf(p, "tx_queue_%u_bytes", i); | 1148 | sprintf(p, "tx_queue_%u_bytes", i); |
1133 | p += ETH_GSTRING_LEN; | 1149 | p += ETH_GSTRING_LEN; |
1134 | } | 1150 | } |
1135 | for (i = 0; i < adapter->num_rx_queues; i++) { | 1151 | for (i = 0; i < IXGBE_NUM_RX_QUEUES; i++) { |
1136 | sprintf(p, "rx_queue_%u_packets", i); | 1152 | sprintf(p, "rx_queue_%u_packets", i); |
1137 | p += ETH_GSTRING_LEN; | 1153 | p += ETH_GSTRING_LEN; |
1138 | sprintf(p, "rx_queue_%u_bytes", i); | 1154 | sprintf(p, "rx_queue_%u_bytes", i); |
1139 | p += ETH_GSTRING_LEN; | 1155 | p += ETH_GSTRING_LEN; |
1140 | } | 1156 | } |
1141 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 1157 | for (i = 0; i < IXGBE_MAX_PACKET_BUFFERS; i++) { |
1142 | for (i = 0; i < MAX_TX_PACKET_BUFFERS; i++) { | 1158 | sprintf(p, "tx_pb_%u_pxon", i); |
1143 | sprintf(p, "tx_pb_%u_pxon", i); | 1159 | p += ETH_GSTRING_LEN; |
1144 | p += ETH_GSTRING_LEN; | 1160 | sprintf(p, "tx_pb_%u_pxoff", i); |
1145 | sprintf(p, "tx_pb_%u_pxoff", i); | 1161 | p += ETH_GSTRING_LEN; |
1146 | p += ETH_GSTRING_LEN; | 1162 | } |
1147 | } | 1163 | for (i = 0; i < IXGBE_MAX_PACKET_BUFFERS; i++) { |
1148 | for (i = 0; i < MAX_RX_PACKET_BUFFERS; i++) { | 1164 | sprintf(p, "rx_pb_%u_pxon", i); |
1149 | sprintf(p, "rx_pb_%u_pxon", i); | 1165 | p += ETH_GSTRING_LEN; |
1150 | p += ETH_GSTRING_LEN; | 1166 | sprintf(p, "rx_pb_%u_pxoff", i); |
1151 | sprintf(p, "rx_pb_%u_pxoff", i); | 1167 | p += ETH_GSTRING_LEN; |
1152 | p += ETH_GSTRING_LEN; | ||
1153 | } | ||
1154 | } | 1168 | } |
1155 | /* BUG_ON(p - data != IXGBE_STATS_LEN * ETH_GSTRING_LEN); */ | 1169 | /* BUG_ON(p - data != IXGBE_STATS_LEN * ETH_GSTRING_LEN); */ |
1156 | break; | 1170 | break; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c index d18d6157dd2c..4bc794249801 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h index 261fd62dda18..1dbed17c8107 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 1ee5d0fbb905..3dc6cef58107 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -64,7 +64,7 @@ char ixgbe_default_device_descr[] = | |||
64 | __stringify(BUILD) "-k" | 64 | __stringify(BUILD) "-k" |
65 | const char ixgbe_driver_version[] = DRV_VERSION; | 65 | const char ixgbe_driver_version[] = DRV_VERSION; |
66 | static const char ixgbe_copyright[] = | 66 | static const char ixgbe_copyright[] = |
67 | "Copyright (c) 1999-2011 Intel Corporation."; | 67 | "Copyright (c) 1999-2012 Intel Corporation."; |
68 | 68 | ||
69 | static const struct ixgbe_info *ixgbe_info_tbl[] = { | 69 | static const struct ixgbe_info *ixgbe_info_tbl[] = { |
70 | [board_82598] = &ixgbe_82598_info, | 70 | [board_82598] = &ixgbe_82598_info, |
@@ -2633,22 +2633,22 @@ static void ixgbe_configure_rscctl(struct ixgbe_adapter *adapter, | |||
2633 | /* | 2633 | /* |
2634 | * we must limit the number of descriptors so that the | 2634 | * we must limit the number of descriptors so that the |
2635 | * total size of max desc * buf_len is not greater | 2635 | * total size of max desc * buf_len is not greater |
2636 | * than 65535 | 2636 | * than 65536 |
2637 | */ | 2637 | */ |
2638 | if (ring_is_ps_enabled(ring)) { | 2638 | if (ring_is_ps_enabled(ring)) { |
2639 | #if (MAX_SKB_FRAGS > 16) | 2639 | #if (PAGE_SIZE < 8192) |
2640 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; | 2640 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; |
2641 | #elif (MAX_SKB_FRAGS > 8) | 2641 | #elif (PAGE_SIZE < 16384) |
2642 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; | 2642 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; |
2643 | #elif (MAX_SKB_FRAGS > 4) | 2643 | #elif (PAGE_SIZE < 32768) |
2644 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; | 2644 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; |
2645 | #else | 2645 | #else |
2646 | rscctrl |= IXGBE_RSCCTL_MAXDESC_1; | 2646 | rscctrl |= IXGBE_RSCCTL_MAXDESC_1; |
2647 | #endif | 2647 | #endif |
2648 | } else { | 2648 | } else { |
2649 | if (rx_buf_len < IXGBE_RXBUFFER_4K) | 2649 | if (rx_buf_len <= IXGBE_RXBUFFER_4K) |
2650 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; | 2650 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; |
2651 | else if (rx_buf_len < IXGBE_RXBUFFER_8K) | 2651 | else if (rx_buf_len <= IXGBE_RXBUFFER_8K) |
2652 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; | 2652 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; |
2653 | else | 2653 | else |
2654 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; | 2654 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; |
@@ -2830,7 +2830,7 @@ static void ixgbe_configure_virtualization(struct ixgbe_adapter *adapter) | |||
2830 | IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vmdctl | vt_reg_bits); | 2830 | IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vmdctl | vt_reg_bits); |
2831 | 2831 | ||
2832 | vf_shift = adapter->num_vfs % 32; | 2832 | vf_shift = adapter->num_vfs % 32; |
2833 | reg_offset = (adapter->num_vfs > 32) ? 1 : 0; | 2833 | reg_offset = (adapter->num_vfs >= 32) ? 1 : 0; |
2834 | 2834 | ||
2835 | /* Enable only the PF's pool for Tx/Rx */ | 2835 | /* Enable only the PF's pool for Tx/Rx */ |
2836 | IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), (1 << vf_shift)); | 2836 | IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), (1 << vf_shift)); |
@@ -4330,6 +4330,10 @@ static int ixgbe_set_num_queues(struct ixgbe_adapter *adapter) | |||
4330 | adapter->num_tx_queues = 1; | 4330 | adapter->num_tx_queues = 1; |
4331 | 4331 | ||
4332 | done: | 4332 | done: |
4333 | if ((adapter->netdev->reg_state == NETREG_UNREGISTERED) || | ||
4334 | (adapter->netdev->reg_state == NETREG_UNREGISTERING)) | ||
4335 | return 0; | ||
4336 | |||
4333 | /* Notify the stack of the (possibly) reduced queue counts. */ | 4337 | /* Notify the stack of the (possibly) reduced queue counts. */ |
4334 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); | 4338 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); |
4335 | return netif_set_real_num_rx_queues(adapter->netdev, | 4339 | return netif_set_real_num_rx_queues(adapter->netdev, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c index 3f725d48336d..1f3e32b576a5 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h index b239bdac38da..310bdd961075 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c index 7cf1e1f56c69..b91773551a38 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h index 197bdd13106a..cc18165b4c05 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index cf6812dd1436..b01ecb4d2bb1 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -67,7 +67,8 @@ static int ixgbe_find_enabled_vfs(struct ixgbe_adapter *adapter) | |||
67 | vf_devfn = pdev->devfn + 0x80; | 67 | vf_devfn = pdev->devfn + 0x80; |
68 | pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL); | 68 | pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL); |
69 | while (pvfdev) { | 69 | while (pvfdev) { |
70 | if (pvfdev->devfn == vf_devfn) | 70 | if (pvfdev->devfn == vf_devfn && |
71 | (pvfdev->bus->number >= pdev->bus->number)) | ||
71 | vfs_found++; | 72 | vfs_found++; |
72 | vf_devfn += 2; | 73 | vf_devfn += 2; |
73 | pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, | 74 | pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, |
@@ -646,6 +647,9 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) | |||
646 | ixgbe_ndo_set_vf_spoofchk(adapter->netdev, vf, false); | 647 | ixgbe_ndo_set_vf_spoofchk(adapter->netdev, vf, false); |
647 | retval = ixgbe_set_vf_macvlan(adapter, vf, index, | 648 | retval = ixgbe_set_vf_macvlan(adapter, vf, index, |
648 | (unsigned char *)(&msgbuf[1])); | 649 | (unsigned char *)(&msgbuf[1])); |
650 | if (retval == -ENOSPC) | ||
651 | e_warn(drv, "VF %d has requested a MACVLAN filter " | ||
652 | "but there is no space for it\n", vf); | ||
649 | break; | 653 | break; |
650 | default: | 654 | default: |
651 | e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]); | 655 | e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h index e8badab03359..2ab38d5fda92 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h index 775602ef90e5..9b95bef60970 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c index 8cc5eccfd651..f838a2be8cfb 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbevf/Makefile b/drivers/net/ethernet/intel/ixgbevf/Makefile index 1f35d229e71a..4ce4c97ef5ad 100644 --- a/drivers/net/ethernet/intel/ixgbevf/Makefile +++ b/drivers/net/ethernet/intel/ixgbevf/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | ################################################################################ | 1 | ################################################################################ |
2 | # | 2 | # |
3 | # Intel 82599 Virtual Function driver | 3 | # Intel 82599 Virtual Function driver |
4 | # Copyright(c) 1999 - 2010 Intel Corporation. | 4 | # Copyright(c) 1999 - 2012 Intel Corporation. |
5 | # | 5 | # |
6 | # This program is free software; you can redistribute it and/or modify it | 6 | # This program is free software; you can redistribute it and/or modify it |
7 | # under the terms and conditions of the GNU General Public License, | 7 | # under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbevf/defines.h b/drivers/net/ethernet/intel/ixgbevf/defines.h index 2eb89cb94a0d..947b5c830735 100644 --- a/drivers/net/ethernet/intel/ixgbevf/defines.h +++ b/drivers/net/ethernet/intel/ixgbevf/defines.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c index c85700318147..2bfe0d1d7958 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c +++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h index 9075c1d61039..dfed420a1bf6 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index bed411bada21..e51d552410ae 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -60,7 +60,7 @@ static const char ixgbevf_driver_string[] = | |||
60 | #define DRV_VERSION "2.2.0-k" | 60 | #define DRV_VERSION "2.2.0-k" |
61 | const char ixgbevf_driver_version[] = DRV_VERSION; | 61 | const char ixgbevf_driver_version[] = DRV_VERSION; |
62 | static char ixgbevf_copyright[] = | 62 | static char ixgbevf_copyright[] = |
63 | "Copyright (c) 2009 - 2010 Intel Corporation."; | 63 | "Copyright (c) 2009 - 2012 Intel Corporation."; |
64 | 64 | ||
65 | static const struct ixgbevf_info *ixgbevf_info_tbl[] = { | 65 | static const struct ixgbevf_info *ixgbevf_info_tbl[] = { |
66 | [board_82599_vf] = &ixgbevf_82599_vf_info, | 66 | [board_82599_vf] = &ixgbevf_82599_vf_info, |
@@ -935,7 +935,11 @@ static irqreturn_t ixgbevf_msix_mbx(int irq, void *data) | |||
935 | if (msg & IXGBE_VT_MSGTYPE_NACK) | 935 | if (msg & IXGBE_VT_MSGTYPE_NACK) |
936 | pr_warn("Last Request of type %2.2x to PF Nacked\n", | 936 | pr_warn("Last Request of type %2.2x to PF Nacked\n", |
937 | msg & 0xFF); | 937 | msg & 0xFF); |
938 | goto out; | 938 | /* |
939 | * Restore the PFSTS bit in case someone is polling for a | ||
940 | * return message from the PF | ||
941 | */ | ||
942 | hw->mbx.v2p_mailbox |= IXGBE_VFMAILBOX_PFSTS; | ||
939 | } | 943 | } |
940 | 944 | ||
941 | /* | 945 | /* |
@@ -945,7 +949,7 @@ static irqreturn_t ixgbevf_msix_mbx(int irq, void *data) | |||
945 | */ | 949 | */ |
946 | if (got_ack) | 950 | if (got_ack) |
947 | hw->mbx.v2p_mailbox |= IXGBE_VFMAILBOX_PFACK; | 951 | hw->mbx.v2p_mailbox |= IXGBE_VFMAILBOX_PFACK; |
948 | out: | 952 | |
949 | return IRQ_HANDLED; | 953 | return IRQ_HANDLED; |
950 | } | 954 | } |
951 | 955 | ||
diff --git a/drivers/net/ethernet/intel/ixgbevf/mbx.c b/drivers/net/ethernet/intel/ixgbevf/mbx.c index 13532d9ba72d..9c955900fe64 100644 --- a/drivers/net/ethernet/intel/ixgbevf/mbx.c +++ b/drivers/net/ethernet/intel/ixgbevf/mbx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbevf/mbx.h b/drivers/net/ethernet/intel/ixgbevf/mbx.h index 9d38a94a348a..cf9131c5c115 100644 --- a/drivers/net/ethernet/intel/ixgbevf/mbx.h +++ b/drivers/net/ethernet/intel/ixgbevf/mbx.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbevf/regs.h b/drivers/net/ethernet/intel/ixgbevf/regs.h index 5e4d5e5cdf38..debd8c0e1f28 100644 --- a/drivers/net/ethernet/intel/ixgbevf/regs.h +++ b/drivers/net/ethernet/intel/ixgbevf/regs.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c index d0138d7a31a1..74be7411242a 100644 --- a/drivers/net/ethernet/intel/ixgbevf/vf.c +++ b/drivers/net/ethernet/intel/ixgbevf/vf.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -283,6 +283,17 @@ static s32 ixgbevf_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, | |||
283 | return ret_val; | 283 | return ret_val; |
284 | } | 284 | } |
285 | 285 | ||
286 | static void ixgbevf_write_msg_read_ack(struct ixgbe_hw *hw, | ||
287 | u32 *msg, u16 size) | ||
288 | { | ||
289 | struct ixgbe_mbx_info *mbx = &hw->mbx; | ||
290 | u32 retmsg[IXGBE_VFMAILBOX_SIZE]; | ||
291 | s32 retval = mbx->ops.write_posted(hw, msg, size); | ||
292 | |||
293 | if (!retval) | ||
294 | mbx->ops.read_posted(hw, retmsg, size); | ||
295 | } | ||
296 | |||
286 | /** | 297 | /** |
287 | * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses | 298 | * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses |
288 | * @hw: pointer to the HW structure | 299 | * @hw: pointer to the HW structure |
@@ -294,7 +305,6 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, | |||
294 | struct net_device *netdev) | 305 | struct net_device *netdev) |
295 | { | 306 | { |
296 | struct netdev_hw_addr *ha; | 307 | struct netdev_hw_addr *ha; |
297 | struct ixgbe_mbx_info *mbx = &hw->mbx; | ||
298 | u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; | 308 | u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; |
299 | u16 *vector_list = (u16 *)&msgbuf[1]; | 309 | u16 *vector_list = (u16 *)&msgbuf[1]; |
300 | u32 cnt, i; | 310 | u32 cnt, i; |
@@ -321,7 +331,7 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, | |||
321 | vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr); | 331 | vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr); |
322 | } | 332 | } |
323 | 333 | ||
324 | mbx->ops.write_posted(hw, msgbuf, IXGBE_VFMAILBOX_SIZE); | 334 | ixgbevf_write_msg_read_ack(hw, msgbuf, IXGBE_VFMAILBOX_SIZE); |
325 | 335 | ||
326 | return 0; | 336 | return 0; |
327 | } | 337 | } |
@@ -336,7 +346,6 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, | |||
336 | static s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, | 346 | static s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, |
337 | bool vlan_on) | 347 | bool vlan_on) |
338 | { | 348 | { |
339 | struct ixgbe_mbx_info *mbx = &hw->mbx; | ||
340 | u32 msgbuf[2]; | 349 | u32 msgbuf[2]; |
341 | 350 | ||
342 | msgbuf[0] = IXGBE_VF_SET_VLAN; | 351 | msgbuf[0] = IXGBE_VF_SET_VLAN; |
@@ -344,7 +353,9 @@ static s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, | |||
344 | /* Setting the 8 bit field MSG INFO to TRUE indicates "add" */ | 353 | /* Setting the 8 bit field MSG INFO to TRUE indicates "add" */ |
345 | msgbuf[0] |= vlan_on << IXGBE_VT_MSGINFO_SHIFT; | 354 | msgbuf[0] |= vlan_on << IXGBE_VT_MSGINFO_SHIFT; |
346 | 355 | ||
347 | return mbx->ops.write_posted(hw, msgbuf, 2); | 356 | ixgbevf_write_msg_read_ack(hw, msgbuf, 2); |
357 | |||
358 | return 0; | ||
348 | } | 359 | } |
349 | 360 | ||
350 | /** | 361 | /** |
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.h b/drivers/net/ethernet/intel/ixgbevf/vf.h index d556619a9212..25c951daee5d 100644 --- a/drivers/net/ethernet/intel/ixgbevf/vf.h +++ b/drivers/net/ethernet/intel/ixgbevf/vf.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index 27d651a80f3f..55cbf65512c3 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c | |||
@@ -2328,19 +2328,11 @@ jme_change_mtu(struct net_device *netdev, int new_mtu) | |||
2328 | ((new_mtu) < IPV6_MIN_MTU)) | 2328 | ((new_mtu) < IPV6_MIN_MTU)) |
2329 | return -EINVAL; | 2329 | return -EINVAL; |
2330 | 2330 | ||
2331 | if (new_mtu > 4000) { | ||
2332 | jme->reg_rxcs &= ~RXCS_FIFOTHNP; | ||
2333 | jme->reg_rxcs |= RXCS_FIFOTHNP_64QW; | ||
2334 | jme_restart_rx_engine(jme); | ||
2335 | } else { | ||
2336 | jme->reg_rxcs &= ~RXCS_FIFOTHNP; | ||
2337 | jme->reg_rxcs |= RXCS_FIFOTHNP_128QW; | ||
2338 | jme_restart_rx_engine(jme); | ||
2339 | } | ||
2340 | 2331 | ||
2341 | netdev->mtu = new_mtu; | 2332 | netdev->mtu = new_mtu; |
2342 | netdev_update_features(netdev); | 2333 | netdev_update_features(netdev); |
2343 | 2334 | ||
2335 | jme_restart_rx_engine(jme); | ||
2344 | jme_reset_link(jme); | 2336 | jme_reset_link(jme); |
2345 | 2337 | ||
2346 | return 0; | 2338 | return 0; |
diff --git a/drivers/net/ethernet/jme.h b/drivers/net/ethernet/jme.h index 4304072bd3c5..3efc897c9913 100644 --- a/drivers/net/ethernet/jme.h +++ b/drivers/net/ethernet/jme.h | |||
@@ -730,7 +730,7 @@ enum jme_rxcs_values { | |||
730 | RXCS_RETRYCNT_60 = 0x00000F00, | 730 | RXCS_RETRYCNT_60 = 0x00000F00, |
731 | 731 | ||
732 | RXCS_DEFAULT = RXCS_FIFOTHTP_128T | | 732 | RXCS_DEFAULT = RXCS_FIFOTHTP_128T | |
733 | RXCS_FIFOTHNP_128QW | | 733 | RXCS_FIFOTHNP_16QW | |
734 | RXCS_DMAREQSZ_128B | | 734 | RXCS_DMAREQSZ_128B | |
735 | RXCS_RETRYGAP_256ns | | 735 | RXCS_RETRYGAP_256ns | |
736 | RXCS_RETRYCNT_32, | 736 | RXCS_RETRYCNT_32, |
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c index edb9bda55d55..33947ac595c0 100644 --- a/drivers/net/ethernet/marvell/skge.c +++ b/drivers/net/ethernet/marvell/skge.c | |||
@@ -931,20 +931,17 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u32 base) | |||
931 | } | 931 | } |
932 | 932 | ||
933 | /* Allocate and setup a new buffer for receiving */ | 933 | /* Allocate and setup a new buffer for receiving */ |
934 | static int skge_rx_setup(struct pci_dev *pdev, | 934 | static void skge_rx_setup(struct skge_port *skge, struct skge_element *e, |
935 | struct skge_element *e, | 935 | struct sk_buff *skb, unsigned int bufsize) |
936 | struct sk_buff *skb, unsigned int bufsize) | ||
937 | { | 936 | { |
938 | struct skge_rx_desc *rd = e->desc; | 937 | struct skge_rx_desc *rd = e->desc; |
939 | dma_addr_t map; | 938 | u64 map; |
940 | 939 | ||
941 | map = pci_map_single(pdev, skb->data, bufsize, | 940 | map = pci_map_single(skge->hw->pdev, skb->data, bufsize, |
942 | PCI_DMA_FROMDEVICE); | 941 | PCI_DMA_FROMDEVICE); |
943 | if (pci_dma_mapping_error(pdev, map)) | ||
944 | goto mapping_error; | ||
945 | 942 | ||
946 | rd->dma_lo = lower_32_bits(map); | 943 | rd->dma_lo = map; |
947 | rd->dma_hi = upper_32_bits(map); | 944 | rd->dma_hi = map >> 32; |
948 | e->skb = skb; | 945 | e->skb = skb; |
949 | rd->csum1_start = ETH_HLEN; | 946 | rd->csum1_start = ETH_HLEN; |
950 | rd->csum2_start = ETH_HLEN; | 947 | rd->csum2_start = ETH_HLEN; |
@@ -956,13 +953,6 @@ static int skge_rx_setup(struct pci_dev *pdev, | |||
956 | rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize; | 953 | rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize; |
957 | dma_unmap_addr_set(e, mapaddr, map); | 954 | dma_unmap_addr_set(e, mapaddr, map); |
958 | dma_unmap_len_set(e, maplen, bufsize); | 955 | dma_unmap_len_set(e, maplen, bufsize); |
959 | return 0; | ||
960 | |||
961 | mapping_error: | ||
962 | if (net_ratelimit()) | ||
963 | dev_warn(&pdev->dev, "%s: rx mapping error\n", | ||
964 | skb->dev->name); | ||
965 | return -EIO; | ||
966 | } | 956 | } |
967 | 957 | ||
968 | /* Resume receiving using existing skb, | 958 | /* Resume receiving using existing skb, |
@@ -1024,11 +1014,7 @@ static int skge_rx_fill(struct net_device *dev) | |||
1024 | return -ENOMEM; | 1014 | return -ENOMEM; |
1025 | 1015 | ||
1026 | skb_reserve(skb, NET_IP_ALIGN); | 1016 | skb_reserve(skb, NET_IP_ALIGN); |
1027 | if (skge_rx_setup(skge->hw->pdev, e, skb, skge->rx_buf_size)) { | 1017 | skge_rx_setup(skge, e, skb, skge->rx_buf_size); |
1028 | kfree_skb(skb); | ||
1029 | return -ENOMEM; | ||
1030 | } | ||
1031 | |||
1032 | } while ((e = e->next) != ring->start); | 1018 | } while ((e = e->next) != ring->start); |
1033 | 1019 | ||
1034 | ring->to_clean = ring->start; | 1020 | ring->to_clean = ring->start; |
@@ -2743,7 +2729,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, | |||
2743 | struct skge_tx_desc *td; | 2729 | struct skge_tx_desc *td; |
2744 | int i; | 2730 | int i; |
2745 | u32 control, len; | 2731 | u32 control, len; |
2746 | dma_addr_t map; | 2732 | u64 map; |
2747 | 2733 | ||
2748 | if (skb_padto(skb, ETH_ZLEN)) | 2734 | if (skb_padto(skb, ETH_ZLEN)) |
2749 | return NETDEV_TX_OK; | 2735 | return NETDEV_TX_OK; |
@@ -2757,14 +2743,11 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, | |||
2757 | e->skb = skb; | 2743 | e->skb = skb; |
2758 | len = skb_headlen(skb); | 2744 | len = skb_headlen(skb); |
2759 | map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); | 2745 | map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); |
2760 | if (pci_dma_mapping_error(hw->pdev, map)) | ||
2761 | goto mapping_error; | ||
2762 | |||
2763 | dma_unmap_addr_set(e, mapaddr, map); | 2746 | dma_unmap_addr_set(e, mapaddr, map); |
2764 | dma_unmap_len_set(e, maplen, len); | 2747 | dma_unmap_len_set(e, maplen, len); |
2765 | 2748 | ||
2766 | td->dma_lo = lower_32_bits(map); | 2749 | td->dma_lo = map; |
2767 | td->dma_hi = upper_32_bits(map); | 2750 | td->dma_hi = map >> 32; |
2768 | 2751 | ||
2769 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 2752 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
2770 | const int offset = skb_checksum_start_offset(skb); | 2753 | const int offset = skb_checksum_start_offset(skb); |
@@ -2795,16 +2778,14 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, | |||
2795 | 2778 | ||
2796 | map = skb_frag_dma_map(&hw->pdev->dev, frag, 0, | 2779 | map = skb_frag_dma_map(&hw->pdev->dev, frag, 0, |
2797 | skb_frag_size(frag), DMA_TO_DEVICE); | 2780 | skb_frag_size(frag), DMA_TO_DEVICE); |
2798 | if (dma_mapping_error(&hw->pdev->dev, map)) | ||
2799 | goto mapping_unwind; | ||
2800 | 2781 | ||
2801 | e = e->next; | 2782 | e = e->next; |
2802 | e->skb = skb; | 2783 | e->skb = skb; |
2803 | tf = e->desc; | 2784 | tf = e->desc; |
2804 | BUG_ON(tf->control & BMU_OWN); | 2785 | BUG_ON(tf->control & BMU_OWN); |
2805 | 2786 | ||
2806 | tf->dma_lo = lower_32_bits(map); | 2787 | tf->dma_lo = map; |
2807 | tf->dma_hi = upper_32_bits(map); | 2788 | tf->dma_hi = (u64) map >> 32; |
2808 | dma_unmap_addr_set(e, mapaddr, map); | 2789 | dma_unmap_addr_set(e, mapaddr, map); |
2809 | dma_unmap_len_set(e, maplen, skb_frag_size(frag)); | 2790 | dma_unmap_len_set(e, maplen, skb_frag_size(frag)); |
2810 | 2791 | ||
@@ -2834,28 +2815,6 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, | |||
2834 | } | 2815 | } |
2835 | 2816 | ||
2836 | return NETDEV_TX_OK; | 2817 | return NETDEV_TX_OK; |
2837 | |||
2838 | mapping_unwind: | ||
2839 | /* unroll any pages that were already mapped. */ | ||
2840 | if (e != skge->tx_ring.to_use) { | ||
2841 | struct skge_element *u; | ||
2842 | |||
2843 | for (u = skge->tx_ring.to_use->next; u != e; u = u->next) | ||
2844 | pci_unmap_page(hw->pdev, dma_unmap_addr(u, mapaddr), | ||
2845 | dma_unmap_len(u, maplen), | ||
2846 | PCI_DMA_TODEVICE); | ||
2847 | e = skge->tx_ring.to_use; | ||
2848 | } | ||
2849 | /* undo the mapping for the skb header */ | ||
2850 | pci_unmap_single(hw->pdev, dma_unmap_addr(e, mapaddr), | ||
2851 | dma_unmap_len(e, maplen), | ||
2852 | PCI_DMA_TODEVICE); | ||
2853 | mapping_error: | ||
2854 | /* mapping error causes error message and packet to be discarded. */ | ||
2855 | if (net_ratelimit()) | ||
2856 | dev_warn(&hw->pdev->dev, "%s: tx mapping error\n", dev->name); | ||
2857 | dev_kfree_skb(skb); | ||
2858 | return NETDEV_TX_OK; | ||
2859 | } | 2818 | } |
2860 | 2819 | ||
2861 | 2820 | ||
@@ -3099,17 +3058,13 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, | |||
3099 | if (!nskb) | 3058 | if (!nskb) |
3100 | goto resubmit; | 3059 | goto resubmit; |
3101 | 3060 | ||
3102 | if (unlikely(skge_rx_setup(skge->hw->pdev, e, nskb, skge->rx_buf_size))) { | ||
3103 | dev_kfree_skb(nskb); | ||
3104 | goto resubmit; | ||
3105 | } | ||
3106 | |||
3107 | pci_unmap_single(skge->hw->pdev, | 3061 | pci_unmap_single(skge->hw->pdev, |
3108 | dma_unmap_addr(e, mapaddr), | 3062 | dma_unmap_addr(e, mapaddr), |
3109 | dma_unmap_len(e, maplen), | 3063 | dma_unmap_len(e, maplen), |
3110 | PCI_DMA_FROMDEVICE); | 3064 | PCI_DMA_FROMDEVICE); |
3111 | skb = e->skb; | 3065 | skb = e->skb; |
3112 | prefetch(skb->data); | 3066 | prefetch(skb->data); |
3067 | skge_rx_setup(skge, e, nskb, skge->rx_buf_size); | ||
3113 | } | 3068 | } |
3114 | 3069 | ||
3115 | skb_put(skb, len); | 3070 | skb_put(skb, len); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 405e6ac3faf6..eaf09d4f02d0 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c | |||
@@ -1616,12 +1616,12 @@ void mlx4_multi_func_cleanup(struct mlx4_dev *dev) | |||
1616 | kfree(priv->mfunc.master.slave_state[i].vlan_filter[port]); | 1616 | kfree(priv->mfunc.master.slave_state[i].vlan_filter[port]); |
1617 | } | 1617 | } |
1618 | kfree(priv->mfunc.master.slave_state); | 1618 | kfree(priv->mfunc.master.slave_state); |
1619 | iounmap(priv->mfunc.comm); | ||
1620 | dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE, | ||
1621 | priv->mfunc.vhcr, | ||
1622 | priv->mfunc.vhcr_dma); | ||
1623 | priv->mfunc.vhcr = NULL; | ||
1624 | } | 1619 | } |
1620 | |||
1621 | iounmap(priv->mfunc.comm); | ||
1622 | dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE, | ||
1623 | priv->mfunc.vhcr, priv->mfunc.vhcr_dma); | ||
1624 | priv->mfunc.vhcr = NULL; | ||
1625 | } | 1625 | } |
1626 | 1626 | ||
1627 | void mlx4_cmd_cleanup(struct mlx4_dev *dev) | 1627 | void mlx4_cmd_cleanup(struct mlx4_dev *dev) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 467ae5824875..149e60da0a32 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -892,7 +892,8 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv) | |||
892 | 892 | ||
893 | for (i = 0; i < priv->rx_ring_num; i++) { | 893 | for (i = 0; i < priv->rx_ring_num; i++) { |
894 | if (priv->rx_ring[i].rx_info) | 894 | if (priv->rx_ring[i].rx_info) |
895 | mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i]); | 895 | mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i], |
896 | priv->prof->rx_ring_size, priv->stride); | ||
896 | if (priv->rx_cq[i].buf) | 897 | if (priv->rx_cq[i].buf) |
897 | mlx4_en_destroy_cq(priv, &priv->rx_cq[i]); | 898 | mlx4_en_destroy_cq(priv, &priv->rx_cq[i]); |
898 | } | 899 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index 971d4b6b8dfe..d4ad8c226b51 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -168,8 +168,12 @@ static int mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv, | |||
168 | return 0; | 168 | return 0; |
169 | 169 | ||
170 | err: | 170 | err: |
171 | while (i--) | 171 | while (i--) { |
172 | dma_addr_t dma = be64_to_cpu(rx_desc->data[i].addr); | ||
173 | pci_unmap_single(priv->mdev->pdev, dma, skb_frags[i].size, | ||
174 | PCI_DMA_FROMDEVICE); | ||
172 | put_page(skb_frags[i].page); | 175 | put_page(skb_frags[i].page); |
176 | } | ||
173 | return -ENOMEM; | 177 | return -ENOMEM; |
174 | } | 178 | } |
175 | 179 | ||
@@ -380,12 +384,12 @@ err_allocator: | |||
380 | } | 384 | } |
381 | 385 | ||
382 | void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv, | 386 | void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv, |
383 | struct mlx4_en_rx_ring *ring) | 387 | struct mlx4_en_rx_ring *ring, u32 size, u16 stride) |
384 | { | 388 | { |
385 | struct mlx4_en_dev *mdev = priv->mdev; | 389 | struct mlx4_en_dev *mdev = priv->mdev; |
386 | 390 | ||
387 | mlx4_en_unmap_buffer(&ring->wqres.buf); | 391 | mlx4_en_unmap_buffer(&ring->wqres.buf); |
388 | mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size + TXBB_SIZE); | 392 | mlx4_free_hwq_res(mdev->dev, &ring->wqres, size * stride + TXBB_SIZE); |
389 | vfree(ring->rx_info); | 393 | vfree(ring->rx_info); |
390 | ring->rx_info = NULL; | 394 | ring->rx_info = NULL; |
391 | } | 395 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index 55d7bd4e210a..9129ace02560 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |||
@@ -815,8 +815,9 @@ int mlx4_init_eq_table(struct mlx4_dev *dev) | |||
815 | int err; | 815 | int err; |
816 | int i; | 816 | int i; |
817 | 817 | ||
818 | priv->eq_table.uar_map = kcalloc(sizeof *priv->eq_table.uar_map, | 818 | priv->eq_table.uar_map = kcalloc(mlx4_num_eq_uar(dev), |
819 | mlx4_num_eq_uar(dev), GFP_KERNEL); | 819 | sizeof *priv->eq_table.uar_map, |
820 | GFP_KERNEL); | ||
820 | if (!priv->eq_table.uar_map) { | 821 | if (!priv->eq_table.uar_map) { |
821 | err = -ENOMEM; | 822 | err = -ENOMEM; |
822 | goto err_out_free; | 823 | goto err_out_free; |
@@ -1035,7 +1036,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | |||
1035 | struct mlx4_priv *priv = mlx4_priv(dev); | 1036 | struct mlx4_priv *priv = mlx4_priv(dev); |
1036 | int vec = 0, err = 0, i; | 1037 | int vec = 0, err = 0, i; |
1037 | 1038 | ||
1038 | spin_lock(&priv->msix_ctl.pool_lock); | 1039 | mutex_lock(&priv->msix_ctl.pool_lock); |
1039 | for (i = 0; !vec && i < dev->caps.comp_pool; i++) { | 1040 | for (i = 0; !vec && i < dev->caps.comp_pool; i++) { |
1040 | if (~priv->msix_ctl.pool_bm & 1ULL << i) { | 1041 | if (~priv->msix_ctl.pool_bm & 1ULL << i) { |
1041 | priv->msix_ctl.pool_bm |= 1ULL << i; | 1042 | priv->msix_ctl.pool_bm |= 1ULL << i; |
@@ -1057,7 +1058,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | |||
1057 | eq_set_ci(&priv->eq_table.eq[vec], 1); | 1058 | eq_set_ci(&priv->eq_table.eq[vec], 1); |
1058 | } | 1059 | } |
1059 | } | 1060 | } |
1060 | spin_unlock(&priv->msix_ctl.pool_lock); | 1061 | mutex_unlock(&priv->msix_ctl.pool_lock); |
1061 | 1062 | ||
1062 | if (vec) { | 1063 | if (vec) { |
1063 | *vector = vec; | 1064 | *vector = vec; |
@@ -1078,13 +1079,13 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec) | |||
1078 | if (likely(i >= 0)) { | 1079 | if (likely(i >= 0)) { |
1079 | /*sanity check , making sure were not trying to free irq's | 1080 | /*sanity check , making sure were not trying to free irq's |
1080 | Belonging to a legacy EQ*/ | 1081 | Belonging to a legacy EQ*/ |
1081 | spin_lock(&priv->msix_ctl.pool_lock); | 1082 | mutex_lock(&priv->msix_ctl.pool_lock); |
1082 | if (priv->msix_ctl.pool_bm & 1ULL << i) { | 1083 | if (priv->msix_ctl.pool_bm & 1ULL << i) { |
1083 | free_irq(priv->eq_table.eq[vec].irq, | 1084 | free_irq(priv->eq_table.eq[vec].irq, |
1084 | &priv->eq_table.eq[vec]); | 1085 | &priv->eq_table.eq[vec]); |
1085 | priv->msix_ctl.pool_bm &= ~(1ULL << i); | 1086 | priv->msix_ctl.pool_bm &= ~(1ULL << i); |
1086 | } | 1087 | } |
1087 | spin_unlock(&priv->msix_ctl.pool_lock); | 1088 | mutex_unlock(&priv->msix_ctl.pool_lock); |
1088 | } | 1089 | } |
1089 | 1090 | ||
1090 | } | 1091 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 8a21e10952ea..9ea7cabcaf3c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -685,7 +685,7 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, | |||
685 | return err; | 685 | return err; |
686 | } | 686 | } |
687 | 687 | ||
688 | static int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port) | 688 | int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port) |
689 | { | 689 | { |
690 | struct mlx4_cmd_mailbox *outbox = ptr; | 690 | struct mlx4_cmd_mailbox *outbox = ptr; |
691 | 691 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 678558b502fc..d498f049c74e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -531,15 +531,14 @@ int mlx4_change_port_types(struct mlx4_dev *dev, | |||
531 | for (port = 0; port < dev->caps.num_ports; port++) { | 531 | for (port = 0; port < dev->caps.num_ports; port++) { |
532 | /* Change the port type only if the new type is different | 532 | /* Change the port type only if the new type is different |
533 | * from the current, and not set to Auto */ | 533 | * from the current, and not set to Auto */ |
534 | if (port_types[port] != dev->caps.port_type[port + 1]) { | 534 | if (port_types[port] != dev->caps.port_type[port + 1]) |
535 | change = 1; | 535 | change = 1; |
536 | dev->caps.port_type[port + 1] = port_types[port]; | ||
537 | } | ||
538 | } | 536 | } |
539 | if (change) { | 537 | if (change) { |
540 | mlx4_unregister_device(dev); | 538 | mlx4_unregister_device(dev); |
541 | for (port = 1; port <= dev->caps.num_ports; port++) { | 539 | for (port = 1; port <= dev->caps.num_ports; port++) { |
542 | mlx4_CLOSE_PORT(dev, port); | 540 | mlx4_CLOSE_PORT(dev, port); |
541 | dev->caps.port_type[port] = port_types[port - 1]; | ||
543 | err = mlx4_SET_PORT(dev, port); | 542 | err = mlx4_SET_PORT(dev, port); |
544 | if (err) { | 543 | if (err) { |
545 | mlx4_err(dev, "Failed to set port %d, " | 544 | mlx4_err(dev, "Failed to set port %d, " |
@@ -986,6 +985,9 @@ static int map_bf_area(struct mlx4_dev *dev) | |||
986 | resource_size_t bf_len; | 985 | resource_size_t bf_len; |
987 | int err = 0; | 986 | int err = 0; |
988 | 987 | ||
988 | if (!dev->caps.bf_reg_size) | ||
989 | return -ENXIO; | ||
990 | |||
989 | bf_start = pci_resource_start(dev->pdev, 2) + | 991 | bf_start = pci_resource_start(dev->pdev, 2) + |
990 | (dev->caps.num_uars << PAGE_SHIFT); | 992 | (dev->caps.num_uars << PAGE_SHIFT); |
991 | bf_len = pci_resource_len(dev->pdev, 2) - | 993 | bf_len = pci_resource_len(dev->pdev, 2) - |
@@ -1825,7 +1827,7 @@ slave_start: | |||
1825 | goto err_master_mfunc; | 1827 | goto err_master_mfunc; |
1826 | 1828 | ||
1827 | priv->msix_ctl.pool_bm = 0; | 1829 | priv->msix_ctl.pool_bm = 0; |
1828 | spin_lock_init(&priv->msix_ctl.pool_lock); | 1830 | mutex_init(&priv->msix_ctl.pool_lock); |
1829 | 1831 | ||
1830 | mlx4_enable_msi_x(dev); | 1832 | mlx4_enable_msi_x(dev); |
1831 | if ((mlx4_is_mfunc(dev)) && | 1833 | if ((mlx4_is_mfunc(dev)) && |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c index 0785d9b2a265..ca574d850b39 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c | |||
@@ -136,7 +136,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 port, | |||
136 | u32 prot; | 136 | u32 prot; |
137 | int err; | 137 | int err; |
138 | 138 | ||
139 | s_steer = &mlx4_priv(dev)->steer[0]; | 139 | s_steer = &mlx4_priv(dev)->steer[port - 1]; |
140 | new_entry = kzalloc(sizeof *new_entry, GFP_KERNEL); | 140 | new_entry = kzalloc(sizeof *new_entry, GFP_KERNEL); |
141 | if (!new_entry) | 141 | if (!new_entry) |
142 | return -ENOMEM; | 142 | return -ENOMEM; |
@@ -220,7 +220,7 @@ static int existing_steering_entry(struct mlx4_dev *dev, u8 port, | |||
220 | struct mlx4_promisc_qp *pqp; | 220 | struct mlx4_promisc_qp *pqp; |
221 | struct mlx4_promisc_qp *dqp; | 221 | struct mlx4_promisc_qp *dqp; |
222 | 222 | ||
223 | s_steer = &mlx4_priv(dev)->steer[0]; | 223 | s_steer = &mlx4_priv(dev)->steer[port - 1]; |
224 | 224 | ||
225 | pqp = get_promisc_qp(dev, 0, steer, qpn); | 225 | pqp = get_promisc_qp(dev, 0, steer, qpn); |
226 | if (!pqp) | 226 | if (!pqp) |
@@ -265,7 +265,7 @@ static bool check_duplicate_entry(struct mlx4_dev *dev, u8 port, | |||
265 | struct mlx4_steer_index *tmp_entry, *entry = NULL; | 265 | struct mlx4_steer_index *tmp_entry, *entry = NULL; |
266 | struct mlx4_promisc_qp *dqp, *tmp_dqp; | 266 | struct mlx4_promisc_qp *dqp, *tmp_dqp; |
267 | 267 | ||
268 | s_steer = &mlx4_priv(dev)->steer[0]; | 268 | s_steer = &mlx4_priv(dev)->steer[port - 1]; |
269 | 269 | ||
270 | /* if qp is not promisc, it cannot be duplicated */ | 270 | /* if qp is not promisc, it cannot be duplicated */ |
271 | if (!get_promisc_qp(dev, 0, steer, qpn)) | 271 | if (!get_promisc_qp(dev, 0, steer, qpn)) |
@@ -306,7 +306,7 @@ static bool can_remove_steering_entry(struct mlx4_dev *dev, u8 port, | |||
306 | bool ret = false; | 306 | bool ret = false; |
307 | int i; | 307 | int i; |
308 | 308 | ||
309 | s_steer = &mlx4_priv(dev)->steer[0]; | 309 | s_steer = &mlx4_priv(dev)->steer[port - 1]; |
310 | 310 | ||
311 | mailbox = mlx4_alloc_cmd_mailbox(dev); | 311 | mailbox = mlx4_alloc_cmd_mailbox(dev); |
312 | if (IS_ERR(mailbox)) | 312 | if (IS_ERR(mailbox)) |
@@ -361,7 +361,7 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port, | |||
361 | int err; | 361 | int err; |
362 | struct mlx4_priv *priv = mlx4_priv(dev); | 362 | struct mlx4_priv *priv = mlx4_priv(dev); |
363 | 363 | ||
364 | s_steer = &mlx4_priv(dev)->steer[0]; | 364 | s_steer = &mlx4_priv(dev)->steer[port - 1]; |
365 | 365 | ||
366 | mutex_lock(&priv->mcg_table.mutex); | 366 | mutex_lock(&priv->mcg_table.mutex); |
367 | 367 | ||
@@ -466,7 +466,7 @@ static int remove_promisc_qp(struct mlx4_dev *dev, u8 port, | |||
466 | int loc, i; | 466 | int loc, i; |
467 | int err; | 467 | int err; |
468 | 468 | ||
469 | s_steer = &mlx4_priv(dev)->steer[0]; | 469 | s_steer = &mlx4_priv(dev)->steer[port - 1]; |
470 | mutex_lock(&priv->mcg_table.mutex); | 470 | mutex_lock(&priv->mcg_table.mutex); |
471 | 471 | ||
472 | pqp = get_promisc_qp(dev, 0, steer, qpn); | 472 | pqp = get_promisc_qp(dev, 0, steer, qpn); |
@@ -1004,7 +1004,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_promisc_remove); | |||
1004 | 1004 | ||
1005 | int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port) | 1005 | int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port) |
1006 | { | 1006 | { |
1007 | if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) | 1007 | if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER)) |
1008 | return 0; | 1008 | return 0; |
1009 | 1009 | ||
1010 | if (mlx4_is_mfunc(dev)) | 1010 | if (mlx4_is_mfunc(dev)) |
@@ -1016,7 +1016,7 @@ EXPORT_SYMBOL_GPL(mlx4_unicast_promisc_add); | |||
1016 | 1016 | ||
1017 | int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port) | 1017 | int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port) |
1018 | { | 1018 | { |
1019 | if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) | 1019 | if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER)) |
1020 | return 0; | 1020 | return 0; |
1021 | 1021 | ||
1022 | if (mlx4_is_mfunc(dev)) | 1022 | if (mlx4_is_mfunc(dev)) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h index c92269f8c057..28f8251561f4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h | |||
@@ -697,7 +697,7 @@ struct mlx4_sense { | |||
697 | 697 | ||
698 | struct mlx4_msix_ctl { | 698 | struct mlx4_msix_ctl { |
699 | u64 pool_bm; | 699 | u64 pool_bm; |
700 | spinlock_t pool_lock; | 700 | struct mutex pool_lock; |
701 | }; | 701 | }; |
702 | 702 | ||
703 | struct mlx4_steer { | 703 | struct mlx4_steer { |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index 35f08840813c..d60335f3c473 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -528,7 +528,8 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv, | |||
528 | struct mlx4_en_rx_ring *ring, | 528 | struct mlx4_en_rx_ring *ring, |
529 | u32 size, u16 stride); | 529 | u32 size, u16 stride); |
530 | void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv, | 530 | void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv, |
531 | struct mlx4_en_rx_ring *ring); | 531 | struct mlx4_en_rx_ring *ring, |
532 | u32 size, u16 stride); | ||
532 | int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv); | 533 | int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv); |
533 | void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, | 534 | void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, |
534 | struct mlx4_en_rx_ring *ring); | 535 | struct mlx4_en_rx_ring *ring); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c index 8deeef98280c..25a80d71fb2a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mr.c +++ b/drivers/net/ethernet/mellanox/mlx4/mr.c | |||
@@ -304,7 +304,7 @@ static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox | |||
304 | MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); | 304 | MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); |
305 | } | 305 | } |
306 | 306 | ||
307 | static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, | 307 | int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, |
308 | u32 *base_mridx) | 308 | u32 *base_mridx) |
309 | { | 309 | { |
310 | struct mlx4_priv *priv = mlx4_priv(dev); | 310 | struct mlx4_priv *priv = mlx4_priv(dev); |
@@ -320,14 +320,14 @@ static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, | |||
320 | } | 320 | } |
321 | EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range); | 321 | EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range); |
322 | 322 | ||
323 | static void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt) | 323 | void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt) |
324 | { | 324 | { |
325 | struct mlx4_priv *priv = mlx4_priv(dev); | 325 | struct mlx4_priv *priv = mlx4_priv(dev); |
326 | mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt); | 326 | mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt); |
327 | } | 327 | } |
328 | EXPORT_SYMBOL_GPL(mlx4_mr_release_range); | 328 | EXPORT_SYMBOL_GPL(mlx4_mr_release_range); |
329 | 329 | ||
330 | static int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, | 330 | int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, |
331 | u64 iova, u64 size, u32 access, int npages, | 331 | u64 iova, u64 size, u32 access, int npages, |
332 | int page_shift, struct mlx4_mr *mr) | 332 | int page_shift, struct mlx4_mr *mr) |
333 | { | 333 | { |
@@ -457,7 +457,7 @@ int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, | |||
457 | } | 457 | } |
458 | EXPORT_SYMBOL_GPL(mlx4_mr_alloc); | 458 | EXPORT_SYMBOL_GPL(mlx4_mr_alloc); |
459 | 459 | ||
460 | static void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) | 460 | void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) |
461 | { | 461 | { |
462 | int err; | 462 | int err; |
463 | 463 | ||
@@ -852,7 +852,7 @@ err_free: | |||
852 | } | 852 | } |
853 | EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); | 853 | EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); |
854 | 854 | ||
855 | static int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, | 855 | int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, |
856 | u32 pd, u32 access, int max_pages, | 856 | u32 pd, u32 access, int max_pages, |
857 | int max_maps, u8 page_shift, struct mlx4_fmr *fmr) | 857 | int max_maps, u8 page_shift, struct mlx4_fmr *fmr) |
858 | { | 858 | { |
@@ -954,7 +954,7 @@ int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr) | |||
954 | } | 954 | } |
955 | EXPORT_SYMBOL_GPL(mlx4_fmr_free); | 955 | EXPORT_SYMBOL_GPL(mlx4_fmr_free); |
956 | 956 | ||
957 | static int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr) | 957 | int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr) |
958 | { | 958 | { |
959 | if (fmr->maps) | 959 | if (fmr->maps) |
960 | return -EBUSY; | 960 | return -EBUSY; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c index 738f950a1ce5..fb2b36759cbf 100644 --- a/drivers/net/ethernet/mellanox/mlx4/qp.c +++ b/drivers/net/ethernet/mellanox/mlx4/qp.c | |||
@@ -151,11 +151,6 @@ static int __mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | |||
151 | context->log_page_size = mtt->page_shift - MLX4_ICM_PAGE_SHIFT; | 151 | context->log_page_size = mtt->page_shift - MLX4_ICM_PAGE_SHIFT; |
152 | } | 152 | } |
153 | 153 | ||
154 | port = ((context->pri_path.sched_queue >> 6) & 1) + 1; | ||
155 | if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH) | ||
156 | context->pri_path.sched_queue = (context->pri_path.sched_queue & | ||
157 | 0xc3); | ||
158 | |||
159 | *(__be32 *) mailbox->buf = cpu_to_be32(optpar); | 154 | *(__be32 *) mailbox->buf = cpu_to_be32(optpar); |
160 | memcpy(mailbox->buf + 8, context, sizeof *context); | 155 | memcpy(mailbox->buf + 8, context, sizeof *context); |
161 | 156 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index dcd819bfb2f0..8752e6e08169 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | |||
@@ -73,6 +73,7 @@ struct res_gid { | |||
73 | struct list_head list; | 73 | struct list_head list; |
74 | u8 gid[16]; | 74 | u8 gid[16]; |
75 | enum mlx4_protocol prot; | 75 | enum mlx4_protocol prot; |
76 | enum mlx4_steer_type steer; | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | enum res_qp_states { | 79 | enum res_qp_states { |
@@ -374,6 +375,7 @@ static struct res_common *alloc_qp_tr(int id) | |||
374 | 375 | ||
375 | ret->com.res_id = id; | 376 | ret->com.res_id = id; |
376 | ret->com.state = RES_QP_RESERVED; | 377 | ret->com.state = RES_QP_RESERVED; |
378 | ret->local_qpn = id; | ||
377 | INIT_LIST_HEAD(&ret->mcg_list); | 379 | INIT_LIST_HEAD(&ret->mcg_list); |
378 | spin_lock_init(&ret->mcg_spl); | 380 | spin_lock_init(&ret->mcg_spl); |
379 | 381 | ||
@@ -2253,8 +2255,7 @@ int mlx4_MODIFY_CQ_wrapper(struct mlx4_dev *dev, int slave, | |||
2253 | 2255 | ||
2254 | if (vhcr->op_modifier == 0) { | 2256 | if (vhcr->op_modifier == 0) { |
2255 | err = handle_resize(dev, slave, vhcr, inbox, outbox, cmd, cq); | 2257 | err = handle_resize(dev, slave, vhcr, inbox, outbox, cmd, cq); |
2256 | if (err) | 2258 | goto ex_put; |
2257 | goto ex_put; | ||
2258 | } | 2259 | } |
2259 | 2260 | ||
2260 | err = mlx4_DMA_wrapper(dev, slave, vhcr, inbox, outbox, cmd); | 2261 | err = mlx4_DMA_wrapper(dev, slave, vhcr, inbox, outbox, cmd); |
@@ -2479,7 +2480,8 @@ static struct res_gid *find_gid(struct mlx4_dev *dev, int slave, | |||
2479 | } | 2480 | } |
2480 | 2481 | ||
2481 | static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, | 2482 | static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, |
2482 | u8 *gid, enum mlx4_protocol prot) | 2483 | u8 *gid, enum mlx4_protocol prot, |
2484 | enum mlx4_steer_type steer) | ||
2483 | { | 2485 | { |
2484 | struct res_gid *res; | 2486 | struct res_gid *res; |
2485 | int err; | 2487 | int err; |
@@ -2495,6 +2497,7 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, | |||
2495 | } else { | 2497 | } else { |
2496 | memcpy(res->gid, gid, 16); | 2498 | memcpy(res->gid, gid, 16); |
2497 | res->prot = prot; | 2499 | res->prot = prot; |
2500 | res->steer = steer; | ||
2498 | list_add_tail(&res->list, &rqp->mcg_list); | 2501 | list_add_tail(&res->list, &rqp->mcg_list); |
2499 | err = 0; | 2502 | err = 0; |
2500 | } | 2503 | } |
@@ -2504,14 +2507,15 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, | |||
2504 | } | 2507 | } |
2505 | 2508 | ||
2506 | static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, | 2509 | static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, |
2507 | u8 *gid, enum mlx4_protocol prot) | 2510 | u8 *gid, enum mlx4_protocol prot, |
2511 | enum mlx4_steer_type steer) | ||
2508 | { | 2512 | { |
2509 | struct res_gid *res; | 2513 | struct res_gid *res; |
2510 | int err; | 2514 | int err; |
2511 | 2515 | ||
2512 | spin_lock_irq(&rqp->mcg_spl); | 2516 | spin_lock_irq(&rqp->mcg_spl); |
2513 | res = find_gid(dev, slave, rqp, gid); | 2517 | res = find_gid(dev, slave, rqp, gid); |
2514 | if (!res || res->prot != prot) | 2518 | if (!res || res->prot != prot || res->steer != steer) |
2515 | err = -EINVAL; | 2519 | err = -EINVAL; |
2516 | else { | 2520 | else { |
2517 | list_del(&res->list); | 2521 | list_del(&res->list); |
@@ -2538,7 +2542,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
2538 | int attach = vhcr->op_modifier; | 2542 | int attach = vhcr->op_modifier; |
2539 | int block_loopback = vhcr->in_modifier >> 31; | 2543 | int block_loopback = vhcr->in_modifier >> 31; |
2540 | u8 steer_type_mask = 2; | 2544 | u8 steer_type_mask = 2; |
2541 | enum mlx4_steer_type type = gid[7] & steer_type_mask; | 2545 | enum mlx4_steer_type type = (gid[7] & steer_type_mask) >> 1; |
2542 | 2546 | ||
2543 | qpn = vhcr->in_modifier & 0xffffff; | 2547 | qpn = vhcr->in_modifier & 0xffffff; |
2544 | err = get_res(dev, slave, qpn, RES_QP, &rqp); | 2548 | err = get_res(dev, slave, qpn, RES_QP, &rqp); |
@@ -2547,7 +2551,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
2547 | 2551 | ||
2548 | qp.qpn = qpn; | 2552 | qp.qpn = qpn; |
2549 | if (attach) { | 2553 | if (attach) { |
2550 | err = add_mcg_res(dev, slave, rqp, gid, prot); | 2554 | err = add_mcg_res(dev, slave, rqp, gid, prot, type); |
2551 | if (err) | 2555 | if (err) |
2552 | goto ex_put; | 2556 | goto ex_put; |
2553 | 2557 | ||
@@ -2556,7 +2560,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
2556 | if (err) | 2560 | if (err) |
2557 | goto ex_rem; | 2561 | goto ex_rem; |
2558 | } else { | 2562 | } else { |
2559 | err = rem_mcg_res(dev, slave, rqp, gid, prot); | 2563 | err = rem_mcg_res(dev, slave, rqp, gid, prot, type); |
2560 | if (err) | 2564 | if (err) |
2561 | goto ex_put; | 2565 | goto ex_put; |
2562 | err = mlx4_qp_detach_common(dev, &qp, gid, prot, type); | 2566 | err = mlx4_qp_detach_common(dev, &qp, gid, prot, type); |
@@ -2567,7 +2571,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
2567 | 2571 | ||
2568 | ex_rem: | 2572 | ex_rem: |
2569 | /* ignore error return below, already in error */ | 2573 | /* ignore error return below, already in error */ |
2570 | err1 = rem_mcg_res(dev, slave, rqp, gid, prot); | 2574 | err1 = rem_mcg_res(dev, slave, rqp, gid, prot, type); |
2571 | ex_put: | 2575 | ex_put: |
2572 | put_res(dev, slave, qpn, RES_QP); | 2576 | put_res(dev, slave, qpn, RES_QP); |
2573 | 2577 | ||
@@ -2606,7 +2610,7 @@ static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp) | |||
2606 | list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) { | 2610 | list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) { |
2607 | qp.qpn = rqp->local_qpn; | 2611 | qp.qpn = rqp->local_qpn; |
2608 | err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot, | 2612 | err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot, |
2609 | MLX4_MC_STEER); | 2613 | rgid->steer); |
2610 | list_del(&rgid->list); | 2614 | list_del(&rgid->list); |
2611 | kfree(rgid); | 2615 | kfree(rgid); |
2612 | } | 2616 | } |
diff --git a/drivers/net/ethernet/micrel/Kconfig b/drivers/net/ethernet/micrel/Kconfig index 1ea811cf515b..fe42fc00d8d3 100644 --- a/drivers/net/ethernet/micrel/Kconfig +++ b/drivers/net/ethernet/micrel/Kconfig | |||
@@ -42,7 +42,6 @@ config KS8851 | |||
42 | select NET_CORE | 42 | select NET_CORE |
43 | select MII | 43 | select MII |
44 | select CRC32 | 44 | select CRC32 |
45 | select MISC_DEVICES | ||
46 | select EEPROM_93CX6 | 45 | select EEPROM_93CX6 |
47 | ---help--- | 46 | ---help--- |
48 | SPI driver for Micrel KS8851 SPI attached network chip. | 47 | SPI driver for Micrel KS8851 SPI attached network chip. |
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c index 6b35e7da9a9c..0c3e4005224d 100644 --- a/drivers/net/ethernet/micrel/ks8851.c +++ b/drivers/net/ethernet/micrel/ks8851.c | |||
@@ -583,7 +583,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks) | |||
583 | ks8851_dbg_dumpkkt(ks, rxpkt); | 583 | ks8851_dbg_dumpkkt(ks, rxpkt); |
584 | 584 | ||
585 | skb->protocol = eth_type_trans(skb, ks->netdev); | 585 | skb->protocol = eth_type_trans(skb, ks->netdev); |
586 | netif_rx(skb); | 586 | netif_rx_ni(skb); |
587 | 587 | ||
588 | ks->netdev->stats.rx_packets++; | 588 | ks->netdev->stats.rx_packets++; |
589 | ks->netdev->stats.rx_bytes += rxlen; | 589 | ks->netdev->stats.rx_bytes += rxlen; |
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c index e58e78e5c930..2784bc706f1e 100644 --- a/drivers/net/ethernet/micrel/ks8851_mll.c +++ b/drivers/net/ethernet/micrel/ks8851_mll.c | |||
@@ -394,7 +394,6 @@ union ks_tx_hdr { | |||
394 | * @msg_enable : The message flags controlling driver output (see ethtool). | 394 | * @msg_enable : The message flags controlling driver output (see ethtool). |
395 | * @frame_cnt : number of frames received. | 395 | * @frame_cnt : number of frames received. |
396 | * @bus_width : i/o bus width. | 396 | * @bus_width : i/o bus width. |
397 | * @irq : irq number assigned to this device. | ||
398 | * @rc_rxqcr : Cached copy of KS_RXQCR. | 397 | * @rc_rxqcr : Cached copy of KS_RXQCR. |
399 | * @rc_txcr : Cached copy of KS_TXCR. | 398 | * @rc_txcr : Cached copy of KS_TXCR. |
400 | * @rc_ier : Cached copy of KS_IER. | 399 | * @rc_ier : Cached copy of KS_IER. |
@@ -441,7 +440,6 @@ struct ks_net { | |||
441 | u32 msg_enable; | 440 | u32 msg_enable; |
442 | u32 frame_cnt; | 441 | u32 frame_cnt; |
443 | int bus_width; | 442 | int bus_width; |
444 | int irq; | ||
445 | 443 | ||
446 | u16 rc_rxqcr; | 444 | u16 rc_rxqcr; |
447 | u16 rc_txcr; | 445 | u16 rc_txcr; |
@@ -907,10 +905,10 @@ static int ks_net_open(struct net_device *netdev) | |||
907 | netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__); | 905 | netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__); |
908 | 906 | ||
909 | /* reset the HW */ | 907 | /* reset the HW */ |
910 | err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); | 908 | err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); |
911 | 909 | ||
912 | if (err) { | 910 | if (err) { |
913 | pr_err("Failed to request IRQ: %d: %d\n", ks->irq, err); | 911 | pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err); |
914 | return err; | 912 | return err; |
915 | } | 913 | } |
916 | 914 | ||
@@ -955,7 +953,7 @@ static int ks_net_stop(struct net_device *netdev) | |||
955 | 953 | ||
956 | /* set powermode to soft power down to save power */ | 954 | /* set powermode to soft power down to save power */ |
957 | ks_set_powermode(ks, PMECR_PM_SOFTDOWN); | 955 | ks_set_powermode(ks, PMECR_PM_SOFTDOWN); |
958 | free_irq(ks->irq, netdev); | 956 | free_irq(netdev->irq, netdev); |
959 | mutex_unlock(&ks->lock); | 957 | mutex_unlock(&ks->lock); |
960 | return 0; | 958 | return 0; |
961 | } | 959 | } |
@@ -1545,10 +1543,10 @@ static int __devinit ks8851_probe(struct platform_device *pdev) | |||
1545 | if (!ks->hw_addr_cmd) | 1543 | if (!ks->hw_addr_cmd) |
1546 | goto err_ioremap1; | 1544 | goto err_ioremap1; |
1547 | 1545 | ||
1548 | ks->irq = platform_get_irq(pdev, 0); | 1546 | netdev->irq = platform_get_irq(pdev, 0); |
1549 | 1547 | ||
1550 | if (ks->irq < 0) { | 1548 | if ((int)netdev->irq < 0) { |
1551 | err = ks->irq; | 1549 | err = netdev->irq; |
1552 | goto err_get_irq; | 1550 | goto err_get_irq; |
1553 | } | 1551 | } |
1554 | 1552 | ||
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c index 212f43b308a3..cd827ff4a021 100644 --- a/drivers/net/ethernet/octeon/octeon_mgmt.c +++ b/drivers/net/ethernet/octeon/octeon_mgmt.c | |||
@@ -670,7 +670,7 @@ static void octeon_mgmt_adjust_link(struct net_device *netdev) | |||
670 | static int octeon_mgmt_init_phy(struct net_device *netdev) | 670 | static int octeon_mgmt_init_phy(struct net_device *netdev) |
671 | { | 671 | { |
672 | struct octeon_mgmt *p = netdev_priv(netdev); | 672 | struct octeon_mgmt *p = netdev_priv(netdev); |
673 | char phy_id[20]; | 673 | char phy_id[MII_BUS_ID_SIZE + 3]; |
674 | 674 | ||
675 | if (octeon_is_simulation()) { | 675 | if (octeon_is_simulation()) { |
676 | /* No PHYs in the simulator. */ | 676 | /* No PHYs in the simulator. */ |
@@ -678,7 +678,7 @@ static int octeon_mgmt_init_phy(struct net_device *netdev) | |||
678 | return 0; | 678 | return 0; |
679 | } | 679 | } |
680 | 680 | ||
681 | snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "0", p->port); | 681 | snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "mdio-octeon-0", p->port); |
682 | 682 | ||
683 | p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0, | 683 | p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0, |
684 | PHY_INTERFACE_MODE_MII); | 684 | PHY_INTERFACE_MODE_MII); |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c index 9cb5f912e489..29e23bec809c 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c | |||
@@ -321,10 +321,10 @@ static void pch_gbe_check_copper_options(struct pch_gbe_adapter *adapter) | |||
321 | pr_debug("AutoNeg specified along with Speed or Duplex, AutoNeg parameter ignored\n"); | 321 | pr_debug("AutoNeg specified along with Speed or Duplex, AutoNeg parameter ignored\n"); |
322 | hw->phy.autoneg_advertised = opt.def; | 322 | hw->phy.autoneg_advertised = opt.def; |
323 | } else { | 323 | } else { |
324 | hw->phy.autoneg_advertised = AutoNeg; | 324 | int tmp = AutoNeg; |
325 | pch_gbe_validate_option( | 325 | |
326 | (int *)(&hw->phy.autoneg_advertised), | 326 | pch_gbe_validate_option(&tmp, &opt, adapter); |
327 | &opt, adapter); | 327 | hw->phy.autoneg_advertised = tmp; |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
@@ -495,9 +495,10 @@ void pch_gbe_check_options(struct pch_gbe_adapter *adapter) | |||
495 | .arg = { .l = { .nr = (int)ARRAY_SIZE(fc_list), | 495 | .arg = { .l = { .nr = (int)ARRAY_SIZE(fc_list), |
496 | .p = fc_list } } | 496 | .p = fc_list } } |
497 | }; | 497 | }; |
498 | hw->mac.fc = FlowControl; | 498 | int tmp = FlowControl; |
499 | pch_gbe_validate_option((int *)(&hw->mac.fc), | 499 | |
500 | &opt, adapter); | 500 | pch_gbe_validate_option(&tmp, &opt, adapter); |
501 | hw->mac.fc = tmp; | ||
501 | } | 502 | } |
502 | 503 | ||
503 | pch_gbe_check_copper_options(adapter); | 504 | pch_gbe_check_copper_options(adapter); |
diff --git a/drivers/net/ethernet/packetengines/Kconfig b/drivers/net/ethernet/packetengines/Kconfig index b97132d9dff0..8f29feb35548 100644 --- a/drivers/net/ethernet/packetengines/Kconfig +++ b/drivers/net/ethernet/packetengines/Kconfig | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | config NET_PACKET_ENGINE | 5 | config NET_PACKET_ENGINE |
6 | bool "Packet Engine devices" | 6 | bool "Packet Engine devices" |
7 | default y | ||
7 | depends on PCI | 8 | depends on PCI |
8 | ---help--- | 9 | ---help--- |
9 | If you have a network (Ethernet) card belonging to this class, say Y | 10 | If you have a network (Ethernet) card belonging to this class, say Y |
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c index 7931531c3a40..e61560e16385 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c | |||
@@ -3017,7 +3017,6 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3017 | (void __iomem *)port_regs; | 3017 | (void __iomem *)port_regs; |
3018 | u32 delay = 10; | 3018 | u32 delay = 10; |
3019 | int status = 0; | 3019 | int status = 0; |
3020 | unsigned long hw_flags = 0; | ||
3021 | 3020 | ||
3022 | if (ql_mii_setup(qdev)) | 3021 | if (ql_mii_setup(qdev)) |
3023 | return -1; | 3022 | return -1; |
@@ -3228,9 +3227,9 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3228 | value = ql_read_page0_reg(qdev, &port_regs->portStatus); | 3227 | value = ql_read_page0_reg(qdev, &port_regs->portStatus); |
3229 | if (value & PORT_STATUS_IC) | 3228 | if (value & PORT_STATUS_IC) |
3230 | break; | 3229 | break; |
3231 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 3230 | spin_unlock_irq(&qdev->hw_lock); |
3232 | msleep(500); | 3231 | msleep(500); |
3233 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | 3232 | spin_lock_irq(&qdev->hw_lock); |
3234 | } while (--delay); | 3233 | } while (--delay); |
3235 | 3234 | ||
3236 | if (delay == 0) { | 3235 | if (delay == 0) { |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 7a0c800b50ad..bbacb3741ec0 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -3781,12 +3781,20 @@ static void rtl8169_init_ring_indexes(struct rtl8169_private *tp) | |||
3781 | 3781 | ||
3782 | static void rtl_hw_jumbo_enable(struct rtl8169_private *tp) | 3782 | static void rtl_hw_jumbo_enable(struct rtl8169_private *tp) |
3783 | { | 3783 | { |
3784 | void __iomem *ioaddr = tp->mmio_addr; | ||
3785 | |||
3786 | RTL_W8(Cfg9346, Cfg9346_Unlock); | ||
3784 | rtl_generic_op(tp, tp->jumbo_ops.enable); | 3787 | rtl_generic_op(tp, tp->jumbo_ops.enable); |
3788 | RTL_W8(Cfg9346, Cfg9346_Lock); | ||
3785 | } | 3789 | } |
3786 | 3790 | ||
3787 | static void rtl_hw_jumbo_disable(struct rtl8169_private *tp) | 3791 | static void rtl_hw_jumbo_disable(struct rtl8169_private *tp) |
3788 | { | 3792 | { |
3793 | void __iomem *ioaddr = tp->mmio_addr; | ||
3794 | |||
3795 | RTL_W8(Cfg9346, Cfg9346_Unlock); | ||
3789 | rtl_generic_op(tp, tp->jumbo_ops.disable); | 3796 | rtl_generic_op(tp, tp->jumbo_ops.disable); |
3797 | RTL_W8(Cfg9346, Cfg9346_Lock); | ||
3790 | } | 3798 | } |
3791 | 3799 | ||
3792 | static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp) | 3800 | static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp) |
@@ -6186,6 +6194,9 @@ static void rtl_shutdown(struct pci_dev *pdev) | |||
6186 | { | 6194 | { |
6187 | struct net_device *dev = pci_get_drvdata(pdev); | 6195 | struct net_device *dev = pci_get_drvdata(pdev); |
6188 | struct rtl8169_private *tp = netdev_priv(dev); | 6196 | struct rtl8169_private *tp = netdev_priv(dev); |
6197 | struct device *d = &pdev->dev; | ||
6198 | |||
6199 | pm_runtime_get_sync(d); | ||
6189 | 6200 | ||
6190 | rtl8169_net_suspend(dev); | 6201 | rtl8169_net_suspend(dev); |
6191 | 6202 | ||
@@ -6207,6 +6218,8 @@ static void rtl_shutdown(struct pci_dev *pdev) | |||
6207 | pci_wake_from_d3(pdev, true); | 6218 | pci_wake_from_d3(pdev, true); |
6208 | pci_set_power_state(pdev, PCI_D3hot); | 6219 | pci_set_power_state(pdev, PCI_D3hot); |
6209 | } | 6220 | } |
6221 | |||
6222 | pm_runtime_put_noidle(d); | ||
6210 | } | 6223 | } |
6211 | 6224 | ||
6212 | static struct pci_driver rtl8169_pci_driver = { | 6225 | static struct pci_driver rtl8169_pci_driver = { |
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 813d41c4a845..87b650131774 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/pm_runtime.h> | 38 | #include <linux/pm_runtime.h> |
39 | #include <linux/slab.h> | 39 | #include <linux/slab.h> |
40 | #include <linux/ethtool.h> | 40 | #include <linux/ethtool.h> |
41 | #include <linux/if_vlan.h> | ||
41 | #include <linux/sh_eth.h> | 42 | #include <linux/sh_eth.h> |
42 | 43 | ||
43 | #include "sh_eth.h" | 44 | #include "sh_eth.h" |
@@ -817,7 +818,8 @@ static int sh_eth_dev_init(struct net_device *ndev) | |||
817 | sh_eth_write(ndev, 0, TRIMD); | 818 | sh_eth_write(ndev, 0, TRIMD); |
818 | 819 | ||
819 | /* Recv frame limit set register */ | 820 | /* Recv frame limit set register */ |
820 | sh_eth_write(ndev, RFLR_VALUE, RFLR); | 821 | sh_eth_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, |
822 | RFLR); | ||
821 | 823 | ||
822 | sh_eth_write(ndev, sh_eth_read(ndev, EESR), EESR); | 824 | sh_eth_write(ndev, sh_eth_read(ndev, EESR), EESR); |
823 | sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR); | 825 | sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR); |
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h index 47877b13ffad..cdbd844662a7 100644 --- a/drivers/net/ethernet/renesas/sh_eth.h +++ b/drivers/net/ethernet/renesas/sh_eth.h | |||
@@ -575,9 +575,6 @@ enum RPADIR_BIT { | |||
575 | RPADIR_PADR = 0x0003f, | 575 | RPADIR_PADR = 0x0003f, |
576 | }; | 576 | }; |
577 | 577 | ||
578 | /* RFLR */ | ||
579 | #define RFLR_VALUE 0x1000 | ||
580 | |||
581 | /* FDR */ | 578 | /* FDR */ |
582 | #define DEFAULT_FDR_INIT 0x00000707 | 579 | #define DEFAULT_FDR_INIT 0x00000707 |
583 | 580 | ||
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index aca349861767..fc52fca74193 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c | |||
@@ -156,11 +156,10 @@ static int efx_init_rx_buffers_skb(struct efx_rx_queue *rx_queue) | |||
156 | if (unlikely(!skb)) | 156 | if (unlikely(!skb)) |
157 | return -ENOMEM; | 157 | return -ENOMEM; |
158 | 158 | ||
159 | /* Adjust the SKB for padding and checksum */ | 159 | /* Adjust the SKB for padding */ |
160 | skb_reserve(skb, NET_IP_ALIGN); | 160 | skb_reserve(skb, NET_IP_ALIGN); |
161 | rx_buf->len = skb_len - NET_IP_ALIGN; | 161 | rx_buf->len = skb_len - NET_IP_ALIGN; |
162 | rx_buf->is_page = false; | 162 | rx_buf->is_page = false; |
163 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
164 | 163 | ||
165 | rx_buf->dma_addr = pci_map_single(efx->pci_dev, | 164 | rx_buf->dma_addr = pci_map_single(efx->pci_dev, |
166 | skb->data, rx_buf->len, | 165 | skb->data, rx_buf->len, |
@@ -496,6 +495,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel, | |||
496 | 495 | ||
497 | EFX_BUG_ON_PARANOID(!checksummed); | 496 | EFX_BUG_ON_PARANOID(!checksummed); |
498 | rx_buf->u.skb = NULL; | 497 | rx_buf->u.skb = NULL; |
498 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
499 | 499 | ||
500 | gro_result = napi_gro_receive(napi, skb); | 500 | gro_result = napi_gro_receive(napi, skb); |
501 | } | 501 | } |
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index d0b814ef0675..0319d640f728 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h | |||
@@ -67,6 +67,7 @@ struct stmmac_extra_stats { | |||
67 | unsigned long ipc_csum_error; | 67 | unsigned long ipc_csum_error; |
68 | unsigned long rx_collision; | 68 | unsigned long rx_collision; |
69 | unsigned long rx_crc; | 69 | unsigned long rx_crc; |
70 | unsigned long dribbling_bit; | ||
70 | unsigned long rx_length; | 71 | unsigned long rx_length; |
71 | unsigned long rx_mii; | 72 | unsigned long rx_mii; |
72 | unsigned long rx_multicast; | 73 | unsigned long rx_multicast; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c index d87976364ec5..ad1b627f8ec2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c | |||
@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x, | |||
201 | 201 | ||
202 | if (unlikely(p->des01.erx.dribbling)) { | 202 | if (unlikely(p->des01.erx.dribbling)) { |
203 | CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n"); | 203 | CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n"); |
204 | ret = discard_frame; | 204 | x->dribbling_bit++; |
205 | } | 205 | } |
206 | if (unlikely(p->des01.erx.sa_filter_fail)) { | 206 | if (unlikely(p->des01.erx.sa_filter_fail)) { |
207 | CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n"); | 207 | CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n"); |
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c index fda5d2b31d3a..25953bb45a73 100644 --- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c | |||
@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x, | |||
104 | ret = discard_frame; | 104 | ret = discard_frame; |
105 | } | 105 | } |
106 | if (unlikely(p->des01.rx.dribbling)) | 106 | if (unlikely(p->des01.rx.dribbling)) |
107 | ret = discard_frame; | 107 | x->dribbling_bit++; |
108 | 108 | ||
109 | if (unlikely(p->des01.rx.length_error)) { | 109 | if (unlikely(p->des01.rx.length_error)) { |
110 | x->rx_length++; | 110 | x->rx_length++; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 120740020e2c..b4b095fdcf29 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h | |||
@@ -21,7 +21,7 @@ | |||
21 | *******************************************************************************/ | 21 | *******************************************************************************/ |
22 | 22 | ||
23 | #define STMMAC_RESOURCE_NAME "stmmaceth" | 23 | #define STMMAC_RESOURCE_NAME "stmmaceth" |
24 | #define DRV_MODULE_VERSION "Dec_2011" | 24 | #define DRV_MODULE_VERSION "Feb_2012" |
25 | #include <linux/stmmac.h> | 25 | #include <linux/stmmac.h> |
26 | #include <linux/phy.h> | 26 | #include <linux/phy.h> |
27 | #include "common.h" | 27 | #include "common.h" |
@@ -97,4 +97,5 @@ int stmmac_resume(struct net_device *ndev); | |||
97 | int stmmac_suspend(struct net_device *ndev); | 97 | int stmmac_suspend(struct net_device *ndev); |
98 | int stmmac_dvr_remove(struct net_device *ndev); | 98 | int stmmac_dvr_remove(struct net_device *ndev); |
99 | struct stmmac_priv *stmmac_dvr_probe(struct device *device, | 99 | struct stmmac_priv *stmmac_dvr_probe(struct device *device, |
100 | struct plat_stmmacenet_data *plat_dat); | 100 | struct plat_stmmacenet_data *plat_dat, |
101 | void __iomem *addr); | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 9573303a706b..f98e1511660f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | |||
@@ -47,23 +47,25 @@ struct stmmac_stats { | |||
47 | offsetof(struct stmmac_priv, xstats.m)} | 47 | offsetof(struct stmmac_priv, xstats.m)} |
48 | 48 | ||
49 | static const struct stmmac_stats stmmac_gstrings_stats[] = { | 49 | static const struct stmmac_stats stmmac_gstrings_stats[] = { |
50 | /* Transmit errors */ | ||
50 | STMMAC_STAT(tx_underflow), | 51 | STMMAC_STAT(tx_underflow), |
51 | STMMAC_STAT(tx_carrier), | 52 | STMMAC_STAT(tx_carrier), |
52 | STMMAC_STAT(tx_losscarrier), | 53 | STMMAC_STAT(tx_losscarrier), |
53 | STMMAC_STAT(vlan_tag), | 54 | STMMAC_STAT(vlan_tag), |
54 | STMMAC_STAT(tx_deferred), | 55 | STMMAC_STAT(tx_deferred), |
55 | STMMAC_STAT(tx_vlan), | 56 | STMMAC_STAT(tx_vlan), |
56 | STMMAC_STAT(rx_vlan), | ||
57 | STMMAC_STAT(tx_jabber), | 57 | STMMAC_STAT(tx_jabber), |
58 | STMMAC_STAT(tx_frame_flushed), | 58 | STMMAC_STAT(tx_frame_flushed), |
59 | STMMAC_STAT(tx_payload_error), | 59 | STMMAC_STAT(tx_payload_error), |
60 | STMMAC_STAT(tx_ip_header_error), | 60 | STMMAC_STAT(tx_ip_header_error), |
61 | /* Receive errors */ | ||
61 | STMMAC_STAT(rx_desc), | 62 | STMMAC_STAT(rx_desc), |
62 | STMMAC_STAT(sa_filter_fail), | 63 | STMMAC_STAT(sa_filter_fail), |
63 | STMMAC_STAT(overflow_error), | 64 | STMMAC_STAT(overflow_error), |
64 | STMMAC_STAT(ipc_csum_error), | 65 | STMMAC_STAT(ipc_csum_error), |
65 | STMMAC_STAT(rx_collision), | 66 | STMMAC_STAT(rx_collision), |
66 | STMMAC_STAT(rx_crc), | 67 | STMMAC_STAT(rx_crc), |
68 | STMMAC_STAT(dribbling_bit), | ||
67 | STMMAC_STAT(rx_length), | 69 | STMMAC_STAT(rx_length), |
68 | STMMAC_STAT(rx_mii), | 70 | STMMAC_STAT(rx_mii), |
69 | STMMAC_STAT(rx_multicast), | 71 | STMMAC_STAT(rx_multicast), |
@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { | |||
73 | STMMAC_STAT(sa_rx_filter_fail), | 75 | STMMAC_STAT(sa_rx_filter_fail), |
74 | STMMAC_STAT(rx_missed_cntr), | 76 | STMMAC_STAT(rx_missed_cntr), |
75 | STMMAC_STAT(rx_overflow_cntr), | 77 | STMMAC_STAT(rx_overflow_cntr), |
78 | STMMAC_STAT(rx_vlan), | ||
79 | /* Tx/Rx IRQ errors */ | ||
76 | STMMAC_STAT(tx_undeflow_irq), | 80 | STMMAC_STAT(tx_undeflow_irq), |
77 | STMMAC_STAT(tx_process_stopped_irq), | 81 | STMMAC_STAT(tx_process_stopped_irq), |
78 | STMMAC_STAT(tx_jabber_irq), | 82 | STMMAC_STAT(tx_jabber_irq), |
@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { | |||
82 | STMMAC_STAT(rx_watchdog_irq), | 86 | STMMAC_STAT(rx_watchdog_irq), |
83 | STMMAC_STAT(tx_early_irq), | 87 | STMMAC_STAT(tx_early_irq), |
84 | STMMAC_STAT(fatal_bus_error_irq), | 88 | STMMAC_STAT(fatal_bus_error_irq), |
89 | /* Extra info */ | ||
85 | STMMAC_STAT(threshold), | 90 | STMMAC_STAT(threshold), |
86 | STMMAC_STAT(tx_pkt_n), | 91 | STMMAC_STAT(tx_pkt_n), |
87 | STMMAC_STAT(rx_pkt_n), | 92 | STMMAC_STAT(rx_pkt_n), |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 96fa2da30763..6ee593a55a64 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -241,7 +241,7 @@ static void stmmac_adjust_link(struct net_device *dev) | |||
241 | case 1000: | 241 | case 1000: |
242 | if (likely(priv->plat->has_gmac)) | 242 | if (likely(priv->plat->has_gmac)) |
243 | ctrl &= ~priv->hw->link.port; | 243 | ctrl &= ~priv->hw->link.port; |
244 | stmmac_hw_fix_mac_speed(priv); | 244 | stmmac_hw_fix_mac_speed(priv); |
245 | break; | 245 | break; |
246 | case 100: | 246 | case 100: |
247 | case 10: | 247 | case 10: |
@@ -785,7 +785,7 @@ static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) | |||
785 | u32 uid = ((hwid & 0x0000ff00) >> 8); | 785 | u32 uid = ((hwid & 0x0000ff00) >> 8); |
786 | u32 synid = (hwid & 0x000000ff); | 786 | u32 synid = (hwid & 0x000000ff); |
787 | 787 | ||
788 | pr_info("STMMAC - user ID: 0x%x, Synopsys ID: 0x%x\n", | 788 | pr_info("stmmac - user ID: 0x%x, Synopsys ID: 0x%x\n", |
789 | uid, synid); | 789 | uid, synid); |
790 | 790 | ||
791 | return synid; | 791 | return synid; |
@@ -869,38 +869,6 @@ static int stmmac_get_hw_features(struct stmmac_priv *priv) | |||
869 | return hw_cap; | 869 | return hw_cap; |
870 | } | 870 | } |
871 | 871 | ||
872 | /** | ||
873 | * stmmac_mac_device_setup | ||
874 | * @dev : device pointer | ||
875 | * Description: this is to attach the GMAC or MAC 10/100 | ||
876 | * main core structures that will be completed during the | ||
877 | * open step. | ||
878 | */ | ||
879 | static int stmmac_mac_device_setup(struct net_device *dev) | ||
880 | { | ||
881 | struct stmmac_priv *priv = netdev_priv(dev); | ||
882 | |||
883 | struct mac_device_info *device; | ||
884 | |||
885 | if (priv->plat->has_gmac) | ||
886 | device = dwmac1000_setup(priv->ioaddr); | ||
887 | else | ||
888 | device = dwmac100_setup(priv->ioaddr); | ||
889 | |||
890 | if (!device) | ||
891 | return -ENOMEM; | ||
892 | |||
893 | priv->hw = device; | ||
894 | priv->hw->ring = &ring_mode_ops; | ||
895 | |||
896 | if (device_can_wakeup(priv->device)) { | ||
897 | priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */ | ||
898 | enable_irq_wake(priv->wol_irq); | ||
899 | } | ||
900 | |||
901 | return 0; | ||
902 | } | ||
903 | |||
904 | static void stmmac_check_ether_addr(struct stmmac_priv *priv) | 872 | static void stmmac_check_ether_addr(struct stmmac_priv *priv) |
905 | { | 873 | { |
906 | /* verify if the MAC address is valid, in case of failures it | 874 | /* verify if the MAC address is valid, in case of failures it |
@@ -930,20 +898,8 @@ static int stmmac_open(struct net_device *dev) | |||
930 | struct stmmac_priv *priv = netdev_priv(dev); | 898 | struct stmmac_priv *priv = netdev_priv(dev); |
931 | int ret; | 899 | int ret; |
932 | 900 | ||
933 | /* MAC HW device setup */ | ||
934 | ret = stmmac_mac_device_setup(dev); | ||
935 | if (ret < 0) | ||
936 | return ret; | ||
937 | |||
938 | stmmac_check_ether_addr(priv); | 901 | stmmac_check_ether_addr(priv); |
939 | 902 | ||
940 | stmmac_verify_args(); | ||
941 | |||
942 | /* Override with kernel parameters if supplied XXX CRS XXX | ||
943 | * this needs to have multiple instances */ | ||
944 | if ((phyaddr >= 0) && (phyaddr <= 31)) | ||
945 | priv->plat->phy_addr = phyaddr; | ||
946 | |||
947 | /* MDIO bus Registration */ | 903 | /* MDIO bus Registration */ |
948 | ret = stmmac_mdio_register(dev); | 904 | ret = stmmac_mdio_register(dev); |
949 | if (ret < 0) { | 905 | if (ret < 0) { |
@@ -976,44 +932,6 @@ static int stmmac_open(struct net_device *dev) | |||
976 | goto open_error; | 932 | goto open_error; |
977 | } | 933 | } |
978 | 934 | ||
979 | stmmac_get_synopsys_id(priv); | ||
980 | |||
981 | priv->hw_cap_support = stmmac_get_hw_features(priv); | ||
982 | |||
983 | if (priv->hw_cap_support) { | ||
984 | pr_info(" Support DMA HW capability register"); | ||
985 | |||
986 | /* We can override some gmac/dma configuration fields: e.g. | ||
987 | * enh_desc, tx_coe (e.g. that are passed through the | ||
988 | * platform) with the values from the HW capability | ||
989 | * register (if supported). | ||
990 | */ | ||
991 | priv->plat->enh_desc = priv->dma_cap.enh_desc; | ||
992 | priv->plat->tx_coe = priv->dma_cap.tx_coe; | ||
993 | priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up; | ||
994 | |||
995 | /* By default disable wol on magic frame if not supported */ | ||
996 | if (!priv->dma_cap.pmt_magic_frame) | ||
997 | priv->wolopts &= ~WAKE_MAGIC; | ||
998 | |||
999 | } else | ||
1000 | pr_info(" No HW DMA feature register supported"); | ||
1001 | |||
1002 | /* Select the enhnaced/normal descriptor structures */ | ||
1003 | stmmac_selec_desc_mode(priv); | ||
1004 | |||
1005 | /* PMT module is not integrated in all the MAC devices. */ | ||
1006 | if (priv->plat->pmt) { | ||
1007 | pr_info(" Remote wake-up capable\n"); | ||
1008 | device_set_wakeup_capable(priv->device, 1); | ||
1009 | } | ||
1010 | |||
1011 | priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr); | ||
1012 | if (priv->rx_coe) | ||
1013 | pr_info(" Checksum Offload Engine supported\n"); | ||
1014 | if (priv->plat->tx_coe) | ||
1015 | pr_info(" Checksum insertion supported\n"); | ||
1016 | |||
1017 | /* Create and initialize the TX/RX descriptors chains. */ | 935 | /* Create and initialize the TX/RX descriptors chains. */ |
1018 | priv->dma_tx_size = STMMAC_ALIGN(dma_txsize); | 936 | priv->dma_tx_size = STMMAC_ALIGN(dma_txsize); |
1019 | priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize); | 937 | priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize); |
@@ -1030,14 +948,14 @@ static int stmmac_open(struct net_device *dev) | |||
1030 | 948 | ||
1031 | /* Copy the MAC addr into the HW */ | 949 | /* Copy the MAC addr into the HW */ |
1032 | priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0); | 950 | priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0); |
951 | |||
1033 | /* If required, perform hw setup of the bus. */ | 952 | /* If required, perform hw setup of the bus. */ |
1034 | if (priv->plat->bus_setup) | 953 | if (priv->plat->bus_setup) |
1035 | priv->plat->bus_setup(priv->ioaddr); | 954 | priv->plat->bus_setup(priv->ioaddr); |
955 | |||
1036 | /* Initialize the MAC Core */ | 956 | /* Initialize the MAC Core */ |
1037 | priv->hw->mac->core_init(priv->ioaddr); | 957 | priv->hw->mac->core_init(priv->ioaddr); |
1038 | 958 | ||
1039 | netdev_update_features(dev); | ||
1040 | |||
1041 | /* Request the IRQ lines */ | 959 | /* Request the IRQ lines */ |
1042 | ret = request_irq(dev->irq, stmmac_interrupt, | 960 | ret = request_irq(dev->irq, stmmac_interrupt, |
1043 | IRQF_SHARED, dev->name, dev); | 961 | IRQF_SHARED, dev->name, dev); |
@@ -1047,6 +965,17 @@ static int stmmac_open(struct net_device *dev) | |||
1047 | goto open_error; | 965 | goto open_error; |
1048 | } | 966 | } |
1049 | 967 | ||
968 | /* Request the Wake IRQ in case of another line is used for WoL */ | ||
969 | if (priv->wol_irq != dev->irq) { | ||
970 | ret = request_irq(priv->wol_irq, stmmac_interrupt, | ||
971 | IRQF_SHARED, dev->name, dev); | ||
972 | if (unlikely(ret < 0)) { | ||
973 | pr_err("%s: ERROR: allocating the ext WoL IRQ %d " | ||
974 | "(error: %d)\n", __func__, priv->wol_irq, ret); | ||
975 | goto open_error_wolirq; | ||
976 | } | ||
977 | } | ||
978 | |||
1050 | /* Enable the MAC Rx/Tx */ | 979 | /* Enable the MAC Rx/Tx */ |
1051 | stmmac_set_mac(priv->ioaddr, true); | 980 | stmmac_set_mac(priv->ioaddr, true); |
1052 | 981 | ||
@@ -1062,7 +991,7 @@ static int stmmac_open(struct net_device *dev) | |||
1062 | #ifdef CONFIG_STMMAC_DEBUG_FS | 991 | #ifdef CONFIG_STMMAC_DEBUG_FS |
1063 | ret = stmmac_init_fs(dev); | 992 | ret = stmmac_init_fs(dev); |
1064 | if (ret < 0) | 993 | if (ret < 0) |
1065 | pr_warning("\tFailed debugFS registration"); | 994 | pr_warning("%s: failed debugFS registration\n", __func__); |
1066 | #endif | 995 | #endif |
1067 | /* Start the ball rolling... */ | 996 | /* Start the ball rolling... */ |
1068 | DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name); | 997 | DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name); |
@@ -1072,6 +1001,7 @@ static int stmmac_open(struct net_device *dev) | |||
1072 | #ifdef CONFIG_STMMAC_TIMER | 1001 | #ifdef CONFIG_STMMAC_TIMER |
1073 | priv->tm->timer_start(tmrate); | 1002 | priv->tm->timer_start(tmrate); |
1074 | #endif | 1003 | #endif |
1004 | |||
1075 | /* Dump DMA/MAC registers */ | 1005 | /* Dump DMA/MAC registers */ |
1076 | if (netif_msg_hw(priv)) { | 1006 | if (netif_msg_hw(priv)) { |
1077 | priv->hw->mac->dump_regs(priv->ioaddr); | 1007 | priv->hw->mac->dump_regs(priv->ioaddr); |
@@ -1087,6 +1017,9 @@ static int stmmac_open(struct net_device *dev) | |||
1087 | 1017 | ||
1088 | return 0; | 1018 | return 0; |
1089 | 1019 | ||
1020 | open_error_wolirq: | ||
1021 | free_irq(dev->irq, dev); | ||
1022 | |||
1090 | open_error: | 1023 | open_error: |
1091 | #ifdef CONFIG_STMMAC_TIMER | 1024 | #ifdef CONFIG_STMMAC_TIMER |
1092 | kfree(priv->tm); | 1025 | kfree(priv->tm); |
@@ -1127,6 +1060,8 @@ static int stmmac_release(struct net_device *dev) | |||
1127 | 1060 | ||
1128 | /* Free the IRQ lines */ | 1061 | /* Free the IRQ lines */ |
1129 | free_irq(dev->irq, dev); | 1062 | free_irq(dev->irq, dev); |
1063 | if (priv->wol_irq != dev->irq) | ||
1064 | free_irq(priv->wol_irq, dev); | ||
1130 | 1065 | ||
1131 | /* Stop TX/RX DMA and clear the descriptors */ | 1066 | /* Stop TX/RX DMA and clear the descriptors */ |
1132 | priv->hw->dma->stop_tx(priv->ioaddr); | 1067 | priv->hw->dma->stop_tx(priv->ioaddr); |
@@ -1789,13 +1724,77 @@ static const struct net_device_ops stmmac_netdev_ops = { | |||
1789 | }; | 1724 | }; |
1790 | 1725 | ||
1791 | /** | 1726 | /** |
1727 | * stmmac_hw_init - Init the MAC device | ||
1728 | * @priv : pointer to the private device structure. | ||
1729 | * Description: this function detects which MAC device | ||
1730 | * (GMAC/MAC10-100) has to attached, checks the HW capability | ||
1731 | * (if supported) and sets the driver's features (for example | ||
1732 | * to use the ring or chaine mode or support the normal/enh | ||
1733 | * descriptor structure). | ||
1734 | */ | ||
1735 | static int stmmac_hw_init(struct stmmac_priv *priv) | ||
1736 | { | ||
1737 | int ret = 0; | ||
1738 | struct mac_device_info *mac; | ||
1739 | |||
1740 | /* Identify the MAC HW device */ | ||
1741 | if (priv->plat->has_gmac) | ||
1742 | mac = dwmac1000_setup(priv->ioaddr); | ||
1743 | else | ||
1744 | mac = dwmac100_setup(priv->ioaddr); | ||
1745 | if (!mac) | ||
1746 | return -ENOMEM; | ||
1747 | |||
1748 | priv->hw = mac; | ||
1749 | |||
1750 | /* To use the chained or ring mode */ | ||
1751 | priv->hw->ring = &ring_mode_ops; | ||
1752 | |||
1753 | /* Get and dump the chip ID */ | ||
1754 | stmmac_get_synopsys_id(priv); | ||
1755 | |||
1756 | /* Get the HW capability (new GMAC newer than 3.50a) */ | ||
1757 | priv->hw_cap_support = stmmac_get_hw_features(priv); | ||
1758 | if (priv->hw_cap_support) { | ||
1759 | pr_info(" DMA HW capability register supported"); | ||
1760 | |||
1761 | /* We can override some gmac/dma configuration fields: e.g. | ||
1762 | * enh_desc, tx_coe (e.g. that are passed through the | ||
1763 | * platform) with the values from the HW capability | ||
1764 | * register (if supported). | ||
1765 | */ | ||
1766 | priv->plat->enh_desc = priv->dma_cap.enh_desc; | ||
1767 | priv->plat->tx_coe = priv->dma_cap.tx_coe; | ||
1768 | priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up; | ||
1769 | } else | ||
1770 | pr_info(" No HW DMA feature register supported"); | ||
1771 | |||
1772 | /* Select the enhnaced/normal descriptor structures */ | ||
1773 | stmmac_selec_desc_mode(priv); | ||
1774 | |||
1775 | priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr); | ||
1776 | if (priv->rx_coe) | ||
1777 | pr_info(" RX Checksum Offload Engine supported\n"); | ||
1778 | if (priv->plat->tx_coe) | ||
1779 | pr_info(" TX Checksum insertion supported\n"); | ||
1780 | |||
1781 | if (priv->plat->pmt) { | ||
1782 | pr_info(" Wake-Up On Lan supported\n"); | ||
1783 | device_set_wakeup_capable(priv->device, 1); | ||
1784 | } | ||
1785 | |||
1786 | return ret; | ||
1787 | } | ||
1788 | |||
1789 | /** | ||
1792 | * stmmac_dvr_probe | 1790 | * stmmac_dvr_probe |
1793 | * @device: device pointer | 1791 | * @device: device pointer |
1794 | * Description: this is the main probe function used to | 1792 | * Description: this is the main probe function used to |
1795 | * call the alloc_etherdev, allocate the priv structure. | 1793 | * call the alloc_etherdev, allocate the priv structure. |
1796 | */ | 1794 | */ |
1797 | struct stmmac_priv *stmmac_dvr_probe(struct device *device, | 1795 | struct stmmac_priv *stmmac_dvr_probe(struct device *device, |
1798 | struct plat_stmmacenet_data *plat_dat) | 1796 | struct plat_stmmacenet_data *plat_dat, |
1797 | void __iomem *addr) | ||
1799 | { | 1798 | { |
1800 | int ret = 0; | 1799 | int ret = 0; |
1801 | struct net_device *ndev = NULL; | 1800 | struct net_device *ndev = NULL; |
@@ -1815,10 +1814,27 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |||
1815 | 1814 | ||
1816 | ether_setup(ndev); | 1815 | ether_setup(ndev); |
1817 | 1816 | ||
1818 | ndev->netdev_ops = &stmmac_netdev_ops; | ||
1819 | stmmac_set_ethtool_ops(ndev); | 1817 | stmmac_set_ethtool_ops(ndev); |
1818 | priv->pause = pause; | ||
1819 | priv->plat = plat_dat; | ||
1820 | priv->ioaddr = addr; | ||
1821 | priv->dev->base_addr = (unsigned long)addr; | ||
1822 | |||
1823 | /* Verify driver arguments */ | ||
1824 | stmmac_verify_args(); | ||
1825 | |||
1826 | /* Override with kernel parameters if supplied XXX CRS XXX | ||
1827 | * this needs to have multiple instances */ | ||
1828 | if ((phyaddr >= 0) && (phyaddr <= 31)) | ||
1829 | priv->plat->phy_addr = phyaddr; | ||
1830 | |||
1831 | /* Init MAC and get the capabilities */ | ||
1832 | stmmac_hw_init(priv); | ||
1833 | |||
1834 | ndev->netdev_ops = &stmmac_netdev_ops; | ||
1820 | 1835 | ||
1821 | ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | 1836 | ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1837 | NETIF_F_RXCSUM; | ||
1822 | ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; | 1838 | ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; |
1823 | ndev->watchdog_timeo = msecs_to_jiffies(watchdog); | 1839 | ndev->watchdog_timeo = msecs_to_jiffies(watchdog); |
1824 | #ifdef STMMAC_VLAN_TAG_USED | 1840 | #ifdef STMMAC_VLAN_TAG_USED |
@@ -1830,8 +1846,6 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |||
1830 | if (flow_ctrl) | 1846 | if (flow_ctrl) |
1831 | priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */ | 1847 | priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */ |
1832 | 1848 | ||
1833 | priv->pause = pause; | ||
1834 | priv->plat = plat_dat; | ||
1835 | netif_napi_add(ndev, &priv->napi, stmmac_poll, 64); | 1849 | netif_napi_add(ndev, &priv->napi, stmmac_poll, 64); |
1836 | 1850 | ||
1837 | spin_lock_init(&priv->lock); | 1851 | spin_lock_init(&priv->lock); |
@@ -1839,15 +1853,10 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |||
1839 | 1853 | ||
1840 | ret = register_netdev(ndev); | 1854 | ret = register_netdev(ndev); |
1841 | if (ret) { | 1855 | if (ret) { |
1842 | pr_err("%s: ERROR %i registering the device\n", | 1856 | pr_err("%s: ERROR %i registering the device\n", __func__, ret); |
1843 | __func__, ret); | ||
1844 | goto error; | 1857 | goto error; |
1845 | } | 1858 | } |
1846 | 1859 | ||
1847 | DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n", | ||
1848 | ndev->name, (ndev->features & NETIF_F_SG) ? "on" : "off", | ||
1849 | (ndev->features & NETIF_F_IP_CSUM) ? "on" : "off"); | ||
1850 | |||
1851 | return priv; | 1860 | return priv; |
1852 | 1861 | ||
1853 | error: | 1862 | error: |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index c796de9eed72..50ad5b80cfaf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | |||
@@ -96,13 +96,11 @@ static int __devinit stmmac_pci_probe(struct pci_dev *pdev, | |||
96 | 96 | ||
97 | stmmac_default_data(); | 97 | stmmac_default_data(); |
98 | 98 | ||
99 | priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat); | 99 | priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat, addr); |
100 | if (!priv) { | 100 | if (!priv) { |
101 | pr_err("%s: main drivr probe failed", __func__); | 101 | pr_err("%s: main driver probe failed", __func__); |
102 | goto err_out; | 102 | goto err_out; |
103 | } | 103 | } |
104 | priv->ioaddr = addr; | ||
105 | priv->dev->base_addr = (unsigned long)addr; | ||
106 | priv->dev->irq = pdev->irq; | 104 | priv->dev->irq = pdev->irq; |
107 | priv->wol_irq = pdev->irq; | 105 | priv->wol_irq = pdev->irq; |
108 | 106 | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 1ac83243649a..3aad9810237c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -59,16 +59,20 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) | |||
59 | goto out_release_region; | 59 | goto out_release_region; |
60 | } | 60 | } |
61 | plat_dat = pdev->dev.platform_data; | 61 | plat_dat = pdev->dev.platform_data; |
62 | priv = stmmac_dvr_probe(&(pdev->dev), plat_dat); | 62 | |
63 | /* Custom initialisation (if needed)*/ | ||
64 | if (plat_dat->init) { | ||
65 | ret = plat_dat->init(pdev); | ||
66 | if (unlikely(ret)) | ||
67 | goto out_unmap; | ||
68 | } | ||
69 | |||
70 | priv = stmmac_dvr_probe(&(pdev->dev), plat_dat, addr); | ||
63 | if (!priv) { | 71 | if (!priv) { |
64 | pr_err("%s: main drivr probe failed", __func__); | 72 | pr_err("%s: main driver probe failed", __func__); |
65 | goto out_unmap; | 73 | goto out_unmap; |
66 | } | 74 | } |
67 | 75 | ||
68 | priv->ioaddr = addr; | ||
69 | /* Set the I/O base addr */ | ||
70 | priv->dev->base_addr = (unsigned long)addr; | ||
71 | |||
72 | /* Get the MAC information */ | 76 | /* Get the MAC information */ |
73 | priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); | 77 | priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); |
74 | if (priv->dev->irq == -ENXIO) { | 78 | if (priv->dev->irq == -ENXIO) { |
@@ -92,13 +96,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) | |||
92 | 96 | ||
93 | platform_set_drvdata(pdev, priv->dev); | 97 | platform_set_drvdata(pdev, priv->dev); |
94 | 98 | ||
95 | /* Custom initialisation */ | ||
96 | if (priv->plat->init) { | ||
97 | ret = priv->plat->init(pdev); | ||
98 | if (unlikely(ret)) | ||
99 | goto out_unmap; | ||
100 | } | ||
101 | |||
102 | pr_debug("STMMAC platform driver registration completed"); | 99 | pr_debug("STMMAC platform driver registration completed"); |
103 | 100 | ||
104 | return 0; | 101 | return 0; |
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c index 4d9a28ffd3c3..cbc8df78d84b 100644 --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c | |||
@@ -1122,7 +1122,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
1122 | pdata = pdev->dev.platform_data; | 1122 | pdata = pdev->dev.platform_data; |
1123 | 1123 | ||
1124 | if (external_switch || dumb_switch) { | 1124 | if (external_switch || dumb_switch) { |
1125 | strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ | 1125 | strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */ |
1126 | phy_id = pdev->id; | 1126 | phy_id = pdev->id; |
1127 | } else { | 1127 | } else { |
1128 | for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { | 1128 | for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { |
@@ -1138,7 +1138,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
1138 | if (phy_id == PHY_MAX_ADDR) { | 1138 | if (phy_id == PHY_MAX_ADDR) { |
1139 | dev_err(&pdev->dev, "no PHY present, falling back " | 1139 | dev_err(&pdev->dev, "no PHY present, falling back " |
1140 | "to switch on MDIO bus 0\n"); | 1140 | "to switch on MDIO bus 0\n"); |
1141 | strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ | 1141 | strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */ |
1142 | phy_id = pdev->id; | 1142 | phy_id = pdev->id; |
1143 | } | 1143 | } |
1144 | 1144 | ||
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index 794ac30a577b..4b2f54565f64 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c | |||
@@ -1009,7 +1009,7 @@ static void emac_rx_handler(void *token, int len, int status) | |||
1009 | int ret; | 1009 | int ret; |
1010 | 1010 | ||
1011 | /* free and bail if we are shutting down */ | 1011 | /* free and bail if we are shutting down */ |
1012 | if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) { | 1012 | if (unlikely(!netif_running(ndev))) { |
1013 | dev_kfree_skb_any(skb); | 1013 | dev_kfree_skb_any(skb); |
1014 | return; | 1014 | return; |
1015 | } | 1015 | } |
@@ -1038,7 +1038,9 @@ static void emac_rx_handler(void *token, int len, int status) | |||
1038 | recycle: | 1038 | recycle: |
1039 | ret = cpdma_chan_submit(priv->rxchan, skb, skb->data, | 1039 | ret = cpdma_chan_submit(priv->rxchan, skb, skb->data, |
1040 | skb_tailroom(skb), GFP_KERNEL); | 1040 | skb_tailroom(skb), GFP_KERNEL); |
1041 | if (WARN_ON(ret < 0)) | 1041 | |
1042 | WARN_ON(ret == -ENOMEM); | ||
1043 | if (unlikely(ret < 0)) | ||
1042 | dev_kfree_skb_any(skb); | 1044 | dev_kfree_skb_any(skb); |
1043 | } | 1045 | } |
1044 | 1046 | ||
@@ -1600,8 +1602,9 @@ static int emac_dev_open(struct net_device *ndev) | |||
1600 | if (IS_ERR(priv->phydev)) { | 1602 | if (IS_ERR(priv->phydev)) { |
1601 | dev_err(emac_dev, "could not connect to phy %s\n", | 1603 | dev_err(emac_dev, "could not connect to phy %s\n", |
1602 | priv->phy_id); | 1604 | priv->phy_id); |
1605 | ret = PTR_ERR(priv->phydev); | ||
1603 | priv->phydev = NULL; | 1606 | priv->phydev = NULL; |
1604 | return PTR_ERR(priv->phydev); | 1607 | return ret; |
1605 | } | 1608 | } |
1606 | 1609 | ||
1607 | priv->link = 0; | 1610 | priv->link = 0; |
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index ef7c9c17bfff..af8b8fc39eb2 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c | |||
@@ -318,9 +318,9 @@ static int __devinit davinci_mdio_probe(struct platform_device *pdev) | |||
318 | 318 | ||
319 | data->clk = clk_get(dev, NULL); | 319 | data->clk = clk_get(dev, NULL); |
320 | if (IS_ERR(data->clk)) { | 320 | if (IS_ERR(data->clk)) { |
321 | data->clk = NULL; | ||
322 | dev_err(dev, "failed to get device clock\n"); | 321 | dev_err(dev, "failed to get device clock\n"); |
323 | ret = PTR_ERR(data->clk); | 322 | ret = PTR_ERR(data->clk); |
323 | data->clk = NULL; | ||
324 | goto bail_out; | 324 | goto bail_out; |
325 | } | 325 | } |
326 | 326 | ||
diff --git a/drivers/net/ethernet/toshiba/Kconfig b/drivers/net/ethernet/toshiba/Kconfig index 051764704559..74acb5cf6099 100644 --- a/drivers/net/ethernet/toshiba/Kconfig +++ b/drivers/net/ethernet/toshiba/Kconfig | |||
@@ -5,7 +5,7 @@ | |||
5 | config NET_VENDOR_TOSHIBA | 5 | config NET_VENDOR_TOSHIBA |
6 | bool "Toshiba devices" | 6 | bool "Toshiba devices" |
7 | default y | 7 | default y |
8 | depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB) || PPC_PS3 | 8 | depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB || MIPS) || PPC_PS3 |
9 | ---help--- | 9 | ---help--- |
10 | If you have a network (Ethernet) card belonging to this class, say Y | 10 | If you have a network (Ethernet) card belonging to this class, say Y |
11 | and read the Ethernet-HOWTO, available from | 11 | and read the Ethernet-HOWTO, available from |
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index 4128d6b8cc28..cb35b14b73bb 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c | |||
@@ -2491,9 +2491,6 @@ static int velocity_close(struct net_device *dev) | |||
2491 | if (dev->irq != 0) | 2491 | if (dev->irq != 0) |
2492 | free_irq(dev->irq, dev); | 2492 | free_irq(dev->irq, dev); |
2493 | 2493 | ||
2494 | /* Power down the chip */ | ||
2495 | pci_set_power_state(vptr->pdev, PCI_D3hot); | ||
2496 | |||
2497 | velocity_free_rings(vptr); | 2494 | velocity_free_rings(vptr); |
2498 | 2495 | ||
2499 | vptr->flags &= (~VELOCITY_FLAGS_OPENED); | 2496 | vptr->flags &= (~VELOCITY_FLAGS_OPENED); |
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 72a854f05bb8..41a8b5a9849e 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c | |||
@@ -1416,7 +1416,8 @@ static int __devinit eth_init_one(struct platform_device *pdev) | |||
1416 | __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); | 1416 | __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); |
1417 | udelay(50); | 1417 | udelay(50); |
1418 | 1418 | ||
1419 | snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy); | 1419 | snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, |
1420 | mdio_bus->id, plat->phy); | ||
1420 | port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, | 1421 | port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, |
1421 | PHY_INTERFACE_MODE_MII); | 1422 | PHY_INTERFACE_MODE_MII); |
1422 | if (IS_ERR(port->phydev)) { | 1423 | if (IS_ERR(port->phydev)) { |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 1a1ca6cfc74a..bf01841bda5b 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -123,7 +123,7 @@ static int netvsc_close(struct net_device *net) | |||
123 | struct hv_device *device_obj = net_device_ctx->device_ctx; | 123 | struct hv_device *device_obj = net_device_ctx->device_ctx; |
124 | int ret; | 124 | int ret; |
125 | 125 | ||
126 | netif_stop_queue(net); | 126 | netif_tx_disable(net); |
127 | 127 | ||
128 | ret = rndis_filter_close(device_obj); | 128 | ret = rndis_filter_close(device_obj); |
129 | if (ret != 0) | 129 | if (ret != 0) |
@@ -151,10 +151,10 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) | |||
151 | int ret; | 151 | int ret; |
152 | unsigned int i, num_pages, npg_data; | 152 | unsigned int i, num_pages, npg_data; |
153 | 153 | ||
154 | /* Add multipage for skb->data and additional one for RNDIS */ | 154 | /* Add multipages for skb->data and additional 2 for RNDIS */ |
155 | npg_data = (((unsigned long)skb->data + skb_headlen(skb) - 1) | 155 | npg_data = (((unsigned long)skb->data + skb_headlen(skb) - 1) |
156 | >> PAGE_SHIFT) - ((unsigned long)skb->data >> PAGE_SHIFT) + 1; | 156 | >> PAGE_SHIFT) - ((unsigned long)skb->data >> PAGE_SHIFT) + 1; |
157 | num_pages = skb_shinfo(skb)->nr_frags + npg_data + 1; | 157 | num_pages = skb_shinfo(skb)->nr_frags + npg_data + 2; |
158 | 158 | ||
159 | /* Allocate a netvsc packet based on # of frags. */ | 159 | /* Allocate a netvsc packet based on # of frags. */ |
160 | packet = kzalloc(sizeof(struct hv_netvsc_packet) + | 160 | packet = kzalloc(sizeof(struct hv_netvsc_packet) + |
@@ -173,8 +173,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) | |||
173 | sizeof(struct hv_netvsc_packet) + | 173 | sizeof(struct hv_netvsc_packet) + |
174 | (num_pages * sizeof(struct hv_page_buffer)); | 174 | (num_pages * sizeof(struct hv_page_buffer)); |
175 | 175 | ||
176 | /* Setup the rndis header */ | 176 | /* If the rndis msg goes beyond 1 page, we will add 1 later */ |
177 | packet->page_buf_cnt = num_pages; | 177 | packet->page_buf_cnt = num_pages - 1; |
178 | 178 | ||
179 | /* Initialize it from the skb */ | 179 | /* Initialize it from the skb */ |
180 | packet->total_data_buflen = skb->len; | 180 | packet->total_data_buflen = skb->len; |
@@ -256,7 +256,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, | |||
256 | schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20)); | 256 | schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20)); |
257 | } else { | 257 | } else { |
258 | netif_carrier_off(net); | 258 | netif_carrier_off(net); |
259 | netif_stop_queue(net); | 259 | netif_tx_disable(net); |
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
@@ -298,7 +298,7 @@ int netvsc_recv_callback(struct hv_device *device_obj, | |||
298 | skb->ip_summed = CHECKSUM_NONE; | 298 | skb->ip_summed = CHECKSUM_NONE; |
299 | 299 | ||
300 | net->stats.rx_packets++; | 300 | net->stats.rx_packets++; |
301 | net->stats.rx_bytes += skb->len; | 301 | net->stats.rx_bytes += packet->total_data_buflen; |
302 | 302 | ||
303 | /* | 303 | /* |
304 | * Pass the skb back up. Network stack will deallocate the skb when it | 304 | * Pass the skb back up. Network stack will deallocate the skb when it |
@@ -313,7 +313,7 @@ int netvsc_recv_callback(struct hv_device *device_obj, | |||
313 | static void netvsc_get_drvinfo(struct net_device *net, | 313 | static void netvsc_get_drvinfo(struct net_device *net, |
314 | struct ethtool_drvinfo *info) | 314 | struct ethtool_drvinfo *info) |
315 | { | 315 | { |
316 | strcpy(info->driver, "hv_netvsc"); | 316 | strcpy(info->driver, KBUILD_MODNAME); |
317 | strcpy(info->version, HV_DRV_VERSION); | 317 | strcpy(info->version, HV_DRV_VERSION); |
318 | strcpy(info->fw_version, "N/A"); | 318 | strcpy(info->fw_version, "N/A"); |
319 | } | 319 | } |
@@ -337,7 +337,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) | |||
337 | 337 | ||
338 | nvdev->start_remove = true; | 338 | nvdev->start_remove = true; |
339 | cancel_delayed_work_sync(&ndevctx->dwork); | 339 | cancel_delayed_work_sync(&ndevctx->dwork); |
340 | netif_stop_queue(ndev); | 340 | netif_tx_disable(ndev); |
341 | rndis_filter_device_remove(hdev); | 341 | rndis_filter_device_remove(hdev); |
342 | 342 | ||
343 | ndev->mtu = mtu; | 343 | ndev->mtu = mtu; |
@@ -460,7 +460,7 @@ static int netvsc_remove(struct hv_device *dev) | |||
460 | cancel_delayed_work_sync(&ndev_ctx->dwork); | 460 | cancel_delayed_work_sync(&ndev_ctx->dwork); |
461 | 461 | ||
462 | /* Stop outbound asap */ | 462 | /* Stop outbound asap */ |
463 | netif_stop_queue(net); | 463 | netif_tx_disable(net); |
464 | 464 | ||
465 | unregister_netdev(net); | 465 | unregister_netdev(net); |
466 | 466 | ||
@@ -485,7 +485,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table); | |||
485 | 485 | ||
486 | /* The one and only one */ | 486 | /* The one and only one */ |
487 | static struct hv_driver netvsc_drv = { | 487 | static struct hv_driver netvsc_drv = { |
488 | .name = "netvsc", | 488 | .name = KBUILD_MODNAME, |
489 | .id_table = id_table, | 489 | .id_table = id_table, |
490 | .probe = netvsc_probe, | 490 | .probe = netvsc_probe, |
491 | .remove = netvsc_remove, | 491 | .remove = netvsc_remove, |
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index da181f9a49d1..133b7fbf8595 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c | |||
@@ -321,6 +321,25 @@ static void rndis_filter_receive_data(struct rndis_device *dev, | |||
321 | data_offset = RNDIS_HEADER_SIZE + rndis_pkt->data_offset; | 321 | data_offset = RNDIS_HEADER_SIZE + rndis_pkt->data_offset; |
322 | 322 | ||
323 | pkt->total_data_buflen -= data_offset; | 323 | pkt->total_data_buflen -= data_offset; |
324 | |||
325 | /* | ||
326 | * Make sure we got a valid RNDIS message, now total_data_buflen | ||
327 | * should be the data packet size plus the trailer padding size | ||
328 | */ | ||
329 | if (pkt->total_data_buflen < rndis_pkt->data_len) { | ||
330 | netdev_err(dev->net_dev->ndev, "rndis message buffer " | ||
331 | "overflow detected (got %u, min %u)" | ||
332 | "...dropping this message!\n", | ||
333 | pkt->total_data_buflen, rndis_pkt->data_len); | ||
334 | return; | ||
335 | } | ||
336 | |||
337 | /* | ||
338 | * Remove the rndis trailer padding from rndis packet message | ||
339 | * rndis_pkt->data_len tell us the real data length, we only copy | ||
340 | * the data packet to the stack, without the rndis trailer padding | ||
341 | */ | ||
342 | pkt->total_data_buflen = rndis_pkt->data_len; | ||
324 | pkt->data = (void *)((unsigned long)pkt->data + data_offset); | 343 | pkt->data = (void *)((unsigned long)pkt->data + data_offset); |
325 | 344 | ||
326 | pkt->is_data_pkt = true; | 345 | pkt->is_data_pkt = true; |
@@ -778,6 +797,19 @@ int rndis_filter_send(struct hv_device *dev, | |||
778 | (unsigned long)rndisMessage & (PAGE_SIZE-1); | 797 | (unsigned long)rndisMessage & (PAGE_SIZE-1); |
779 | pkt->page_buf[0].len = rndisMessageSize; | 798 | pkt->page_buf[0].len = rndisMessageSize; |
780 | 799 | ||
800 | /* Add one page_buf if the rndis msg goes beyond page boundary */ | ||
801 | if (pkt->page_buf[0].offset + rndisMessageSize > PAGE_SIZE) { | ||
802 | int i; | ||
803 | for (i = pkt->page_buf_cnt; i > 1; i--) | ||
804 | pkt->page_buf[i] = pkt->page_buf[i-1]; | ||
805 | pkt->page_buf_cnt++; | ||
806 | pkt->page_buf[0].len = PAGE_SIZE - pkt->page_buf[0].offset; | ||
807 | pkt->page_buf[1].pfn = virt_to_phys((void *)((ulong) | ||
808 | rndisMessage + pkt->page_buf[0].len)) >> PAGE_SHIFT; | ||
809 | pkt->page_buf[1].offset = 0; | ||
810 | pkt->page_buf[1].len = rndisMessageSize - pkt->page_buf[0].len; | ||
811 | } | ||
812 | |||
781 | /* Save the packet send completion and context */ | 813 | /* Save the packet send completion and context */ |
782 | filterPacket->completion = pkt->completion.send.send_completion; | 814 | filterPacket->completion = pkt->completion.send.send_completion; |
783 | filterPacket->completion_ctx = | 815 | filterPacket->completion_ctx = |
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index c81f136ae670..0856e1b7a849 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c | |||
@@ -30,16 +30,16 @@ | |||
30 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
31 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
32 | 32 | ||
33 | MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IC1001 PHY drivers"); | 33 | MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IP101G/IC1001 PHY drivers"); |
34 | MODULE_AUTHOR("Michael Barkowski"); | 34 | MODULE_AUTHOR("Michael Barkowski"); |
35 | MODULE_LICENSE("GPL"); | 35 | MODULE_LICENSE("GPL"); |
36 | 36 | ||
37 | /* IP101A/IP1001 */ | 37 | /* IP101A/G - IP1001 */ |
38 | #define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */ | 38 | #define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */ |
39 | #define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */ | 39 | #define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */ |
40 | #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ | 40 | #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ |
41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ | 41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ |
42 | #define IP101A_APS_ON 2 /* IP101A APS Mode bit */ | 42 | #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ |
43 | 43 | ||
44 | static int ip175c_config_init(struct phy_device *phydev) | 44 | static int ip175c_config_init(struct phy_device *phydev) |
45 | { | 45 | { |
@@ -98,20 +98,24 @@ static int ip175c_config_init(struct phy_device *phydev) | |||
98 | 98 | ||
99 | static int ip1xx_reset(struct phy_device *phydev) | 99 | static int ip1xx_reset(struct phy_device *phydev) |
100 | { | 100 | { |
101 | int err, bmcr; | 101 | int bmcr; |
102 | 102 | ||
103 | /* Software Reset PHY */ | 103 | /* Software Reset PHY */ |
104 | bmcr = phy_read(phydev, MII_BMCR); | 104 | bmcr = phy_read(phydev, MII_BMCR); |
105 | if (bmcr < 0) | ||
106 | return bmcr; | ||
105 | bmcr |= BMCR_RESET; | 107 | bmcr |= BMCR_RESET; |
106 | err = phy_write(phydev, MII_BMCR, bmcr); | 108 | bmcr = phy_write(phydev, MII_BMCR, bmcr); |
107 | if (err < 0) | 109 | if (bmcr < 0) |
108 | return err; | 110 | return bmcr; |
109 | 111 | ||
110 | do { | 112 | do { |
111 | bmcr = phy_read(phydev, MII_BMCR); | 113 | bmcr = phy_read(phydev, MII_BMCR); |
114 | if (bmcr < 0) | ||
115 | return bmcr; | ||
112 | } while (bmcr & BMCR_RESET); | 116 | } while (bmcr & BMCR_RESET); |
113 | 117 | ||
114 | return err; | 118 | return 0; |
115 | } | 119 | } |
116 | 120 | ||
117 | static int ip1001_config_init(struct phy_device *phydev) | 121 | static int ip1001_config_init(struct phy_device *phydev) |
@@ -124,7 +128,10 @@ static int ip1001_config_init(struct phy_device *phydev) | |||
124 | 128 | ||
125 | /* Enable Auto Power Saving mode */ | 129 | /* Enable Auto Power Saving mode */ |
126 | c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2); | 130 | c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2); |
131 | if (c < 0) | ||
132 | return c; | ||
127 | c |= IP1001_APS_ON; | 133 | c |= IP1001_APS_ON; |
134 | c = phy_write(phydev, IP1001_SPEC_CTRL_STATUS_2, c); | ||
128 | if (c < 0) | 135 | if (c < 0) |
129 | return c; | 136 | return c; |
130 | 137 | ||
@@ -132,14 +139,19 @@ static int ip1001_config_init(struct phy_device *phydev) | |||
132 | /* Additional delay (2ns) used to adjust RX clock phase | 139 | /* Additional delay (2ns) used to adjust RX clock phase |
133 | * at RGMII interface */ | 140 | * at RGMII interface */ |
134 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); | 141 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); |
142 | if (c < 0) | ||
143 | return c; | ||
144 | |||
135 | c |= IP1001_PHASE_SEL_MASK; | 145 | c |= IP1001_PHASE_SEL_MASK; |
136 | c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); | 146 | c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); |
147 | if (c < 0) | ||
148 | return c; | ||
137 | } | 149 | } |
138 | 150 | ||
139 | return c; | 151 | return 0; |
140 | } | 152 | } |
141 | 153 | ||
142 | static int ip101a_config_init(struct phy_device *phydev) | 154 | static int ip101a_g_config_init(struct phy_device *phydev) |
143 | { | 155 | { |
144 | int c; | 156 | int c; |
145 | 157 | ||
@@ -149,7 +161,7 @@ static int ip101a_config_init(struct phy_device *phydev) | |||
149 | 161 | ||
150 | /* Enable Auto Power Saving mode */ | 162 | /* Enable Auto Power Saving mode */ |
151 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); | 163 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); |
152 | c |= IP101A_APS_ON; | 164 | c |= IP101A_G_APS_ON; |
153 | return c; | 165 | return c; |
154 | } | 166 | } |
155 | 167 | ||
@@ -191,6 +203,7 @@ static struct phy_driver ip1001_driver = { | |||
191 | .phy_id_mask = 0x0ffffff0, | 203 | .phy_id_mask = 0x0ffffff0, |
192 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | | 204 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | |
193 | SUPPORTED_Asym_Pause, | 205 | SUPPORTED_Asym_Pause, |
206 | .flags = PHY_HAS_INTERRUPT, | ||
194 | .config_init = &ip1001_config_init, | 207 | .config_init = &ip1001_config_init, |
195 | .config_aneg = &genphy_config_aneg, | 208 | .config_aneg = &genphy_config_aneg, |
196 | .read_status = &genphy_read_status, | 209 | .read_status = &genphy_read_status, |
@@ -199,13 +212,14 @@ static struct phy_driver ip1001_driver = { | |||
199 | .driver = { .owner = THIS_MODULE,}, | 212 | .driver = { .owner = THIS_MODULE,}, |
200 | }; | 213 | }; |
201 | 214 | ||
202 | static struct phy_driver ip101a_driver = { | 215 | static struct phy_driver ip101a_g_driver = { |
203 | .phy_id = 0x02430c54, | 216 | .phy_id = 0x02430c54, |
204 | .name = "ICPlus IP101A", | 217 | .name = "ICPlus IP101A/G", |
205 | .phy_id_mask = 0x0ffffff0, | 218 | .phy_id_mask = 0x0ffffff0, |
206 | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | | 219 | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | |
207 | SUPPORTED_Asym_Pause, | 220 | SUPPORTED_Asym_Pause, |
208 | .config_init = &ip101a_config_init, | 221 | .flags = PHY_HAS_INTERRUPT, |
222 | .config_init = &ip101a_g_config_init, | ||
209 | .config_aneg = &genphy_config_aneg, | 223 | .config_aneg = &genphy_config_aneg, |
210 | .read_status = &genphy_read_status, | 224 | .read_status = &genphy_read_status, |
211 | .suspend = genphy_suspend, | 225 | .suspend = genphy_suspend, |
@@ -221,7 +235,7 @@ static int __init icplus_init(void) | |||
221 | if (ret < 0) | 235 | if (ret < 0) |
222 | return -ENODEV; | 236 | return -ENODEV; |
223 | 237 | ||
224 | ret = phy_driver_register(&ip101a_driver); | 238 | ret = phy_driver_register(&ip101a_g_driver); |
225 | if (ret < 0) | 239 | if (ret < 0) |
226 | return -ENODEV; | 240 | return -ENODEV; |
227 | 241 | ||
@@ -231,7 +245,7 @@ static int __init icplus_init(void) | |||
231 | static void __exit icplus_exit(void) | 245 | static void __exit icplus_exit(void) |
232 | { | 246 | { |
233 | phy_driver_unregister(&ip1001_driver); | 247 | phy_driver_unregister(&ip1001_driver); |
234 | phy_driver_unregister(&ip101a_driver); | 248 | phy_driver_unregister(&ip101a_g_driver); |
235 | phy_driver_unregister(&ip175c_driver); | 249 | phy_driver_unregister(&ip175c_driver); |
236 | } | 250 | } |
237 | 251 | ||
@@ -241,6 +255,7 @@ module_exit(icplus_exit); | |||
241 | static struct mdio_device_id __maybe_unused icplus_tbl[] = { | 255 | static struct mdio_device_id __maybe_unused icplus_tbl[] = { |
242 | { 0x02430d80, 0x0ffffff0 }, | 256 | { 0x02430d80, 0x0ffffff0 }, |
243 | { 0x02430d90, 0x0ffffff0 }, | 257 | { 0x02430d90, 0x0ffffff0 }, |
258 | { 0x02430c54, 0x0ffffff0 }, | ||
244 | { } | 259 | { } |
245 | }; | 260 | }; |
246 | 261 | ||
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index edfa15d2e795..486b4048850d 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c | |||
@@ -2024,14 +2024,22 @@ ppp_mp_reconstruct(struct ppp *ppp) | |||
2024 | continue; | 2024 | continue; |
2025 | } | 2025 | } |
2026 | if (PPP_MP_CB(p)->sequence != seq) { | 2026 | if (PPP_MP_CB(p)->sequence != seq) { |
2027 | u32 oldseq; | ||
2027 | /* Fragment `seq' is missing. If it is after | 2028 | /* Fragment `seq' is missing. If it is after |
2028 | minseq, it might arrive later, so stop here. */ | 2029 | minseq, it might arrive later, so stop here. */ |
2029 | if (seq_after(seq, minseq)) | 2030 | if (seq_after(seq, minseq)) |
2030 | break; | 2031 | break; |
2031 | /* Fragment `seq' is lost, keep going. */ | 2032 | /* Fragment `seq' is lost, keep going. */ |
2032 | lost = 1; | 2033 | lost = 1; |
2034 | oldseq = seq; | ||
2033 | seq = seq_before(minseq, PPP_MP_CB(p)->sequence)? | 2035 | seq = seq_before(minseq, PPP_MP_CB(p)->sequence)? |
2034 | minseq + 1: PPP_MP_CB(p)->sequence; | 2036 | minseq + 1: PPP_MP_CB(p)->sequence; |
2037 | |||
2038 | if (ppp->debug & 1) | ||
2039 | netdev_printk(KERN_DEBUG, ppp->dev, | ||
2040 | "lost frag %u..%u\n", | ||
2041 | oldseq, seq-1); | ||
2042 | |||
2035 | goto again; | 2043 | goto again; |
2036 | } | 2044 | } |
2037 | 2045 | ||
@@ -2076,6 +2084,10 @@ ppp_mp_reconstruct(struct ppp *ppp) | |||
2076 | struct sk_buff *tmp2; | 2084 | struct sk_buff *tmp2; |
2077 | 2085 | ||
2078 | skb_queue_reverse_walk_from_safe(list, p, tmp2) { | 2086 | skb_queue_reverse_walk_from_safe(list, p, tmp2) { |
2087 | if (ppp->debug & 1) | ||
2088 | netdev_printk(KERN_DEBUG, ppp->dev, | ||
2089 | "discarding frag %u\n", | ||
2090 | PPP_MP_CB(p)->sequence); | ||
2079 | __skb_unlink(p, list); | 2091 | __skb_unlink(p, list); |
2080 | kfree_skb(p); | 2092 | kfree_skb(p); |
2081 | } | 2093 | } |
@@ -2091,6 +2103,17 @@ ppp_mp_reconstruct(struct ppp *ppp) | |||
2091 | /* If we have discarded any fragments, | 2103 | /* If we have discarded any fragments, |
2092 | signal a receive error. */ | 2104 | signal a receive error. */ |
2093 | if (PPP_MP_CB(head)->sequence != ppp->nextseq) { | 2105 | if (PPP_MP_CB(head)->sequence != ppp->nextseq) { |
2106 | skb_queue_walk_safe(list, p, tmp) { | ||
2107 | if (p == head) | ||
2108 | break; | ||
2109 | if (ppp->debug & 1) | ||
2110 | netdev_printk(KERN_DEBUG, ppp->dev, | ||
2111 | "discarding frag %u\n", | ||
2112 | PPP_MP_CB(p)->sequence); | ||
2113 | __skb_unlink(p, list); | ||
2114 | kfree_skb(p); | ||
2115 | } | ||
2116 | |||
2094 | if (ppp->debug & 1) | 2117 | if (ppp->debug & 1) |
2095 | netdev_printk(KERN_DEBUG, ppp->dev, | 2118 | netdev_printk(KERN_DEBUG, ppp->dev, |
2096 | " missed pkts %u..%u\n", | 2119 | " missed pkts %u..%u\n", |
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig index c7e0149d1514..45550d42b368 100644 --- a/drivers/net/tokenring/Kconfig +++ b/drivers/net/tokenring/Kconfig | |||
@@ -7,7 +7,6 @@ menuconfig TR | |||
7 | bool "Token Ring driver support" | 7 | bool "Token Ring driver support" |
8 | depends on NETDEVICES && !UML | 8 | depends on NETDEVICES && !UML |
9 | depends on (PCI || ISA || MCA || CCW || PCMCIA) | 9 | depends on (PCI || ISA || MCA || CCW || PCMCIA) |
10 | select LLC | ||
11 | help | 10 | help |
12 | Token Ring is IBM's way of communication on a local network; the | 11 | Token Ring is IBM's way of communication on a local network; the |
13 | rest of the world uses Ethernet. To participate on a Token Ring | 12 | rest of the world uses Ethernet. To participate on a Token Ring |
@@ -20,6 +19,10 @@ menuconfig TR | |||
20 | 19 | ||
21 | if TR | 20 | if TR |
22 | 21 | ||
22 | config WANT_LLC | ||
23 | def_bool y | ||
24 | select LLC | ||
25 | |||
23 | config PCMCIA_IBMTR | 26 | config PCMCIA_IBMTR |
24 | tristate "IBM PCMCIA tokenring adapter support" | 27 | tristate "IBM PCMCIA tokenring adapter support" |
25 | depends on IBMTR!=y && PCMCIA | 28 | depends on IBMTR!=y && PCMCIA |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 41a61efc331e..90a30026a931 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -573,6 +573,13 @@ static const struct usb_device_id products [] = { | |||
573 | .driver_info = 0, | 573 | .driver_info = 0, |
574 | }, | 574 | }, |
575 | 575 | ||
576 | /* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */ | ||
577 | { | ||
578 | USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM, | ||
579 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
580 | .driver_info = 0, | ||
581 | }, | ||
582 | |||
576 | /* | 583 | /* |
577 | * WHITELIST!!! | 584 | * WHITELIST!!! |
578 | * | 585 | * |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 304fe78ff60e..e1324b4a0f66 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -1632,7 +1632,7 @@ static int hso_get_count(struct tty_struct *tty, | |||
1632 | struct hso_serial *serial = get_serial_by_tty(tty); | 1632 | struct hso_serial *serial = get_serial_by_tty(tty); |
1633 | struct hso_tiocmget *tiocmget = serial->tiocmget; | 1633 | struct hso_tiocmget *tiocmget = serial->tiocmget; |
1634 | 1634 | ||
1635 | memset(&icount, 0, sizeof(struct serial_icounter_struct)); | 1635 | memset(icount, 0, sizeof(struct serial_icounter_struct)); |
1636 | 1636 | ||
1637 | if (!tiocmget) | 1637 | if (!tiocmget) |
1638 | return -ENOENT; | 1638 | return -ENOENT; |
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index e84662db51cc..dd78c4cbd459 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c | |||
@@ -60,6 +60,7 @@ | |||
60 | #define USB_PRODUCT_IPHONE_3GS 0x1294 | 60 | #define USB_PRODUCT_IPHONE_3GS 0x1294 |
61 | #define USB_PRODUCT_IPHONE_4 0x1297 | 61 | #define USB_PRODUCT_IPHONE_4 0x1297 |
62 | #define USB_PRODUCT_IPHONE_4_VZW 0x129c | 62 | #define USB_PRODUCT_IPHONE_4_VZW 0x129c |
63 | #define USB_PRODUCT_IPHONE_4S 0x12a0 | ||
63 | 64 | ||
64 | #define IPHETH_USBINTF_CLASS 255 | 65 | #define IPHETH_USBINTF_CLASS 255 |
65 | #define IPHETH_USBINTF_SUBCLASS 253 | 66 | #define IPHETH_USBINTF_SUBCLASS 253 |
@@ -103,6 +104,10 @@ static struct usb_device_id ipheth_table[] = { | |||
103 | USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW, | 104 | USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW, |
104 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, | 105 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, |
105 | IPHETH_USBINTF_PROTO) }, | 106 | IPHETH_USBINTF_PROTO) }, |
107 | { USB_DEVICE_AND_INTERFACE_INFO( | ||
108 | USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S, | ||
109 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, | ||
110 | IPHETH_USBINTF_PROTO) }, | ||
106 | { } | 111 | { } |
107 | }; | 112 | }; |
108 | MODULE_DEVICE_TABLE(usb, ipheth_table); | 113 | MODULE_DEVICE_TABLE(usb, ipheth_table); |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index fae0fbd8bc88..81b96e303757 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -589,6 +589,7 @@ static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) | |||
589 | entry = (struct skb_data *) skb->cb; | 589 | entry = (struct skb_data *) skb->cb; |
590 | urb = entry->urb; | 590 | urb = entry->urb; |
591 | 591 | ||
592 | spin_unlock_irqrestore(&q->lock, flags); | ||
592 | // during some PM-driven resume scenarios, | 593 | // during some PM-driven resume scenarios, |
593 | // these (async) unlinks complete immediately | 594 | // these (async) unlinks complete immediately |
594 | retval = usb_unlink_urb (urb); | 595 | retval = usb_unlink_urb (urb); |
@@ -596,6 +597,7 @@ static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) | |||
596 | netdev_dbg(dev->net, "unlink urb err, %d\n", retval); | 597 | netdev_dbg(dev->net, "unlink urb err, %d\n", retval); |
597 | else | 598 | else |
598 | count++; | 599 | count++; |
600 | spin_lock_irqsave(&q->lock, flags); | ||
599 | } | 601 | } |
600 | spin_unlock_irqrestore (&q->lock, flags); | 602 | spin_unlock_irqrestore (&q->lock, flags); |
601 | return count; | 603 | return count; |
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c index f701d4127087..c3197ce0e2ad 100644 --- a/drivers/net/usb/zaurus.c +++ b/drivers/net/usb/zaurus.c | |||
@@ -316,6 +316,11 @@ static const struct usb_device_id products [] = { | |||
316 | ZAURUS_MASTER_INTERFACE, | 316 | ZAURUS_MASTER_INTERFACE, |
317 | .driver_info = ZAURUS_PXA_INFO, | 317 | .driver_info = ZAURUS_PXA_INFO, |
318 | }, { | 318 | }, { |
319 | /* C-750/C-760/C-860/SL-C3000 PDA in MDLM mode */ | ||
320 | USB_DEVICE_AND_INTERFACE_INFO(0x04DD, 0x9031, USB_CLASS_COMM, | ||
321 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
322 | .driver_info = (unsigned long) &bogus_mdlm_info, | ||
323 | }, { | ||
319 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | 324 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO |
320 | | USB_DEVICE_ID_MATCH_DEVICE, | 325 | | USB_DEVICE_ID_MATCH_DEVICE, |
321 | .idVendor = 0x04DD, | 326 | .idVendor = 0x04DD, |
@@ -349,6 +354,13 @@ static const struct usb_device_id products [] = { | |||
349 | ZAURUS_MASTER_INTERFACE, | 354 | ZAURUS_MASTER_INTERFACE, |
350 | .driver_info = OLYMPUS_MXL_INFO, | 355 | .driver_info = OLYMPUS_MXL_INFO, |
351 | }, | 356 | }, |
357 | |||
358 | /* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */ | ||
359 | { | ||
360 | USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM, | ||
361 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
362 | .driver_info = (unsigned long) &bogus_mdlm_info, | ||
363 | }, | ||
352 | { }, // END | 364 | { }, // END |
353 | }; | 365 | }; |
354 | MODULE_DEVICE_TABLE(usb, products); | 366 | MODULE_DEVICE_TABLE(usb, products); |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 49f4667e1fa3..4a3402898f2a 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -422,7 +422,9 @@ static void veth_dellink(struct net_device *dev, struct list_head *head) | |||
422 | unregister_netdevice_queue(peer, head); | 422 | unregister_netdevice_queue(peer, head); |
423 | } | 423 | } |
424 | 424 | ||
425 | static const struct nla_policy veth_policy[VETH_INFO_MAX + 1]; | 425 | static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = { |
426 | [VETH_INFO_PEER] = { .len = sizeof(struct ifinfomsg) }, | ||
427 | }; | ||
426 | 428 | ||
427 | static struct rtnl_link_ops veth_link_ops = { | 429 | static struct rtnl_link_ops veth_link_ops = { |
428 | .kind = DRV_NAME, | 430 | .kind = DRV_NAME, |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index de7fc345148a..756c0f5565a5 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -830,21 +830,16 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, | |||
830 | ctx->l4_hdr_size = ((struct tcphdr *) | 830 | ctx->l4_hdr_size = ((struct tcphdr *) |
831 | skb_transport_header(skb))->doff * 4; | 831 | skb_transport_header(skb))->doff * 4; |
832 | else if (iph->protocol == IPPROTO_UDP) | 832 | else if (iph->protocol == IPPROTO_UDP) |
833 | /* | ||
834 | * Use tcp header size so that bytes to | ||
835 | * be copied are more than required by | ||
836 | * the device. | ||
837 | */ | ||
838 | ctx->l4_hdr_size = | 833 | ctx->l4_hdr_size = |
839 | sizeof(struct tcphdr); | 834 | sizeof(struct udphdr); |
840 | else | 835 | else |
841 | ctx->l4_hdr_size = 0; | 836 | ctx->l4_hdr_size = 0; |
842 | } else { | 837 | } else { |
843 | /* for simplicity, don't copy L4 headers */ | 838 | /* for simplicity, don't copy L4 headers */ |
844 | ctx->l4_hdr_size = 0; | 839 | ctx->l4_hdr_size = 0; |
845 | } | 840 | } |
846 | ctx->copy_size = ctx->eth_ip_hdr_size + | 841 | ctx->copy_size = min(ctx->eth_ip_hdr_size + |
847 | ctx->l4_hdr_size; | 842 | ctx->l4_hdr_size, skb->len); |
848 | } else { | 843 | } else { |
849 | ctx->eth_ip_hdr_size = 0; | 844 | ctx->eth_ip_hdr_size = 0; |
850 | ctx->l4_hdr_size = 0; | 845 | ctx->l4_hdr_size = 0; |
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h index ed54797db191..fc46a81ad538 100644 --- a/drivers/net/vmxnet3/vmxnet3_int.h +++ b/drivers/net/vmxnet3/vmxnet3_int.h | |||
@@ -70,10 +70,10 @@ | |||
70 | /* | 70 | /* |
71 | * Version numbers | 71 | * Version numbers |
72 | */ | 72 | */ |
73 | #define VMXNET3_DRIVER_VERSION_STRING "1.1.18.0-k" | 73 | #define VMXNET3_DRIVER_VERSION_STRING "1.1.29.0-k" |
74 | 74 | ||
75 | /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ | 75 | /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ |
76 | #define VMXNET3_DRIVER_VERSION_NUM 0x01011200 | 76 | #define VMXNET3_DRIVER_VERSION_NUM 0x01011D00 |
77 | 77 | ||
78 | #if defined(CONFIG_PCI_MSI) | 78 | #if defined(CONFIG_PCI_MSI) |
79 | /* RSS only makes sense if MSI-X is supported. */ | 79 | /* RSS only makes sense if MSI-X is supported. */ |
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c index f901a17f76ba..86a891f93fc9 100644 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c | |||
@@ -489,8 +489,6 @@ static int ar5008_hw_rf_alloc_ext_banks(struct ath_hw *ah) | |||
489 | ATH_ALLOC_BANK(ah->analogBank6Data, ah->iniBank6.ia_rows); | 489 | ATH_ALLOC_BANK(ah->analogBank6Data, ah->iniBank6.ia_rows); |
490 | ATH_ALLOC_BANK(ah->analogBank6TPCData, ah->iniBank6TPC.ia_rows); | 490 | ATH_ALLOC_BANK(ah->analogBank6TPCData, ah->iniBank6TPC.ia_rows); |
491 | ATH_ALLOC_BANK(ah->analogBank7Data, ah->iniBank7.ia_rows); | 491 | ATH_ALLOC_BANK(ah->analogBank7Data, ah->iniBank7.ia_rows); |
492 | ATH_ALLOC_BANK(ah->addac5416_21, | ||
493 | ah->iniAddac.ia_rows * ah->iniAddac.ia_columns); | ||
494 | ATH_ALLOC_BANK(ah->bank6Temp, ah->iniBank6.ia_rows); | 492 | ATH_ALLOC_BANK(ah->bank6Temp, ah->iniBank6.ia_rows); |
495 | 493 | ||
496 | return 0; | 494 | return 0; |
@@ -519,7 +517,6 @@ static void ar5008_hw_rf_free_ext_banks(struct ath_hw *ah) | |||
519 | ATH_FREE_BANK(ah->analogBank6Data); | 517 | ATH_FREE_BANK(ah->analogBank6Data); |
520 | ATH_FREE_BANK(ah->analogBank6TPCData); | 518 | ATH_FREE_BANK(ah->analogBank6TPCData); |
521 | ATH_FREE_BANK(ah->analogBank7Data); | 519 | ATH_FREE_BANK(ah->analogBank7Data); |
522 | ATH_FREE_BANK(ah->addac5416_21); | ||
523 | ATH_FREE_BANK(ah->bank6Temp); | 520 | ATH_FREE_BANK(ah->bank6Temp); |
524 | 521 | ||
525 | #undef ATH_FREE_BANK | 522 | #undef ATH_FREE_BANK |
@@ -805,27 +802,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah, | |||
805 | if (ah->eep_ops->set_addac) | 802 | if (ah->eep_ops->set_addac) |
806 | ah->eep_ops->set_addac(ah, chan); | 803 | ah->eep_ops->set_addac(ah, chan); |
807 | 804 | ||
808 | if (AR_SREV_5416_22_OR_LATER(ah)) { | 805 | REG_WRITE_ARRAY(&ah->iniAddac, 1, regWrites); |
809 | REG_WRITE_ARRAY(&ah->iniAddac, 1, regWrites); | ||
810 | } else { | ||
811 | struct ar5416IniArray temp; | ||
812 | u32 addacSize = | ||
813 | sizeof(u32) * ah->iniAddac.ia_rows * | ||
814 | ah->iniAddac.ia_columns; | ||
815 | |||
816 | /* For AR5416 2.0/2.1 */ | ||
817 | memcpy(ah->addac5416_21, | ||
818 | ah->iniAddac.ia_array, addacSize); | ||
819 | |||
820 | /* override CLKDRV value at [row, column] = [31, 1] */ | ||
821 | (ah->addac5416_21)[31 * ah->iniAddac.ia_columns + 1] = 0; | ||
822 | |||
823 | temp.ia_array = ah->addac5416_21; | ||
824 | temp.ia_columns = ah->iniAddac.ia_columns; | ||
825 | temp.ia_rows = ah->iniAddac.ia_rows; | ||
826 | REG_WRITE_ARRAY(&temp, 1, regWrites); | ||
827 | } | ||
828 | |||
829 | REG_WRITE(ah, AR_PHY_ADC_SERIAL_CTL, AR_PHY_SEL_INTERNAL_ADDAC); | 806 | REG_WRITE(ah, AR_PHY_ADC_SERIAL_CTL, AR_PHY_SEL_INTERNAL_ADDAC); |
830 | 807 | ||
831 | ENABLE_REGWRITE_BUFFER(ah); | 808 | ENABLE_REGWRITE_BUFFER(ah); |
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c index 11f192a1ceb7..d190411ac8f5 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c | |||
@@ -180,6 +180,25 @@ static void ar9002_hw_init_mode_regs(struct ath_hw *ah) | |||
180 | INIT_INI_ARRAY(&ah->iniAddac, ar5416Addac, | 180 | INIT_INI_ARRAY(&ah->iniAddac, ar5416Addac, |
181 | ARRAY_SIZE(ar5416Addac), 2); | 181 | ARRAY_SIZE(ar5416Addac), 2); |
182 | } | 182 | } |
183 | |||
184 | /* iniAddac needs to be modified for these chips */ | ||
185 | if (AR_SREV_9160(ah) || !AR_SREV_5416_22_OR_LATER(ah)) { | ||
186 | struct ar5416IniArray *addac = &ah->iniAddac; | ||
187 | u32 size = sizeof(u32) * addac->ia_rows * addac->ia_columns; | ||
188 | u32 *data; | ||
189 | |||
190 | data = kmalloc(size, GFP_KERNEL); | ||
191 | if (!data) | ||
192 | return; | ||
193 | |||
194 | memcpy(data, addac->ia_array, size); | ||
195 | addac->ia_array = data; | ||
196 | |||
197 | if (!AR_SREV_5416_22_OR_LATER(ah)) { | ||
198 | /* override CLKDRV value */ | ||
199 | INI_RA(addac, 31,1) = 0; | ||
200 | } | ||
201 | } | ||
183 | } | 202 | } |
184 | 203 | ||
185 | /* Support for Japan ch.14 (2484) spread */ | 204 | /* Support for Japan ch.14 (2484) spread */ |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index ee7759575050..87db1ee1c298 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1037,13 +1037,16 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah) | |||
1037 | 1037 | ||
1038 | /* | 1038 | /* |
1039 | * Workaround for early ACK timeouts, add an offset to match the | 1039 | * Workaround for early ACK timeouts, add an offset to match the |
1040 | * initval's 64us ack timeout value. | 1040 | * initval's 64us ack timeout value. Use 48us for the CTS timeout. |
1041 | * This was initially only meant to work around an issue with delayed | 1041 | * This was initially only meant to work around an issue with delayed |
1042 | * BA frames in some implementations, but it has been found to fix ACK | 1042 | * BA frames in some implementations, but it has been found to fix ACK |
1043 | * timeout issues in other cases as well. | 1043 | * timeout issues in other cases as well. |
1044 | */ | 1044 | */ |
1045 | if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) | 1045 | if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) { |
1046 | acktimeout += 64 - sifstime - ah->slottime; | 1046 | acktimeout += 64 - sifstime - ah->slottime; |
1047 | ctstimeout += 48 - sifstime - ah->slottime; | ||
1048 | } | ||
1049 | |||
1047 | 1050 | ||
1048 | ath9k_hw_set_sifs_time(ah, sifstime); | 1051 | ath9k_hw_set_sifs_time(ah, sifstime); |
1049 | ath9k_hw_setslottime(ah, slottime); | 1052 | ath9k_hw_setslottime(ah, slottime); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 6a29004a71b0..c8261d4fc780 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -940,7 +940,6 @@ struct ath_hw { | |||
940 | u32 *analogBank6Data; | 940 | u32 *analogBank6Data; |
941 | u32 *analogBank6TPCData; | 941 | u32 *analogBank6TPCData; |
942 | u32 *analogBank7Data; | 942 | u32 *analogBank7Data; |
943 | u32 *addac5416_21; | ||
944 | u32 *bank6Temp; | 943 | u32 *bank6Temp; |
945 | 944 | ||
946 | u8 txpower_limit; | 945 | u8 txpower_limit; |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index abf943557dee..53a005d288aa 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -822,6 +822,11 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, | |||
822 | ARRAY_SIZE(ath9k_tpt_blink)); | 822 | ARRAY_SIZE(ath9k_tpt_blink)); |
823 | #endif | 823 | #endif |
824 | 824 | ||
825 | INIT_WORK(&sc->hw_reset_work, ath_reset_work); | ||
826 | INIT_WORK(&sc->hw_check_work, ath_hw_check); | ||
827 | INIT_WORK(&sc->paprd_work, ath_paprd_calibrate); | ||
828 | INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work); | ||
829 | |||
825 | /* Register with mac80211 */ | 830 | /* Register with mac80211 */ |
826 | error = ieee80211_register_hw(hw); | 831 | error = ieee80211_register_hw(hw); |
827 | if (error) | 832 | if (error) |
@@ -840,10 +845,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, | |||
840 | goto error_world; | 845 | goto error_world; |
841 | } | 846 | } |
842 | 847 | ||
843 | INIT_WORK(&sc->hw_reset_work, ath_reset_work); | ||
844 | INIT_WORK(&sc->hw_check_work, ath_hw_check); | ||
845 | INIT_WORK(&sc->paprd_work, ath_paprd_calibrate); | ||
846 | INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work); | ||
847 | sc->last_rssi = ATH_RSSI_DUMMY_MARKER; | 848 | sc->last_rssi = ATH_RSSI_DUMMY_MARKER; |
848 | 849 | ||
849 | ath_init_leds(sc); | 850 | ath_init_leds(sc); |
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index b3c3798fe513..a427a16bb739 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -694,7 +694,7 @@ static u8 ath_rc_get_highest_rix(struct ath_softc *sc, | |||
694 | return rate; | 694 | return rate; |
695 | 695 | ||
696 | /* This should not happen */ | 696 | /* This should not happen */ |
697 | WARN_ON(1); | 697 | WARN_ON_ONCE(1); |
698 | 698 | ||
699 | rate = ath_rc_priv->valid_rate_index[0]; | 699 | rate = ath_rc_priv->valid_rate_index[0]; |
700 | 700 | ||
@@ -1346,7 +1346,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband, | |||
1346 | fc = hdr->frame_control; | 1346 | fc = hdr->frame_control; |
1347 | for (i = 0; i < sc->hw->max_rates; i++) { | 1347 | for (i = 0; i < sc->hw->max_rates; i++) { |
1348 | struct ieee80211_tx_rate *rate = &tx_info->status.rates[i]; | 1348 | struct ieee80211_tx_rate *rate = &tx_info->status.rates[i]; |
1349 | if (!rate->count) | 1349 | if (rate->idx < 0 || !rate->count) |
1350 | break; | 1350 | break; |
1351 | 1351 | ||
1352 | final_ts_idx = i; | 1352 | final_ts_idx = i; |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 0e666fbe0842..7e1a91af1497 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -822,6 +822,14 @@ static bool ath9k_rx_accept(struct ath_common *common, | |||
822 | (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC | | 822 | (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC | |
823 | ATH9K_RXERR_KEYMISS)); | 823 | ATH9K_RXERR_KEYMISS)); |
824 | 824 | ||
825 | /* | ||
826 | * Key miss events are only relevant for pairwise keys where the | ||
827 | * descriptor does contain a valid key index. This has been observed | ||
828 | * mostly with CCMP encryption. | ||
829 | */ | ||
830 | if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID) | ||
831 | rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS; | ||
832 | |||
825 | if (!rx_stats->rs_datalen) | 833 | if (!rx_stats->rs_datalen) |
826 | return false; | 834 | return false; |
827 | /* | 835 | /* |
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index d19a9ee9d057..bbc813dee983 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c | |||
@@ -1234,6 +1234,7 @@ static bool carl9170_tx_ps_drop(struct ar9170 *ar, struct sk_buff *skb) | |||
1234 | { | 1234 | { |
1235 | struct ieee80211_sta *sta; | 1235 | struct ieee80211_sta *sta; |
1236 | struct carl9170_sta_info *sta_info; | 1236 | struct carl9170_sta_info *sta_info; |
1237 | struct ieee80211_tx_info *tx_info; | ||
1237 | 1238 | ||
1238 | rcu_read_lock(); | 1239 | rcu_read_lock(); |
1239 | sta = __carl9170_get_tx_sta(ar, skb); | 1240 | sta = __carl9170_get_tx_sta(ar, skb); |
@@ -1241,16 +1242,18 @@ static bool carl9170_tx_ps_drop(struct ar9170 *ar, struct sk_buff *skb) | |||
1241 | goto out_rcu; | 1242 | goto out_rcu; |
1242 | 1243 | ||
1243 | sta_info = (void *) sta->drv_priv; | 1244 | sta_info = (void *) sta->drv_priv; |
1244 | if (unlikely(sta_info->sleeping)) { | 1245 | tx_info = IEEE80211_SKB_CB(skb); |
1245 | struct ieee80211_tx_info *tx_info; | ||
1246 | 1246 | ||
1247 | if (unlikely(sta_info->sleeping) && | ||
1248 | !(tx_info->flags & (IEEE80211_TX_CTL_POLL_RESPONSE | | ||
1249 | IEEE80211_TX_CTL_CLEAR_PS_FILT))) { | ||
1247 | rcu_read_unlock(); | 1250 | rcu_read_unlock(); |
1248 | 1251 | ||
1249 | tx_info = IEEE80211_SKB_CB(skb); | ||
1250 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) | 1252 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) |
1251 | atomic_dec(&ar->tx_ampdu_upload); | 1253 | atomic_dec(&ar->tx_ampdu_upload); |
1252 | 1254 | ||
1253 | tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; | 1255 | tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
1256 | carl9170_release_dev_space(ar, skb); | ||
1254 | carl9170_tx_status(ar, skb, false); | 1257 | carl9170_tx_status(ar, skb, false); |
1255 | return true; | 1258 | return true; |
1256 | } | 1259 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c index 90911eec0cf5..30b58870b1b6 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c | |||
@@ -1051,17 +1051,13 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb, | |||
1051 | } | 1051 | } |
1052 | /* either retransmit or send bar if ack not recd */ | 1052 | /* either retransmit or send bar if ack not recd */ |
1053 | if (!ack_recd) { | 1053 | if (!ack_recd) { |
1054 | struct ieee80211_tx_rate *txrate = | 1054 | if (retry && (ini->txretry[index] < (int)retry_limit)) { |
1055 | tx_info->status.rates; | ||
1056 | if (retry && (txrate[0].count < (int)retry_limit)) { | ||
1057 | ini->txretry[index]++; | 1055 | ini->txretry[index]++; |
1058 | ini->tx_in_transit--; | 1056 | ini->tx_in_transit--; |
1059 | /* | 1057 | /* |
1060 | * Use high prededence for retransmit to | 1058 | * Use high prededence for retransmit to |
1061 | * give some punch | 1059 | * give some punch |
1062 | */ | 1060 | */ |
1063 | /* brcms_c_txq_enq(wlc, scb, p, | ||
1064 | * BRCMS_PRIO_TO_PREC(tid)); */ | ||
1065 | brcms_c_txq_enq(wlc, scb, p, | 1061 | brcms_c_txq_enq(wlc, scb, p, |
1066 | BRCMS_PRIO_TO_HI_PREC(tid)); | 1062 | BRCMS_PRIO_TO_HI_PREC(tid)); |
1067 | } else { | 1063 | } else { |
@@ -1074,9 +1070,9 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb, | |||
1074 | IEEE80211_TX_STAT_AMPDU_NO_BACK; | 1070 | IEEE80211_TX_STAT_AMPDU_NO_BACK; |
1075 | skb_pull(p, D11_PHY_HDR_LEN); | 1071 | skb_pull(p, D11_PHY_HDR_LEN); |
1076 | skb_pull(p, D11_TXH_LEN); | 1072 | skb_pull(p, D11_TXH_LEN); |
1077 | wiphy_err(wiphy, "%s: BA Timeout, seq %d, in_" | 1073 | BCMMSG(wiphy, |
1078 | "transit %d\n", "AMPDU status", seq, | 1074 | "BA Timeout, seq %d, in_transit %d\n", |
1079 | ini->tx_in_transit); | 1075 | seq, ini->tx_in_transit); |
1080 | ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, | 1076 | ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, |
1081 | p); | 1077 | p); |
1082 | } | 1078 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 64cf439035c3..ca78e91de86c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -1240,7 +1240,7 @@ int iwlagn_suspend(struct iwl_priv *priv, | |||
1240 | .flags = CMD_SYNC, | 1240 | .flags = CMD_SYNC, |
1241 | .data[0] = key_data.rsc_tsc, | 1241 | .data[0] = key_data.rsc_tsc, |
1242 | .dataflags[0] = IWL_HCMD_DFL_NOCOPY, | 1242 | .dataflags[0] = IWL_HCMD_DFL_NOCOPY, |
1243 | .len[0] = sizeof(key_data.rsc_tsc), | 1243 | .len[0] = sizeof(*key_data.rsc_tsc), |
1244 | }; | 1244 | }; |
1245 | 1245 | ||
1246 | ret = iwl_trans_send_cmd(trans(priv), &rsc_tsc_cmd); | 1246 | ret = iwl_trans_send_cmd(trans(priv), &rsc_tsc_cmd); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c index 7353826095f1..e483cfa8d14e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c | |||
@@ -1187,6 +1187,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, | |||
1187 | unsigned long flags; | 1187 | unsigned long flags; |
1188 | struct iwl_addsta_cmd sta_cmd; | 1188 | struct iwl_addsta_cmd sta_cmd; |
1189 | u8 sta_id = iwlagn_key_sta_id(priv, ctx->vif, sta); | 1189 | u8 sta_id = iwlagn_key_sta_id(priv, ctx->vif, sta); |
1190 | __le16 key_flags; | ||
1190 | 1191 | ||
1191 | /* if station isn't there, neither is the key */ | 1192 | /* if station isn't there, neither is the key */ |
1192 | if (sta_id == IWL_INVALID_STATION) | 1193 | if (sta_id == IWL_INVALID_STATION) |
@@ -1212,7 +1213,14 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, | |||
1212 | IWL_ERR(priv, "offset %d not used in uCode key table.\n", | 1213 | IWL_ERR(priv, "offset %d not used in uCode key table.\n", |
1213 | keyconf->hw_key_idx); | 1214 | keyconf->hw_key_idx); |
1214 | 1215 | ||
1215 | sta_cmd.key.key_flags = STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; | 1216 | key_flags = cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); |
1217 | key_flags |= STA_KEY_FLG_MAP_KEY_MSK | STA_KEY_FLG_NO_ENC | | ||
1218 | STA_KEY_FLG_INVALID; | ||
1219 | |||
1220 | if (!(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE)) | ||
1221 | key_flags |= STA_KEY_MULTICAST_MSK; | ||
1222 | |||
1223 | sta_cmd.key.key_flags = key_flags; | ||
1216 | sta_cmd.key.key_offset = WEP_INVALID_OFFSET; | 1224 | sta_cmd.key.key_offset = WEP_INVALID_OFFSET; |
1217 | sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK; | 1225 | sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK; |
1218 | sta_cmd.mode = STA_CONTROL_MODIFY_MSK; | 1226 | sta_cmd.mode = STA_CONTROL_MODIFY_MSK; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index c664c2726553..63bbc60be28e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -91,6 +91,7 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv, | |||
91 | tx_cmd->tid_tspec = qc[0] & 0xf; | 91 | tx_cmd->tid_tspec = qc[0] & 0xf; |
92 | tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK; | 92 | tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK; |
93 | } else { | 93 | } else { |
94 | tx_cmd->tid_tspec = IWL_TID_NON_QOS; | ||
94 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) | 95 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) |
95 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; | 96 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; |
96 | else | 97 | else |
@@ -620,7 +621,7 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif, | |||
620 | sta_priv->lq_sta.lq.agg_params.agg_frame_cnt_limit = | 621 | sta_priv->lq_sta.lq.agg_params.agg_frame_cnt_limit = |
621 | sta_priv->max_agg_bufsize; | 622 | sta_priv->max_agg_bufsize; |
622 | 623 | ||
623 | IWL_INFO(priv, "Tx aggregation enabled on ra = %pM tid = %d\n", | 624 | IWL_DEBUG_HT(priv, "Tx aggregation enabled on ra = %pM tid = %d\n", |
624 | sta->addr, tid); | 625 | sta->addr, tid); |
625 | 626 | ||
626 | return iwl_send_lq_cmd(priv, ctx, | 627 | return iwl_send_lq_cmd(priv, ctx, |
@@ -808,6 +809,8 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv, | |||
808 | u32 status = le16_to_cpu(tx_resp->status.status); | 809 | u32 status = le16_to_cpu(tx_resp->status.status); |
809 | int i; | 810 | int i; |
810 | 811 | ||
812 | WARN_ON(tid == IWL_TID_NON_QOS); | ||
813 | |||
811 | if (agg->wait_for_ba) | 814 | if (agg->wait_for_ba) |
812 | IWL_DEBUG_TX_REPLY(priv, | 815 | IWL_DEBUG_TX_REPLY(priv, |
813 | "got tx response w/o block-ack\n"); | 816 | "got tx response w/o block-ack\n"); |
@@ -1035,10 +1038,13 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb, | |||
1035 | } | 1038 | } |
1036 | 1039 | ||
1037 | __skb_queue_head_init(&skbs); | 1040 | __skb_queue_head_init(&skbs); |
1038 | priv->tid_data[sta_id][tid].next_reclaimed = next_reclaimed; | ||
1039 | 1041 | ||
1040 | IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d", | 1042 | if (tid != IWL_TID_NON_QOS) { |
1041 | next_reclaimed); | 1043 | priv->tid_data[sta_id][tid].next_reclaimed = |
1044 | next_reclaimed; | ||
1045 | IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d", | ||
1046 | next_reclaimed); | ||
1047 | } | ||
1042 | 1048 | ||
1043 | /*we can free until ssn % q.n_bd not inclusive */ | 1049 | /*we can free until ssn % q.n_bd not inclusive */ |
1044 | WARN_ON(iwl_trans_reclaim(trans(priv), sta_id, tid, txq_id, | 1050 | WARN_ON(iwl_trans_reclaim(trans(priv), sta_id, tid, txq_id, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 265de39d394c..f822ac447c3b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -815,6 +815,7 @@ struct iwl_qosparam_cmd { | |||
815 | 815 | ||
816 | #define IWL_INVALID_STATION 255 | 816 | #define IWL_INVALID_STATION 255 |
817 | #define IWL_MAX_TID_COUNT 8 | 817 | #define IWL_MAX_TID_COUNT 8 |
818 | #define IWL_TID_NON_QOS IWL_MAX_TID_COUNT | ||
818 | 819 | ||
819 | #define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2) | 820 | #define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2) |
820 | #define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8) | 821 | #define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c index 752493f00406..65d1f05007be 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | |||
@@ -972,11 +972,11 @@ void iwl_irq_tasklet(struct iwl_trans *trans) | |||
972 | } | 972 | } |
973 | #endif | 973 | #endif |
974 | 974 | ||
975 | spin_unlock_irqrestore(&trans->shrd->lock, flags); | ||
976 | |||
977 | /* saved interrupt in inta variable now we can reset trans_pcie->inta */ | 975 | /* saved interrupt in inta variable now we can reset trans_pcie->inta */ |
978 | trans_pcie->inta = 0; | 976 | trans_pcie->inta = 0; |
979 | 977 | ||
978 | spin_unlock_irqrestore(&trans->shrd->lock, flags); | ||
979 | |||
980 | /* Now service all interrupt bits discovered above. */ | 980 | /* Now service all interrupt bits discovered above. */ |
981 | if (inta & CSR_INT_BIT_HW_ERR) { | 981 | if (inta & CSR_INT_BIT_HW_ERR) { |
982 | IWL_ERR(trans, "Hardware error detected. Restarting.\n"); | 982 | IWL_ERR(trans, "Hardware error detected. Restarting.\n"); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index 67d6e324e26f..324d06dfb690 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -1262,6 +1262,7 @@ static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid, | |||
1262 | txq->time_stamp = jiffies; | 1262 | txq->time_stamp = jiffies; |
1263 | 1263 | ||
1264 | if (unlikely(txq_id >= IWLAGN_FIRST_AMPDU_QUEUE && | 1264 | if (unlikely(txq_id >= IWLAGN_FIRST_AMPDU_QUEUE && |
1265 | tid != IWL_TID_NON_QOS && | ||
1265 | txq_id != trans_pcie->agg_txq[sta_id][tid])) { | 1266 | txq_id != trans_pcie->agg_txq[sta_id][tid])) { |
1266 | /* | 1267 | /* |
1267 | * FIXME: this is a uCode bug which need to be addressed, | 1268 | * FIXME: this is a uCode bug which need to be addressed, |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index c3b6c4652cd6..2210a0f9af2d 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -841,7 +841,13 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, | |||
841 | ret = mwifiex_set_rf_channel(priv, channel, | 841 | ret = mwifiex_set_rf_channel(priv, channel, |
842 | priv->adapter->channel_type); | 842 | priv->adapter->channel_type); |
843 | 843 | ||
844 | ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */ | 844 | /* As this is new association, clear locally stored |
845 | * keys and security related flags */ | ||
846 | priv->sec_info.wpa_enabled = false; | ||
847 | priv->sec_info.wpa2_enabled = false; | ||
848 | priv->wep_key_curr_index = 0; | ||
849 | priv->sec_info.encryption_mode = 0; | ||
850 | ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); | ||
845 | 851 | ||
846 | if (mode == NL80211_IFTYPE_ADHOC) { | 852 | if (mode == NL80211_IFTYPE_ADHOC) { |
847 | /* "privacy" is set only for ad-hoc mode */ | 853 | /* "privacy" is set only for ad-hoc mode */ |
@@ -886,6 +892,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, | |||
886 | dev_dbg(priv->adapter->dev, | 892 | dev_dbg(priv->adapter->dev, |
887 | "info: setting wep encryption" | 893 | "info: setting wep encryption" |
888 | " with key len %d\n", sme->key_len); | 894 | " with key len %d\n", sme->key_len); |
895 | priv->wep_key_curr_index = sme->key_idx; | ||
889 | ret = mwifiex_set_encode(priv, sme->key, sme->key_len, | 896 | ret = mwifiex_set_encode(priv, sme->key, sme->key_len, |
890 | sme->key_idx, 0); | 897 | sme->key_idx, 0); |
891 | } | 898 | } |
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index e05b417a3fae..1d0ec57a0143 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c | |||
@@ -382,7 +382,8 @@ mwifiex_free_adapter(struct mwifiex_adapter *adapter) | |||
382 | 382 | ||
383 | adapter->if_ops.cleanup_if(adapter); | 383 | adapter->if_ops.cleanup_if(adapter); |
384 | 384 | ||
385 | dev_kfree_skb_any(adapter->sleep_cfm); | 385 | if (adapter->sleep_cfm) |
386 | dev_kfree_skb_any(adapter->sleep_cfm); | ||
386 | } | 387 | } |
387 | 388 | ||
388 | /* | 389 | /* |
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 84be196188cc..b728f54451e4 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -822,7 +822,9 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) | |||
822 | continue; | 822 | continue; |
823 | 823 | ||
824 | rtnl_lock(); | 824 | rtnl_lock(); |
825 | mwifiex_del_virtual_intf(priv->wdev->wiphy, priv->netdev); | 825 | if (priv->wdev && priv->netdev) |
826 | mwifiex_del_virtual_intf(priv->wdev->wiphy, | ||
827 | priv->netdev); | ||
826 | rtnl_unlock(); | 828 | rtnl_unlock(); |
827 | } | 829 | } |
828 | 830 | ||
@@ -830,9 +832,11 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) | |||
830 | if (!priv) | 832 | if (!priv) |
831 | goto exit_remove; | 833 | goto exit_remove; |
832 | 834 | ||
833 | wiphy_unregister(priv->wdev->wiphy); | 835 | if (priv->wdev) { |
834 | wiphy_free(priv->wdev->wiphy); | 836 | wiphy_unregister(priv->wdev->wiphy); |
835 | kfree(priv->wdev); | 837 | wiphy_free(priv->wdev->wiphy); |
838 | kfree(priv->wdev); | ||
839 | } | ||
836 | 840 | ||
837 | mwifiex_terminate_workqueue(adapter); | 841 | mwifiex_terminate_workqueue(adapter); |
838 | 842 | ||
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index 470ca75ec250..b0fbf5d4fea0 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -54,7 +54,7 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, | |||
54 | int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) | 54 | int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) |
55 | { | 55 | { |
56 | bool cancel_flag = false; | 56 | bool cancel_flag = false; |
57 | int status = adapter->cmd_wait_q.status; | 57 | int status; |
58 | struct cmd_ctrl_node *cmd_queued; | 58 | struct cmd_ctrl_node *cmd_queued; |
59 | 59 | ||
60 | if (!adapter->cmd_queued) | 60 | if (!adapter->cmd_queued) |
@@ -79,6 +79,8 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) | |||
79 | mwifiex_cancel_pending_ioctl(adapter); | 79 | mwifiex_cancel_pending_ioctl(adapter); |
80 | dev_dbg(adapter->dev, "cmd cancel\n"); | 80 | dev_dbg(adapter->dev, "cmd cancel\n"); |
81 | } | 81 | } |
82 | |||
83 | status = adapter->cmd_wait_q.status; | ||
82 | adapter->cmd_wait_q.status = 0; | 84 | adapter->cmd_wait_q.status = 0; |
83 | 85 | ||
84 | return status; | 86 | return status; |
@@ -240,6 +242,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | |||
240 | 242 | ||
241 | if (!netif_queue_stopped(priv->netdev)) | 243 | if (!netif_queue_stopped(priv->netdev)) |
242 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); | 244 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); |
245 | if (netif_carrier_ok(priv->netdev)) | ||
246 | netif_carrier_off(priv->netdev); | ||
243 | 247 | ||
244 | /* Clear any past association response stored for | 248 | /* Clear any past association response stored for |
245 | * application retrieval */ | 249 | * application retrieval */ |
@@ -271,6 +275,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | |||
271 | 275 | ||
272 | if (!netif_queue_stopped(priv->netdev)) | 276 | if (!netif_queue_stopped(priv->netdev)) |
273 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); | 277 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); |
278 | if (netif_carrier_ok(priv->netdev)) | ||
279 | netif_carrier_off(priv->netdev); | ||
274 | 280 | ||
275 | if (!ret) { | 281 | if (!ret) { |
276 | dev_dbg(adapter->dev, "info: network found in scan" | 282 | dev_dbg(adapter->dev, "info: network found in scan" |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 22a1a8fc6e02..7bef66def10c 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -514,9 +514,9 @@ EXPORT_SYMBOL_GPL(rt2800_write_tx_data); | |||
514 | 514 | ||
515 | static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2) | 515 | static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2) |
516 | { | 516 | { |
517 | int rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); | 517 | s8 rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); |
518 | int rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); | 518 | s8 rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); |
519 | int rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); | 519 | s8 rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); |
520 | u16 eeprom; | 520 | u16 eeprom; |
521 | u8 offset0; | 521 | u8 offset0; |
522 | u8 offset1; | 522 | u8 offset1; |
@@ -552,7 +552,7 @@ static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2) | |||
552 | * which gives less energy... | 552 | * which gives less energy... |
553 | */ | 553 | */ |
554 | rssi0 = max(rssi0, rssi1); | 554 | rssi0 = max(rssi0, rssi1); |
555 | return max(rssi0, rssi2); | 555 | return (int)max(rssi0, rssi2); |
556 | } | 556 | } |
557 | 557 | ||
558 | void rt2800_process_rxwi(struct queue_entry *entry, | 558 | void rt2800_process_rxwi(struct queue_entry *entry, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index c3e1aa7c1a80..d2a1ea98d0f2 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -1220,7 +1220,8 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) | |||
1220 | cancel_work_sync(&rt2x00dev->rxdone_work); | 1220 | cancel_work_sync(&rt2x00dev->rxdone_work); |
1221 | cancel_work_sync(&rt2x00dev->txdone_work); | 1221 | cancel_work_sync(&rt2x00dev->txdone_work); |
1222 | } | 1222 | } |
1223 | destroy_workqueue(rt2x00dev->workqueue); | 1223 | if (rt2x00dev->workqueue) |
1224 | destroy_workqueue(rt2x00dev->workqueue); | ||
1224 | 1225 | ||
1225 | /* | 1226 | /* |
1226 | * Free the tx status fifo. | 1227 | * Free the tx status fifo. |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 39e0907a3c4e..9245d882c06a 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -1501,7 +1501,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev) | |||
1501 | return err; | 1501 | return err; |
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | return 1; | 1504 | return 0; |
1505 | } | 1505 | } |
1506 | 1506 | ||
1507 | static int rtl_pci_start(struct ieee80211_hw *hw) | 1507 | static int rtl_pci_start(struct ieee80211_hw *hw) |
@@ -1870,7 +1870,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1870 | } | 1870 | } |
1871 | 1871 | ||
1872 | /* Init PCI sw */ | 1872 | /* Init PCI sw */ |
1873 | err = !rtl_pci_init(hw, pdev); | 1873 | err = rtl_pci_init(hw, pdev); |
1874 | if (err) { | 1874 | if (err) { |
1875 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1875 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
1876 | ("Failed to init PCI.\n")); | 1876 | ("Failed to init PCI.\n")); |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 0a70149df3fc..98a574a4a465 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -866,6 +866,14 @@ static int fill_ctrlset(struct zd_mac *mac, | |||
866 | 866 | ||
867 | ZD_ASSERT(frag_len <= 0xffff); | 867 | ZD_ASSERT(frag_len <= 0xffff); |
868 | 868 | ||
869 | /* | ||
870 | * Firmware computes the duration itself (for all frames except PSPoll) | ||
871 | * and needs the field set to 0 at input, otherwise firmware messes up | ||
872 | * duration_id and sets bits 14 and 15 on. | ||
873 | */ | ||
874 | if (!ieee80211_is_pspoll(hdr->frame_control)) | ||
875 | hdr->duration_id = 0; | ||
876 | |||
869 | txrate = ieee80211_get_tx_rate(mac->hw, info); | 877 | txrate = ieee80211_get_tx_rate(mac->hw, info); |
870 | 878 | ||
871 | cs->modulation = txrate->hw_value; | 879 | cs->modulation = txrate->hw_value; |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index fa679057630f..698b905058dd 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -68,7 +68,7 @@ struct netfront_cb { | |||
68 | 68 | ||
69 | #define NET_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE) | 69 | #define NET_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE) |
70 | #define NET_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE) | 70 | #define NET_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE) |
71 | #define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256) | 71 | #define TX_MAX_TARGET min_t(int, NET_TX_RING_SIZE, 256) |
72 | 72 | ||
73 | struct netfront_stats { | 73 | struct netfront_stats { |
74 | u64 rx_packets; | 74 | u64 rx_packets; |