diff options
113 files changed, 744 insertions, 468 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index fe95105992c5..3c5e465296e1 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
| @@ -144,6 +144,7 @@ tcp_adv_win_scale - INTEGER | |||
| 144 | Count buffering overhead as bytes/2^tcp_adv_win_scale | 144 | Count buffering overhead as bytes/2^tcp_adv_win_scale |
| 145 | (if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale), | 145 | (if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale), |
| 146 | if it is <= 0. | 146 | if it is <= 0. |
| 147 | Possible values are [-31, 31], inclusive. | ||
| 147 | Default: 2 | 148 | Default: 2 |
| 148 | 149 | ||
| 149 | tcp_allowed_congestion_control - STRING | 150 | tcp_allowed_congestion_control - STRING |
diff --git a/MAINTAINERS b/MAINTAINERS index 9206cb462913..dec390dff141 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -5926,7 +5926,6 @@ F: include/linux/tty.h | |||
| 5926 | 5926 | ||
| 5927 | TULIP NETWORK DRIVERS | 5927 | TULIP NETWORK DRIVERS |
| 5928 | M: Grant Grundler <grundler@parisc-linux.org> | 5928 | M: Grant Grundler <grundler@parisc-linux.org> |
| 5929 | M: Kyle McMartin <kyle@mcmartin.ca> | ||
| 5930 | L: netdev@vger.kernel.org | 5929 | L: netdev@vger.kernel.org |
| 5931 | S: Maintained | 5930 | S: Maintained |
| 5932 | F: drivers/net/tulip/ | 5931 | F: drivers/net/tulip/ |
diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c index 46b94762125b..f9b983ae6877 100644 --- a/drivers/atm/adummy.c +++ b/drivers/atm/adummy.c | |||
| @@ -154,7 +154,7 @@ static int __init adummy_init(void) | |||
| 154 | err = -ENOMEM; | 154 | err = -ENOMEM; |
| 155 | goto out; | 155 | goto out; |
| 156 | } | 156 | } |
| 157 | atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, NULL); | 157 | atm_dev = atm_dev_register(DEV_LABEL, NULL, &adummy_ops, -1, NULL); |
| 158 | if (!atm_dev) { | 158 | if (!atm_dev) { |
| 159 | printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); | 159 | printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); |
| 160 | err = -ENODEV; | 160 | err = -ENODEV; |
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index a33896a482e6..ffe9b655292e 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c | |||
| @@ -2244,7 +2244,8 @@ static int __devinit amb_probe(struct pci_dev *pci_dev, const struct pci_device_ | |||
| 2244 | goto out_reset; | 2244 | goto out_reset; |
| 2245 | } | 2245 | } |
| 2246 | 2246 | ||
| 2247 | dev->atm_dev = atm_dev_register (DEV_LABEL, &amb_ops, -1, NULL); | 2247 | dev->atm_dev = atm_dev_register (DEV_LABEL, &pci_dev->dev, &amb_ops, -1, |
| 2248 | NULL); | ||
| 2248 | if (!dev->atm_dev) { | 2249 | if (!dev->atm_dev) { |
| 2249 | PRINTD (DBG_ERR, "failed to register Madge ATM adapter"); | 2250 | PRINTD (DBG_ERR, "failed to register Madge ATM adapter"); |
| 2250 | err = -EINVAL; | 2251 | err = -EINVAL; |
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index b9101818b47b..2b464b631f22 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c | |||
| @@ -366,7 +366,7 @@ static int atmtcp_create(int itf,int persist,struct atm_dev **result) | |||
| 366 | if (!dev_data) | 366 | if (!dev_data) |
| 367 | return -ENOMEM; | 367 | return -ENOMEM; |
| 368 | 368 | ||
| 369 | dev = atm_dev_register(DEV_LABEL,&atmtcp_v_dev_ops,itf,NULL); | 369 | dev = atm_dev_register(DEV_LABEL,NULL,&atmtcp_v_dev_ops,itf,NULL); |
| 370 | if (!dev) { | 370 | if (!dev) { |
| 371 | kfree(dev_data); | 371 | kfree(dev_data); |
| 372 | return itf == -1 ? -ENOMEM : -EBUSY; | 372 | return itf == -1 ? -ENOMEM : -EBUSY; |
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index 97c5898cd76e..c495fae74200 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c | |||
| @@ -2244,7 +2244,7 @@ static int __devinit eni_init_one(struct pci_dev *pci_dev, | |||
| 2244 | &zeroes); | 2244 | &zeroes); |
| 2245 | if (!cpu_zeroes) goto out1; | 2245 | if (!cpu_zeroes) goto out1; |
| 2246 | } | 2246 | } |
| 2247 | dev = atm_dev_register(DEV_LABEL,&ops,-1,NULL); | 2247 | dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &ops, -1, NULL); |
| 2248 | if (!dev) goto out2; | 2248 | if (!dev) goto out2; |
| 2249 | pci_set_drvdata(pci_dev, dev); | 2249 | pci_set_drvdata(pci_dev, dev); |
| 2250 | eni_dev->pci_dev = pci_dev; | 2250 | eni_dev->pci_dev = pci_dev; |
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 5d86bb803e94..7d912baf01d4 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c | |||
| @@ -1911,7 +1911,7 @@ static int __devinit firestream_init_one (struct pci_dev *pci_dev, | |||
| 1911 | fs_dev, sizeof (struct fs_dev)); | 1911 | fs_dev, sizeof (struct fs_dev)); |
| 1912 | if (!fs_dev) | 1912 | if (!fs_dev) |
| 1913 | goto err_out; | 1913 | goto err_out; |
| 1914 | atm_dev = atm_dev_register("fs", &ops, -1, NULL); | 1914 | atm_dev = atm_dev_register("fs", &pci_dev->dev, &ops, -1, NULL); |
| 1915 | if (!atm_dev) | 1915 | if (!atm_dev) |
| 1916 | goto err_out_free_fs_dev; | 1916 | goto err_out_free_fs_dev; |
| 1917 | 1917 | ||
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index c8fc69c85a06..962c309b40c0 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c | |||
| @@ -2567,14 +2567,14 @@ release: | |||
| 2567 | 2567 | ||
| 2568 | 2568 | ||
| 2569 | static int __devinit | 2569 | static int __devinit |
| 2570 | fore200e_register(struct fore200e* fore200e) | 2570 | fore200e_register(struct fore200e* fore200e, struct device *parent) |
| 2571 | { | 2571 | { |
| 2572 | struct atm_dev* atm_dev; | 2572 | struct atm_dev* atm_dev; |
| 2573 | 2573 | ||
| 2574 | DPRINTK(2, "device %s being registered\n", fore200e->name); | 2574 | DPRINTK(2, "device %s being registered\n", fore200e->name); |
| 2575 | 2575 | ||
| 2576 | atm_dev = atm_dev_register(fore200e->bus->proc_name, &fore200e_ops, -1, | 2576 | atm_dev = atm_dev_register(fore200e->bus->proc_name, parent, &fore200e_ops, |
| 2577 | NULL); | 2577 | -1, NULL); |
| 2578 | if (atm_dev == NULL) { | 2578 | if (atm_dev == NULL) { |
| 2579 | printk(FORE200E "unable to register device %s\n", fore200e->name); | 2579 | printk(FORE200E "unable to register device %s\n", fore200e->name); |
| 2580 | return -ENODEV; | 2580 | return -ENODEV; |
| @@ -2594,9 +2594,9 @@ fore200e_register(struct fore200e* fore200e) | |||
| 2594 | 2594 | ||
| 2595 | 2595 | ||
| 2596 | static int __devinit | 2596 | static int __devinit |
| 2597 | fore200e_init(struct fore200e* fore200e) | 2597 | fore200e_init(struct fore200e* fore200e, struct device *parent) |
| 2598 | { | 2598 | { |
| 2599 | if (fore200e_register(fore200e) < 0) | 2599 | if (fore200e_register(fore200e, parent) < 0) |
| 2600 | return -ENODEV; | 2600 | return -ENODEV; |
| 2601 | 2601 | ||
| 2602 | if (fore200e->bus->configure(fore200e) < 0) | 2602 | if (fore200e->bus->configure(fore200e) < 0) |
| @@ -2662,7 +2662,7 @@ static int __devinit fore200e_sba_probe(struct platform_device *op, | |||
| 2662 | 2662 | ||
| 2663 | sprintf(fore200e->name, "%s-%d", bus->model_name, index); | 2663 | sprintf(fore200e->name, "%s-%d", bus->model_name, index); |
| 2664 | 2664 | ||
| 2665 | err = fore200e_init(fore200e); | 2665 | err = fore200e_init(fore200e, &op->dev); |
| 2666 | if (err < 0) { | 2666 | if (err < 0) { |
| 2667 | fore200e_shutdown(fore200e); | 2667 | fore200e_shutdown(fore200e); |
| 2668 | kfree(fore200e); | 2668 | kfree(fore200e); |
| @@ -2740,7 +2740,7 @@ fore200e_pca_detect(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent | |||
| 2740 | 2740 | ||
| 2741 | sprintf(fore200e->name, "%s-%d", bus->model_name, index); | 2741 | sprintf(fore200e->name, "%s-%d", bus->model_name, index); |
| 2742 | 2742 | ||
| 2743 | err = fore200e_init(fore200e); | 2743 | err = fore200e_init(fore200e, &pci_dev->dev); |
| 2744 | if (err < 0) { | 2744 | if (err < 0) { |
| 2745 | fore200e_shutdown(fore200e); | 2745 | fore200e_shutdown(fore200e); |
| 2746 | goto out_free; | 2746 | goto out_free; |
diff --git a/drivers/atm/he.c b/drivers/atm/he.c index 801e8b6e9d1f..6cf59bf281dc 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c | |||
| @@ -366,7 +366,7 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) | |||
| 366 | goto init_one_failure; | 366 | goto init_one_failure; |
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | atm_dev = atm_dev_register(DEV_LABEL, &he_ops, -1, NULL); | 369 | atm_dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &he_ops, -1, NULL); |
| 370 | if (!atm_dev) { | 370 | if (!atm_dev) { |
| 371 | err = -ENODEV; | 371 | err = -ENODEV; |
| 372 | goto init_one_failure; | 372 | goto init_one_failure; |
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index a95790452a68..24761e1d6642 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c | |||
| @@ -2733,7 +2733,8 @@ static int __devinit hrz_probe(struct pci_dev *pci_dev, const struct pci_device_ | |||
| 2733 | PRINTD(DBG_INFO, "found Madge ATM adapter (hrz) at: IO %x, IRQ %u, MEM %p", | 2733 | PRINTD(DBG_INFO, "found Madge ATM adapter (hrz) at: IO %x, IRQ %u, MEM %p", |
| 2734 | iobase, irq, membase); | 2734 | iobase, irq, membase); |
| 2735 | 2735 | ||
| 2736 | dev->atm_dev = atm_dev_register(DEV_LABEL, &hrz_ops, -1, NULL); | 2736 | dev->atm_dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &hrz_ops, -1, |
| 2737 | NULL); | ||
| 2737 | if (!(dev->atm_dev)) { | 2738 | if (!(dev->atm_dev)) { |
| 2738 | PRINTD(DBG_ERR, "failed to register Madge ATM adapter"); | 2739 | PRINTD(DBG_ERR, "failed to register Madge ATM adapter"); |
| 2739 | err = -EINVAL; | 2740 | err = -EINVAL; |
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index bce57328ddde..bfb7feee0400 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c | |||
| @@ -3698,7 +3698,8 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) | |||
| 3698 | goto err_out_iounmap; | 3698 | goto err_out_iounmap; |
| 3699 | } | 3699 | } |
| 3700 | 3700 | ||
| 3701 | dev = atm_dev_register("idt77252", &idt77252_ops, -1, NULL); | 3701 | dev = atm_dev_register("idt77252", &pcidev->dev, &idt77252_ops, -1, |
| 3702 | NULL); | ||
| 3702 | if (!dev) { | 3703 | if (!dev) { |
| 3703 | printk("%s: can't register atm device\n", card->name); | 3704 | printk("%s: can't register atm device\n", card->name); |
| 3704 | err = -EIO; | 3705 | err = -EIO; |
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 9309d4724e13..729254053758 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
| @@ -3172,7 +3172,7 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
| 3172 | ret = -ENODEV; | 3172 | ret = -ENODEV; |
| 3173 | goto err_out_free_iadev; | 3173 | goto err_out_free_iadev; |
| 3174 | } | 3174 | } |
| 3175 | dev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); | 3175 | dev = atm_dev_register(DEV_LABEL, &pdev->dev, &ops, -1, NULL); |
| 3176 | if (!dev) { | 3176 | if (!dev) { |
| 3177 | ret = -ENOMEM; | 3177 | ret = -ENOMEM; |
| 3178 | goto err_out_disable_dev; | 3178 | goto err_out_disable_dev; |
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index cbe15a86c669..a395c9aab146 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
| @@ -2591,7 +2591,7 @@ static int __devinit lanai_init_one(struct pci_dev *pci, | |||
| 2591 | return -ENOMEM; | 2591 | return -ENOMEM; |
| 2592 | } | 2592 | } |
| 2593 | 2593 | ||
| 2594 | atmdev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); | 2594 | atmdev = atm_dev_register(DEV_LABEL, &pci->dev, &ops, -1, NULL); |
| 2595 | if (atmdev == NULL) { | 2595 | if (atmdev == NULL) { |
| 2596 | printk(KERN_ERR DEV_LABEL | 2596 | printk(KERN_ERR DEV_LABEL |
| 2597 | ": couldn't register atm device!\n"); | 2597 | ": couldn't register atm device!\n"); |
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 2f3516b7f118..6b313ee9231b 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c | |||
| @@ -771,7 +771,8 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev) | |||
| 771 | } | 771 | } |
| 772 | 772 | ||
| 773 | /* Register device */ | 773 | /* Register device */ |
| 774 | card->atmdev = atm_dev_register("nicstar", &atm_ops, -1, NULL); | 774 | card->atmdev = atm_dev_register("nicstar", &card->pcidev->dev, &atm_ops, |
| 775 | -1, NULL); | ||
| 775 | if (card->atmdev == NULL) { | 776 | if (card->atmdev == NULL) { |
| 776 | printk("nicstar%d: can't register device.\n", i); | 777 | printk("nicstar%d: can't register device.\n", i); |
| 777 | error = 17; | 778 | error = 17; |
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 2e08c996fd30..73fb1c4f4cd4 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c | |||
| @@ -166,7 +166,7 @@ static irqreturn_t solos_irq(int irq, void *dev_id); | |||
| 166 | static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci); | 166 | static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci); |
| 167 | static int list_vccs(int vci); | 167 | static int list_vccs(int vci); |
| 168 | static void release_vccs(struct atm_dev *dev); | 168 | static void release_vccs(struct atm_dev *dev); |
| 169 | static int atm_init(struct solos_card *); | 169 | static int atm_init(struct solos_card *, struct device *); |
| 170 | static void atm_remove(struct solos_card *); | 170 | static void atm_remove(struct solos_card *); |
| 171 | static int send_command(struct solos_card *card, int dev, const char *buf, size_t size); | 171 | static int send_command(struct solos_card *card, int dev, const char *buf, size_t size); |
| 172 | static void solos_bh(unsigned long); | 172 | static void solos_bh(unsigned long); |
| @@ -1210,7 +1210,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1210 | if (db_firmware_upgrade) | 1210 | if (db_firmware_upgrade) |
| 1211 | flash_upgrade(card, 3); | 1211 | flash_upgrade(card, 3); |
| 1212 | 1212 | ||
| 1213 | err = atm_init(card); | 1213 | err = atm_init(card, &dev->dev); |
| 1214 | if (err) | 1214 | if (err) |
| 1215 | goto out_free_irq; | 1215 | goto out_free_irq; |
| 1216 | 1216 | ||
| @@ -1233,7 +1233,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1233 | return err; | 1233 | return err; |
| 1234 | } | 1234 | } |
| 1235 | 1235 | ||
| 1236 | static int atm_init(struct solos_card *card) | 1236 | static int atm_init(struct solos_card *card, struct device *parent) |
| 1237 | { | 1237 | { |
| 1238 | int i; | 1238 | int i; |
| 1239 | 1239 | ||
| @@ -1244,7 +1244,7 @@ static int atm_init(struct solos_card *card) | |||
| 1244 | skb_queue_head_init(&card->tx_queue[i]); | 1244 | skb_queue_head_init(&card->tx_queue[i]); |
| 1245 | skb_queue_head_init(&card->cli_queue[i]); | 1245 | skb_queue_head_init(&card->cli_queue[i]); |
| 1246 | 1246 | ||
| 1247 | card->atmdev[i] = atm_dev_register("solos-pci", &fpga_ops, -1, NULL); | 1247 | card->atmdev[i] = atm_dev_register("solos-pci", parent, &fpga_ops, -1, NULL); |
| 1248 | if (!card->atmdev[i]) { | 1248 | if (!card->atmdev[i]) { |
| 1249 | dev_err(&card->dev->dev, "Could not register ATM device %d\n", i); | 1249 | dev_err(&card->dev->dev, "Could not register ATM device %d\n", i); |
| 1250 | atm_remove(card); | 1250 | atm_remove(card); |
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 4e885d2da49c..624917902b65 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
| @@ -1597,7 +1597,7 @@ static int __devinit zatm_init_one(struct pci_dev *pci_dev, | |||
| 1597 | goto out; | 1597 | goto out; |
| 1598 | } | 1598 | } |
| 1599 | 1599 | ||
| 1600 | dev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); | 1600 | dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &ops, -1, NULL); |
| 1601 | if (!dev) | 1601 | if (!dev) |
| 1602 | goto out_free; | 1602 | goto out_free; |
| 1603 | 1603 | ||
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 128cae4e8629..949ed09c6361 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
| @@ -35,6 +35,10 @@ | |||
| 35 | static struct usb_device_id ath3k_table[] = { | 35 | static struct usb_device_id ath3k_table[] = { |
| 36 | /* Atheros AR3011 */ | 36 | /* Atheros AR3011 */ |
| 37 | { USB_DEVICE(0x0CF3, 0x3000) }, | 37 | { USB_DEVICE(0x0CF3, 0x3000) }, |
| 38 | |||
| 39 | /* Atheros AR3011 with sflash firmware*/ | ||
| 40 | { USB_DEVICE(0x0CF3, 0x3002) }, | ||
| 41 | |||
| 38 | { } /* Terminating entry */ | 42 | { } /* Terminating entry */ |
| 39 | }; | 43 | }; |
| 40 | 44 | ||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index ab3894f742c3..1da773f899a2 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
| @@ -99,6 +99,9 @@ static struct usb_device_id blacklist_table[] = { | |||
| 99 | /* Broadcom BCM2033 without firmware */ | 99 | /* Broadcom BCM2033 without firmware */ |
| 100 | { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE }, | 100 | { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE }, |
| 101 | 101 | ||
| 102 | /* Atheros 3011 with sflash firmware */ | ||
| 103 | { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, | ||
| 104 | |||
| 102 | /* Broadcom BCM2035 */ | 105 | /* Broadcom BCM2035 */ |
| 103 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, | 106 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, |
| 104 | { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, | 107 | { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, |
| @@ -239,7 +242,8 @@ static void btusb_intr_complete(struct urb *urb) | |||
| 239 | 242 | ||
| 240 | err = usb_submit_urb(urb, GFP_ATOMIC); | 243 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 241 | if (err < 0) { | 244 | if (err < 0) { |
| 242 | BT_ERR("%s urb %p failed to resubmit (%d)", | 245 | if (err != -EPERM) |
| 246 | BT_ERR("%s urb %p failed to resubmit (%d)", | ||
| 243 | hdev->name, urb, -err); | 247 | hdev->name, urb, -err); |
| 244 | usb_unanchor_urb(urb); | 248 | usb_unanchor_urb(urb); |
| 245 | } | 249 | } |
| @@ -323,7 +327,8 @@ static void btusb_bulk_complete(struct urb *urb) | |||
| 323 | 327 | ||
| 324 | err = usb_submit_urb(urb, GFP_ATOMIC); | 328 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 325 | if (err < 0) { | 329 | if (err < 0) { |
| 326 | BT_ERR("%s urb %p failed to resubmit (%d)", | 330 | if (err != -EPERM) |
| 331 | BT_ERR("%s urb %p failed to resubmit (%d)", | ||
| 327 | hdev->name, urb, -err); | 332 | hdev->name, urb, -err); |
| 328 | usb_unanchor_urb(urb); | 333 | usb_unanchor_urb(urb); |
| 329 | } | 334 | } |
| @@ -412,7 +417,8 @@ static void btusb_isoc_complete(struct urb *urb) | |||
| 412 | 417 | ||
| 413 | err = usb_submit_urb(urb, GFP_ATOMIC); | 418 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 414 | if (err < 0) { | 419 | if (err < 0) { |
| 415 | BT_ERR("%s urb %p failed to resubmit (%d)", | 420 | if (err != -EPERM) |
| 421 | BT_ERR("%s urb %p failed to resubmit (%d)", | ||
| 416 | hdev->name, urb, -err); | 422 | hdev->name, urb, -err); |
| 417 | usb_unanchor_urb(urb); | 423 | usb_unanchor_urb(urb); |
| 418 | } | 424 | } |
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index e16c3fa8d2e3..05117f1ad867 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | MODULE_LICENSE("GPL"); | 36 | MODULE_LICENSE("GPL"); |
| 37 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); | 37 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); |
| 38 | MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); | 38 | MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); |
| 39 | MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_CONNECTOR); | ||
| 39 | 40 | ||
| 40 | static struct cn_dev cdev; | 41 | static struct cn_dev cdev; |
| 41 | 42 | ||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index f6668cdaac85..a445a0492c52 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
| @@ -2543,10 +2543,10 @@ config PCH_GBE | |||
| 2543 | depends on PCI | 2543 | depends on PCI |
| 2544 | select MII | 2544 | select MII |
| 2545 | ---help--- | 2545 | ---help--- |
| 2546 | This is a gigabit ethernet driver for Topcliff PCH. | 2546 | This is a gigabit ethernet driver for EG20T PCH. |
| 2547 | Topcliff PCH is the platform controller hub that is used in Intel's | 2547 | EG20T PCH is the platform controller hub that is used in Intel's |
| 2548 | general embedded platform. | 2548 | general embedded platform. |
| 2549 | Topcliff PCH has Gigabit Ethernet interface. | 2549 | EG20T PCH has Gigabit Ethernet interface. |
| 2550 | Using this interface, it is able to access system devices connected | 2550 | Using this interface, it is able to access system devices connected |
| 2551 | to Gigabit Ethernet. | 2551 | to Gigabit Ethernet. |
| 2552 | This driver enables Gigabit Ethernet function. | 2552 | This driver enables Gigabit Ethernet function. |
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 43489f89c142..53eff9ba6e95 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
| @@ -155,10 +155,10 @@ static void au1000_enable_mac(struct net_device *dev, int force_reset) | |||
| 155 | spin_lock_irqsave(&aup->lock, flags); | 155 | spin_lock_irqsave(&aup->lock, flags); |
| 156 | 156 | ||
| 157 | if (force_reset || (!aup->mac_enabled)) { | 157 | if (force_reset || (!aup->mac_enabled)) { |
| 158 | writel(MAC_EN_CLOCK_ENABLE, &aup->enable); | 158 | writel(MAC_EN_CLOCK_ENABLE, aup->enable); |
| 159 | au_sync_delay(2); | 159 | au_sync_delay(2); |
| 160 | writel((MAC_EN_RESET0 | MAC_EN_RESET1 | MAC_EN_RESET2 | 160 | writel((MAC_EN_RESET0 | MAC_EN_RESET1 | MAC_EN_RESET2 |
| 161 | | MAC_EN_CLOCK_ENABLE), &aup->enable); | 161 | | MAC_EN_CLOCK_ENABLE), aup->enable); |
| 162 | au_sync_delay(2); | 162 | au_sync_delay(2); |
| 163 | 163 | ||
| 164 | aup->mac_enabled = 1; | 164 | aup->mac_enabled = 1; |
| @@ -503,9 +503,9 @@ static void au1000_reset_mac_unlocked(struct net_device *dev) | |||
| 503 | 503 | ||
| 504 | au1000_hard_stop(dev); | 504 | au1000_hard_stop(dev); |
| 505 | 505 | ||
| 506 | writel(MAC_EN_CLOCK_ENABLE, &aup->enable); | 506 | writel(MAC_EN_CLOCK_ENABLE, aup->enable); |
| 507 | au_sync_delay(2); | 507 | au_sync_delay(2); |
| 508 | writel(0, &aup->enable); | 508 | writel(0, aup->enable); |
| 509 | au_sync_delay(2); | 509 | au_sync_delay(2); |
| 510 | 510 | ||
| 511 | aup->tx_full = 0; | 511 | aup->tx_full = 0; |
| @@ -1119,7 +1119,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
| 1119 | /* set a random MAC now in case platform_data doesn't provide one */ | 1119 | /* set a random MAC now in case platform_data doesn't provide one */ |
| 1120 | random_ether_addr(dev->dev_addr); | 1120 | random_ether_addr(dev->dev_addr); |
| 1121 | 1121 | ||
| 1122 | writel(0, &aup->enable); | 1122 | writel(0, aup->enable); |
| 1123 | aup->mac_enabled = 0; | 1123 | aup->mac_enabled = 0; |
| 1124 | 1124 | ||
| 1125 | pd = pdev->dev.platform_data; | 1125 | pd = pdev->dev.platform_data; |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index c6e86315b3f8..2e2b76258ab4 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
| @@ -381,11 +381,11 @@ static void b44_set_flow_ctrl(struct b44 *bp, u32 local, u32 remote) | |||
| 381 | __b44_set_flow_ctrl(bp, pause_enab); | 381 | __b44_set_flow_ctrl(bp, pause_enab); |
| 382 | } | 382 | } |
| 383 | 383 | ||
| 384 | #ifdef SSB_DRIVER_MIPS | 384 | #ifdef CONFIG_BCM47XX |
| 385 | extern char *nvram_get(char *name); | 385 | #include <asm/mach-bcm47xx/nvram.h> |
| 386 | static void b44_wap54g10_workaround(struct b44 *bp) | 386 | static void b44_wap54g10_workaround(struct b44 *bp) |
| 387 | { | 387 | { |
| 388 | const char *str; | 388 | char buf[20]; |
| 389 | u32 val; | 389 | u32 val; |
| 390 | int err; | 390 | int err; |
| 391 | 391 | ||
| @@ -394,10 +394,9 @@ static void b44_wap54g10_workaround(struct b44 *bp) | |||
| 394 | * see https://dev.openwrt.org/ticket/146 | 394 | * see https://dev.openwrt.org/ticket/146 |
| 395 | * check and reset bit "isolate" | 395 | * check and reset bit "isolate" |
| 396 | */ | 396 | */ |
| 397 | str = nvram_get("boardnum"); | 397 | if (nvram_getenv("boardnum", buf, sizeof(buf)) < 0) |
| 398 | if (!str) | ||
| 399 | return; | 398 | return; |
| 400 | if (simple_strtoul(str, NULL, 0) == 2) { | 399 | if (simple_strtoul(buf, NULL, 0) == 2) { |
| 401 | err = __b44_readphy(bp, 0, MII_BMCR, &val); | 400 | err = __b44_readphy(bp, 0, MII_BMCR, &val); |
| 402 | if (err) | 401 | if (err) |
| 403 | goto error; | 402 | goto error; |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 36eca1ce75d4..e4465d222a7d 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
| @@ -1235,7 +1235,7 @@ int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id, | |||
| 1235 | 1235 | ||
| 1236 | i = 0; | 1236 | i = 0; |
| 1237 | netdev_for_each_mc_addr(ha, netdev) | 1237 | netdev_for_each_mc_addr(ha, netdev) |
| 1238 | memcpy(req->mac[i].byte, ha->addr, ETH_ALEN); | 1238 | memcpy(req->mac[i++].byte, ha->addr, ETH_ALEN); |
| 1239 | } else { | 1239 | } else { |
| 1240 | req->promiscuous = 1; | 1240 | req->promiscuous = 1; |
| 1241 | } | 1241 | } |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 71a169740d05..d0ea760ce419 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -171,7 +171,7 @@ MODULE_PARM_DESC(resend_igmp, "Number of IGMP membership reports to send on link | |||
| 171 | /*----------------------------- Global variables ----------------------------*/ | 171 | /*----------------------------- Global variables ----------------------------*/ |
| 172 | 172 | ||
| 173 | #ifdef CONFIG_NET_POLL_CONTROLLER | 173 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 174 | cpumask_var_t netpoll_block_tx; | 174 | atomic_t netpoll_block_tx = ATOMIC_INIT(0); |
| 175 | #endif | 175 | #endif |
| 176 | 176 | ||
| 177 | static const char * const version = | 177 | static const char * const version = |
| @@ -1576,7 +1576,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
| 1576 | 1576 | ||
| 1577 | /* If this is the first slave, then we need to set the master's hardware | 1577 | /* If this is the first slave, then we need to set the master's hardware |
| 1578 | * address to be the same as the slave's. */ | 1578 | * address to be the same as the slave's. */ |
| 1579 | if (bond->slave_cnt == 0) | 1579 | if (is_zero_ether_addr(bond->dev->dev_addr)) |
| 1580 | memcpy(bond->dev->dev_addr, slave_dev->dev_addr, | 1580 | memcpy(bond->dev->dev_addr, slave_dev->dev_addr, |
| 1581 | slave_dev->addr_len); | 1581 | slave_dev->addr_len); |
| 1582 | 1582 | ||
| @@ -5299,13 +5299,6 @@ static int __init bonding_init(void) | |||
| 5299 | if (res) | 5299 | if (res) |
| 5300 | goto out; | 5300 | goto out; |
| 5301 | 5301 | ||
| 5302 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
| 5303 | if (!alloc_cpumask_var(&netpoll_block_tx, GFP_KERNEL)) { | ||
| 5304 | res = -ENOMEM; | ||
| 5305 | goto out; | ||
| 5306 | } | ||
| 5307 | #endif | ||
| 5308 | |||
| 5309 | res = register_pernet_subsys(&bond_net_ops); | 5302 | res = register_pernet_subsys(&bond_net_ops); |
| 5310 | if (res) | 5303 | if (res) |
| 5311 | goto out; | 5304 | goto out; |
| @@ -5334,9 +5327,6 @@ err: | |||
| 5334 | rtnl_link_unregister(&bond_link_ops); | 5327 | rtnl_link_unregister(&bond_link_ops); |
| 5335 | err_link: | 5328 | err_link: |
| 5336 | unregister_pernet_subsys(&bond_net_ops); | 5329 | unregister_pernet_subsys(&bond_net_ops); |
| 5337 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
| 5338 | free_cpumask_var(netpoll_block_tx); | ||
| 5339 | #endif | ||
| 5340 | goto out; | 5330 | goto out; |
| 5341 | 5331 | ||
| 5342 | } | 5332 | } |
| @@ -5353,7 +5343,10 @@ static void __exit bonding_exit(void) | |||
| 5353 | unregister_pernet_subsys(&bond_net_ops); | 5343 | unregister_pernet_subsys(&bond_net_ops); |
| 5354 | 5344 | ||
| 5355 | #ifdef CONFIG_NET_POLL_CONTROLLER | 5345 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 5356 | free_cpumask_var(netpoll_block_tx); | 5346 | /* |
| 5347 | * Make sure we don't have an imbalance on our netpoll blocking | ||
| 5348 | */ | ||
| 5349 | WARN_ON(atomic_read(&netpoll_block_tx)); | ||
| 5357 | #endif | 5350 | #endif |
| 5358 | } | 5351 | } |
| 5359 | 5352 | ||
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 4eedb12df6ca..c2f081352a03 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
| @@ -119,26 +119,22 @@ | |||
| 119 | 119 | ||
| 120 | 120 | ||
| 121 | #ifdef CONFIG_NET_POLL_CONTROLLER | 121 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 122 | extern cpumask_var_t netpoll_block_tx; | 122 | extern atomic_t netpoll_block_tx; |
| 123 | 123 | ||
| 124 | static inline void block_netpoll_tx(void) | 124 | static inline void block_netpoll_tx(void) |
| 125 | { | 125 | { |
| 126 | preempt_disable(); | 126 | atomic_inc(&netpoll_block_tx); |
| 127 | BUG_ON(cpumask_test_and_set_cpu(smp_processor_id(), | ||
| 128 | netpoll_block_tx)); | ||
| 129 | } | 127 | } |
| 130 | 128 | ||
| 131 | static inline void unblock_netpoll_tx(void) | 129 | static inline void unblock_netpoll_tx(void) |
| 132 | { | 130 | { |
| 133 | BUG_ON(!cpumask_test_and_clear_cpu(smp_processor_id(), | 131 | atomic_dec(&netpoll_block_tx); |
| 134 | netpoll_block_tx)); | ||
| 135 | preempt_enable(); | ||
| 136 | } | 132 | } |
| 137 | 133 | ||
| 138 | static inline int is_netpoll_tx_blocked(struct net_device *dev) | 134 | static inline int is_netpoll_tx_blocked(struct net_device *dev) |
| 139 | { | 135 | { |
| 140 | if (unlikely(dev->priv_flags & IFF_IN_NETPOLL)) | 136 | if (unlikely(dev->priv_flags & IFF_IN_NETPOLL)) |
| 141 | return cpumask_test_cpu(smp_processor_id(), netpoll_block_tx); | 137 | return atomic_read(&netpoll_block_tx); |
| 142 | return 0; | 138 | return 0; |
| 143 | } | 139 | } |
| 144 | #else | 140 | #else |
diff --git a/drivers/net/caif/caif_shm_u5500.c b/drivers/net/caif/caif_shm_u5500.c index 1cd90da86f13..32b1c6fb2de1 100644 --- a/drivers/net/caif/caif_shm_u5500.c +++ b/drivers/net/caif/caif_shm_u5500.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * License terms: GNU General Public License (GPL) version 2 | 5 | * License terms: GNU General Public License (GPL) version 2 |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #define pr_fmt(fmt) KBUILD_MODNAME ":" __func__ "():" fmt | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ":" fmt |
| 9 | 9 | ||
| 10 | #include <linux/version.h> | 10 | #include <linux/version.h> |
| 11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c index 19f9c0656667..80511167f35b 100644 --- a/drivers/net/caif/caif_shmcore.c +++ b/drivers/net/caif/caif_shmcore.c | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | * License terms: GNU General Public License (GPL) version 2 | 6 | * License terms: GNU General Public License (GPL) version 2 |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #define pr_fmt(fmt) KBUILD_MODNAME ":" __func__ "():" fmt | 9 | #define pr_fmt(fmt) KBUILD_MODNAME ":" fmt |
| 10 | 10 | ||
| 11 | #include <linux/spinlock.h> | 11 | #include <linux/spinlock.h> |
| 12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
diff --git a/drivers/net/cxgb4/t4_hw.c b/drivers/net/cxgb4/t4_hw.c index bb813d94aea8..e97521c801ea 100644 --- a/drivers/net/cxgb4/t4_hw.c +++ b/drivers/net/cxgb4/t4_hw.c | |||
| @@ -2408,7 +2408,7 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, | |||
| 2408 | if (index < NEXACT_MAC) | 2408 | if (index < NEXACT_MAC) |
| 2409 | ret++; | 2409 | ret++; |
| 2410 | else if (hash) | 2410 | else if (hash) |
| 2411 | *hash |= (1 << hash_mac_addr(addr[i])); | 2411 | *hash |= (1ULL << hash_mac_addr(addr[i])); |
| 2412 | } | 2412 | } |
| 2413 | return ret; | 2413 | return ret; |
| 2414 | } | 2414 | } |
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c index c3449bbc585a..6bf464afa90e 100644 --- a/drivers/net/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/cxgb4vf/cxgb4vf_main.c | |||
| @@ -816,40 +816,48 @@ static struct net_device_stats *cxgb4vf_get_stats(struct net_device *dev) | |||
| 816 | } | 816 | } |
| 817 | 817 | ||
| 818 | /* | 818 | /* |
| 819 | * Collect up to maxaddrs worth of a netdevice's unicast addresses into an | 819 | * Collect up to maxaddrs worth of a netdevice's unicast addresses, starting |
| 820 | * array of addrss pointers and return the number collected. | 820 | * at a specified offset within the list, into an array of addrss pointers and |
| 821 | * return the number collected. | ||
| 821 | */ | 822 | */ |
| 822 | static inline int collect_netdev_uc_list_addrs(const struct net_device *dev, | 823 | static inline unsigned int collect_netdev_uc_list_addrs(const struct net_device *dev, |
| 823 | const u8 **addr, | 824 | const u8 **addr, |
| 824 | unsigned int maxaddrs) | 825 | unsigned int offset, |
| 826 | unsigned int maxaddrs) | ||
| 825 | { | 827 | { |
| 828 | unsigned int index = 0; | ||
| 826 | unsigned int naddr = 0; | 829 | unsigned int naddr = 0; |
| 827 | const struct netdev_hw_addr *ha; | 830 | const struct netdev_hw_addr *ha; |
| 828 | 831 | ||
| 829 | for_each_dev_addr(dev, ha) { | 832 | for_each_dev_addr(dev, ha) |
| 830 | addr[naddr++] = ha->addr; | 833 | if (index++ >= offset) { |
| 831 | if (naddr >= maxaddrs) | 834 | addr[naddr++] = ha->addr; |
| 832 | break; | 835 | if (naddr >= maxaddrs) |
| 833 | } | 836 | break; |
| 837 | } | ||
| 834 | return naddr; | 838 | return naddr; |
| 835 | } | 839 | } |
| 836 | 840 | ||
| 837 | /* | 841 | /* |
| 838 | * Collect up to maxaddrs worth of a netdevice's multicast addresses into an | 842 | * Collect up to maxaddrs worth of a netdevice's multicast addresses, starting |
| 839 | * array of addrss pointers and return the number collected. | 843 | * at a specified offset within the list, into an array of addrss pointers and |
| 844 | * return the number collected. | ||
| 840 | */ | 845 | */ |
| 841 | static inline int collect_netdev_mc_list_addrs(const struct net_device *dev, | 846 | static inline unsigned int collect_netdev_mc_list_addrs(const struct net_device *dev, |
| 842 | const u8 **addr, | 847 | const u8 **addr, |
| 843 | unsigned int maxaddrs) | 848 | unsigned int offset, |
| 849 | unsigned int maxaddrs) | ||
| 844 | { | 850 | { |
| 851 | unsigned int index = 0; | ||
| 845 | unsigned int naddr = 0; | 852 | unsigned int naddr = 0; |
| 846 | const struct netdev_hw_addr *ha; | 853 | const struct netdev_hw_addr *ha; |
| 847 | 854 | ||
| 848 | netdev_for_each_mc_addr(ha, dev) { | 855 | netdev_for_each_mc_addr(ha, dev) |
| 849 | addr[naddr++] = ha->addr; | 856 | if (index++ >= offset) { |
| 850 | if (naddr >= maxaddrs) | 857 | addr[naddr++] = ha->addr; |
| 851 | break; | 858 | if (naddr >= maxaddrs) |
| 852 | } | 859 | break; |
| 860 | } | ||
| 853 | return naddr; | 861 | return naddr; |
| 854 | } | 862 | } |
| 855 | 863 | ||
| @@ -862,16 +870,20 @@ static int set_addr_filters(const struct net_device *dev, bool sleep) | |||
| 862 | u64 mhash = 0; | 870 | u64 mhash = 0; |
| 863 | u64 uhash = 0; | 871 | u64 uhash = 0; |
| 864 | bool free = true; | 872 | bool free = true; |
| 865 | u16 filt_idx[7]; | 873 | unsigned int offset, naddr; |
| 866 | const u8 *addr[7]; | 874 | const u8 *addr[7]; |
| 867 | int ret, naddr = 0; | 875 | int ret; |
| 868 | const struct port_info *pi = netdev_priv(dev); | 876 | const struct port_info *pi = netdev_priv(dev); |
| 869 | 877 | ||
| 870 | /* first do the secondary unicast addresses */ | 878 | /* first do the secondary unicast addresses */ |
| 871 | naddr = collect_netdev_uc_list_addrs(dev, addr, ARRAY_SIZE(addr)); | 879 | for (offset = 0; ; offset += naddr) { |
| 872 | if (naddr > 0) { | 880 | naddr = collect_netdev_uc_list_addrs(dev, addr, offset, |
| 881 | ARRAY_SIZE(addr)); | ||
| 882 | if (naddr == 0) | ||
| 883 | break; | ||
| 884 | |||
| 873 | ret = t4vf_alloc_mac_filt(pi->adapter, pi->viid, free, | 885 | ret = t4vf_alloc_mac_filt(pi->adapter, pi->viid, free, |
| 874 | naddr, addr, filt_idx, &uhash, sleep); | 886 | naddr, addr, NULL, &uhash, sleep); |
| 875 | if (ret < 0) | 887 | if (ret < 0) |
| 876 | return ret; | 888 | return ret; |
| 877 | 889 | ||
| @@ -879,12 +891,17 @@ static int set_addr_filters(const struct net_device *dev, bool sleep) | |||
| 879 | } | 891 | } |
| 880 | 892 | ||
| 881 | /* next set up the multicast addresses */ | 893 | /* next set up the multicast addresses */ |
| 882 | naddr = collect_netdev_mc_list_addrs(dev, addr, ARRAY_SIZE(addr)); | 894 | for (offset = 0; ; offset += naddr) { |
| 883 | if (naddr > 0) { | 895 | naddr = collect_netdev_mc_list_addrs(dev, addr, offset, |
| 896 | ARRAY_SIZE(addr)); | ||
| 897 | if (naddr == 0) | ||
| 898 | break; | ||
| 899 | |||
| 884 | ret = t4vf_alloc_mac_filt(pi->adapter, pi->viid, free, | 900 | ret = t4vf_alloc_mac_filt(pi->adapter, pi->viid, free, |
| 885 | naddr, addr, filt_idx, &mhash, sleep); | 901 | naddr, addr, NULL, &mhash, sleep); |
| 886 | if (ret < 0) | 902 | if (ret < 0) |
| 887 | return ret; | 903 | return ret; |
| 904 | free = false; | ||
| 888 | } | 905 | } |
| 889 | 906 | ||
| 890 | return t4vf_set_addr_hash(pi->adapter, pi->viid, uhash != 0, | 907 | return t4vf_set_addr_hash(pi->adapter, pi->viid, uhash != 0, |
| @@ -2252,6 +2269,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
| 2252 | { | 2269 | { |
| 2253 | struct sge *s = &adapter->sge; | 2270 | struct sge *s = &adapter->sge; |
| 2254 | int q10g, n10g, qidx, pidx, qs; | 2271 | int q10g, n10g, qidx, pidx, qs; |
| 2272 | size_t iqe_size; | ||
| 2255 | 2273 | ||
| 2256 | /* | 2274 | /* |
| 2257 | * We should not be called till we know how many Queue Sets we can | 2275 | * We should not be called till we know how many Queue Sets we can |
| @@ -2296,6 +2314,13 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
| 2296 | s->ethqsets = qidx; | 2314 | s->ethqsets = qidx; |
| 2297 | 2315 | ||
| 2298 | /* | 2316 | /* |
| 2317 | * The Ingress Queue Entry Size for our various Response Queues needs | ||
| 2318 | * to be big enough to accommodate the largest message we can receive | ||
| 2319 | * from the chip/firmware; which is 64 bytes ... | ||
| 2320 | */ | ||
| 2321 | iqe_size = 64; | ||
| 2322 | |||
| 2323 | /* | ||
| 2299 | * Set up default Queue Set parameters ... Start off with the | 2324 | * Set up default Queue Set parameters ... Start off with the |
| 2300 | * shortest interrupt holdoff timer. | 2325 | * shortest interrupt holdoff timer. |
| 2301 | */ | 2326 | */ |
| @@ -2303,7 +2328,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
| 2303 | struct sge_eth_rxq *rxq = &s->ethrxq[qs]; | 2328 | struct sge_eth_rxq *rxq = &s->ethrxq[qs]; |
| 2304 | struct sge_eth_txq *txq = &s->ethtxq[qs]; | 2329 | struct sge_eth_txq *txq = &s->ethtxq[qs]; |
| 2305 | 2330 | ||
| 2306 | init_rspq(&rxq->rspq, 0, 0, 1024, L1_CACHE_BYTES); | 2331 | init_rspq(&rxq->rspq, 0, 0, 1024, iqe_size); |
| 2307 | rxq->fl.size = 72; | 2332 | rxq->fl.size = 72; |
| 2308 | txq->q.size = 1024; | 2333 | txq->q.size = 1024; |
| 2309 | } | 2334 | } |
| @@ -2312,8 +2337,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
| 2312 | * The firmware event queue is used for link state changes and | 2337 | * The firmware event queue is used for link state changes and |
| 2313 | * notifications of TX DMA completions. | 2338 | * notifications of TX DMA completions. |
| 2314 | */ | 2339 | */ |
| 2315 | init_rspq(&s->fw_evtq, SGE_TIMER_RSTRT_CNTR, 0, 512, | 2340 | init_rspq(&s->fw_evtq, SGE_TIMER_RSTRT_CNTR, 0, 512, iqe_size); |
| 2316 | L1_CACHE_BYTES); | ||
| 2317 | 2341 | ||
| 2318 | /* | 2342 | /* |
| 2319 | * The forwarded interrupt queue is used when we're in MSI interrupt | 2343 | * The forwarded interrupt queue is used when we're in MSI interrupt |
| @@ -2329,7 +2353,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
| 2329 | * any time ... | 2353 | * any time ... |
| 2330 | */ | 2354 | */ |
| 2331 | init_rspq(&s->intrq, SGE_TIMER_RSTRT_CNTR, 0, MSIX_ENTRIES + 1, | 2355 | init_rspq(&s->intrq, SGE_TIMER_RSTRT_CNTR, 0, MSIX_ENTRIES + 1, |
| 2332 | L1_CACHE_BYTES); | 2356 | iqe_size); |
| 2333 | } | 2357 | } |
| 2334 | 2358 | ||
| 2335 | /* | 2359 | /* |
diff --git a/drivers/net/cxgb4vf/t4vf_hw.c b/drivers/net/cxgb4vf/t4vf_hw.c index e306c20dfaee..19520afe1a12 100644 --- a/drivers/net/cxgb4vf/t4vf_hw.c +++ b/drivers/net/cxgb4vf/t4vf_hw.c | |||
| @@ -1014,48 +1014,72 @@ int t4vf_alloc_mac_filt(struct adapter *adapter, unsigned int viid, bool free, | |||
| 1014 | unsigned int naddr, const u8 **addr, u16 *idx, | 1014 | unsigned int naddr, const u8 **addr, u16 *idx, |
| 1015 | u64 *hash, bool sleep_ok) | 1015 | u64 *hash, bool sleep_ok) |
| 1016 | { | 1016 | { |
| 1017 | int i, ret; | 1017 | int offset, ret = 0; |
| 1018 | unsigned nfilters = 0; | ||
| 1019 | unsigned int rem = naddr; | ||
| 1018 | struct fw_vi_mac_cmd cmd, rpl; | 1020 | struct fw_vi_mac_cmd cmd, rpl; |
| 1019 | struct fw_vi_mac_exact *p; | ||
| 1020 | size_t len16; | ||
| 1021 | 1021 | ||
| 1022 | if (naddr > ARRAY_SIZE(cmd.u.exact)) | 1022 | if (naddr > FW_CLS_TCAM_NUM_ENTRIES) |
| 1023 | return -EINVAL; | 1023 | return -EINVAL; |
| 1024 | len16 = DIV_ROUND_UP(offsetof(struct fw_vi_mac_cmd, | ||
| 1025 | u.exact[naddr]), 16); | ||
| 1026 | 1024 | ||
| 1027 | memset(&cmd, 0, sizeof(cmd)); | 1025 | for (offset = 0; offset < naddr; /**/) { |
| 1028 | cmd.op_to_viid = cpu_to_be32(FW_CMD_OP(FW_VI_MAC_CMD) | | 1026 | unsigned int fw_naddr = (rem < ARRAY_SIZE(cmd.u.exact) |
| 1029 | FW_CMD_REQUEST | | 1027 | ? rem |
| 1030 | FW_CMD_WRITE | | 1028 | : ARRAY_SIZE(cmd.u.exact)); |
| 1031 | (free ? FW_CMD_EXEC : 0) | | 1029 | size_t len16 = DIV_ROUND_UP(offsetof(struct fw_vi_mac_cmd, |
| 1032 | FW_VI_MAC_CMD_VIID(viid)); | 1030 | u.exact[fw_naddr]), 16); |
| 1033 | cmd.freemacs_to_len16 = cpu_to_be32(FW_VI_MAC_CMD_FREEMACS(free) | | 1031 | struct fw_vi_mac_exact *p; |
| 1034 | FW_CMD_LEN16(len16)); | 1032 | int i; |
| 1035 | 1033 | ||
| 1036 | for (i = 0, p = cmd.u.exact; i < naddr; i++, p++) { | 1034 | memset(&cmd, 0, sizeof(cmd)); |
| 1037 | p->valid_to_idx = | 1035 | cmd.op_to_viid = cpu_to_be32(FW_CMD_OP(FW_VI_MAC_CMD) | |
| 1038 | cpu_to_be16(FW_VI_MAC_CMD_VALID | | 1036 | FW_CMD_REQUEST | |
| 1039 | FW_VI_MAC_CMD_IDX(FW_VI_MAC_ADD_MAC)); | 1037 | FW_CMD_WRITE | |
| 1040 | memcpy(p->macaddr, addr[i], sizeof(p->macaddr)); | 1038 | (free ? FW_CMD_EXEC : 0) | |
| 1041 | } | 1039 | FW_VI_MAC_CMD_VIID(viid)); |
| 1040 | cmd.freemacs_to_len16 = | ||
| 1041 | cpu_to_be32(FW_VI_MAC_CMD_FREEMACS(free) | | ||
| 1042 | FW_CMD_LEN16(len16)); | ||
| 1043 | |||
| 1044 | for (i = 0, p = cmd.u.exact; i < fw_naddr; i++, p++) { | ||
| 1045 | p->valid_to_idx = cpu_to_be16( | ||
| 1046 | FW_VI_MAC_CMD_VALID | | ||
| 1047 | FW_VI_MAC_CMD_IDX(FW_VI_MAC_ADD_MAC)); | ||
| 1048 | memcpy(p->macaddr, addr[offset+i], sizeof(p->macaddr)); | ||
| 1049 | } | ||
| 1050 | |||
| 1051 | |||
| 1052 | ret = t4vf_wr_mbox_core(adapter, &cmd, sizeof(cmd), &rpl, | ||
| 1053 | sleep_ok); | ||
| 1054 | if (ret && ret != -ENOMEM) | ||
| 1055 | break; | ||
| 1042 | 1056 | ||
| 1043 | ret = t4vf_wr_mbox_core(adapter, &cmd, sizeof(cmd), &rpl, sleep_ok); | 1057 | for (i = 0, p = rpl.u.exact; i < fw_naddr; i++, p++) { |
| 1044 | if (ret) | 1058 | u16 index = FW_VI_MAC_CMD_IDX_GET( |
| 1045 | return ret; | 1059 | be16_to_cpu(p->valid_to_idx)); |
| 1046 | 1060 | ||
| 1047 | for (i = 0, p = rpl.u.exact; i < naddr; i++, p++) { | 1061 | if (idx) |
| 1048 | u16 index = FW_VI_MAC_CMD_IDX_GET(be16_to_cpu(p->valid_to_idx)); | 1062 | idx[offset+i] = |
| 1049 | 1063 | (index >= FW_CLS_TCAM_NUM_ENTRIES | |
| 1050 | if (idx) | 1064 | ? 0xffff |
| 1051 | idx[i] = (index >= FW_CLS_TCAM_NUM_ENTRIES | 1065 | : index); |
| 1052 | ? 0xffff | 1066 | if (index < FW_CLS_TCAM_NUM_ENTRIES) |
| 1053 | : index); | 1067 | nfilters++; |
| 1054 | if (index < FW_CLS_TCAM_NUM_ENTRIES) | 1068 | else if (hash) |
| 1055 | ret++; | 1069 | *hash |= (1ULL << hash_mac_addr(addr[offset+i])); |
| 1056 | else if (hash) | 1070 | } |
| 1057 | *hash |= (1 << hash_mac_addr(addr[i])); | 1071 | |
| 1072 | free = false; | ||
| 1073 | offset += fw_naddr; | ||
| 1074 | rem -= fw_naddr; | ||
| 1058 | } | 1075 | } |
| 1076 | |||
| 1077 | /* | ||
| 1078 | * If there were no errors or we merely ran out of room in our MAC | ||
| 1079 | * address arena, return the number of filters actually written. | ||
| 1080 | */ | ||
| 1081 | if (ret == 0 || ret == -ENOMEM) | ||
| 1082 | ret = nfilters; | ||
| 1059 | return ret; | 1083 | return ret; |
| 1060 | } | 1084 | } |
| 1061 | 1085 | ||
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c index 75b099ce49c9..1f37ee6b2a26 100644 --- a/drivers/net/ehea/ehea_ethtool.c +++ b/drivers/net/ehea/ehea_ethtool.c | |||
| @@ -261,6 +261,13 @@ static void ehea_get_ethtool_stats(struct net_device *dev, | |||
| 261 | 261 | ||
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | static int ehea_set_flags(struct net_device *dev, u32 data) | ||
| 265 | { | ||
| 266 | return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO | ||
| 267 | | ETH_FLAG_TXVLAN | ||
| 268 | | ETH_FLAG_RXVLAN); | ||
| 269 | } | ||
| 270 | |||
| 264 | const struct ethtool_ops ehea_ethtool_ops = { | 271 | const struct ethtool_ops ehea_ethtool_ops = { |
| 265 | .get_settings = ehea_get_settings, | 272 | .get_settings = ehea_get_settings, |
| 266 | .get_drvinfo = ehea_get_drvinfo, | 273 | .get_drvinfo = ehea_get_drvinfo, |
| @@ -273,6 +280,8 @@ const struct ethtool_ops ehea_ethtool_ops = { | |||
| 273 | .get_ethtool_stats = ehea_get_ethtool_stats, | 280 | .get_ethtool_stats = ehea_get_ethtool_stats, |
| 274 | .get_rx_csum = ehea_get_rx_csum, | 281 | .get_rx_csum = ehea_get_rx_csum, |
| 275 | .set_settings = ehea_set_settings, | 282 | .set_settings = ehea_set_settings, |
| 283 | .get_flags = ethtool_op_get_flags, | ||
| 284 | .set_flags = ehea_set_flags, | ||
| 276 | .nway_reset = ehea_nway_reset, /* Restart autonegotiation */ | 285 | .nway_reset = ehea_nway_reset, /* Restart autonegotiation */ |
| 277 | }; | 286 | }; |
| 278 | 287 | ||
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 182b2a7be8dc..b95f087cd5a9 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
| @@ -400,6 +400,7 @@ static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes) | |||
| 400 | skb_arr_rq1[index] = netdev_alloc_skb(dev, | 400 | skb_arr_rq1[index] = netdev_alloc_skb(dev, |
| 401 | EHEA_L_PKT_SIZE); | 401 | EHEA_L_PKT_SIZE); |
| 402 | if (!skb_arr_rq1[index]) { | 402 | if (!skb_arr_rq1[index]) { |
| 403 | ehea_info("Unable to allocate enough skb in the array\n"); | ||
| 403 | pr->rq1_skba.os_skbs = fill_wqes - i; | 404 | pr->rq1_skba.os_skbs = fill_wqes - i; |
| 404 | break; | 405 | break; |
| 405 | } | 406 | } |
| @@ -422,13 +423,20 @@ static void ehea_init_fill_rq1(struct ehea_port_res *pr, int nr_rq1a) | |||
| 422 | struct net_device *dev = pr->port->netdev; | 423 | struct net_device *dev = pr->port->netdev; |
| 423 | int i; | 424 | int i; |
| 424 | 425 | ||
| 425 | for (i = 0; i < pr->rq1_skba.len; i++) { | 426 | if (nr_rq1a > pr->rq1_skba.len) { |
| 427 | ehea_error("NR_RQ1A bigger than skb array len\n"); | ||
| 428 | return; | ||
| 429 | } | ||
| 430 | |||
| 431 | for (i = 0; i < nr_rq1a; i++) { | ||
| 426 | skb_arr_rq1[i] = netdev_alloc_skb(dev, EHEA_L_PKT_SIZE); | 432 | skb_arr_rq1[i] = netdev_alloc_skb(dev, EHEA_L_PKT_SIZE); |
| 427 | if (!skb_arr_rq1[i]) | 433 | if (!skb_arr_rq1[i]) { |
| 434 | ehea_info("No enough memory to allocate skb array\n"); | ||
| 428 | break; | 435 | break; |
| 436 | } | ||
| 429 | } | 437 | } |
| 430 | /* Ring doorbell */ | 438 | /* Ring doorbell */ |
| 431 | ehea_update_rq1a(pr->qp, nr_rq1a); | 439 | ehea_update_rq1a(pr->qp, i); |
| 432 | } | 440 | } |
| 433 | 441 | ||
| 434 | static int ehea_refill_rq_def(struct ehea_port_res *pr, | 442 | static int ehea_refill_rq_def(struct ehea_port_res *pr, |
| @@ -675,7 +683,7 @@ static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, | |||
| 675 | int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && | 683 | int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && |
| 676 | pr->port->vgrp); | 684 | pr->port->vgrp); |
| 677 | 685 | ||
| 678 | if (use_lro) { | 686 | if (skb->dev->features & NETIF_F_LRO) { |
| 679 | if (vlan_extracted) | 687 | if (vlan_extracted) |
| 680 | lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, | 688 | lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, |
| 681 | pr->port->vgrp, | 689 | pr->port->vgrp, |
| @@ -735,8 +743,10 @@ static int ehea_proc_rwqes(struct net_device *dev, | |||
| 735 | 743 | ||
| 736 | skb = netdev_alloc_skb(dev, | 744 | skb = netdev_alloc_skb(dev, |
| 737 | EHEA_L_PKT_SIZE); | 745 | EHEA_L_PKT_SIZE); |
| 738 | if (!skb) | 746 | if (!skb) { |
| 747 | ehea_info("Not enough memory to allocate skb\n"); | ||
| 739 | break; | 748 | break; |
| 749 | } | ||
| 740 | } | 750 | } |
| 741 | skb_copy_to_linear_data(skb, ((char *)cqe) + 64, | 751 | skb_copy_to_linear_data(skb, ((char *)cqe) + 64, |
| 742 | cqe->num_bytes_transfered - 4); | 752 | cqe->num_bytes_transfered - 4); |
| @@ -777,7 +787,7 @@ static int ehea_proc_rwqes(struct net_device *dev, | |||
| 777 | } | 787 | } |
| 778 | cqe = ehea_poll_rq1(qp, &wqe_index); | 788 | cqe = ehea_poll_rq1(qp, &wqe_index); |
| 779 | } | 789 | } |
| 780 | if (use_lro) | 790 | if (dev->features & NETIF_F_LRO) |
| 781 | lro_flush_all(&pr->lro_mgr); | 791 | lro_flush_all(&pr->lro_mgr); |
| 782 | 792 | ||
| 783 | pr->rx_packets += processed; | 793 | pr->rx_packets += processed; |
| @@ -3268,6 +3278,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | |||
| 3268 | | NETIF_F_LLTX; | 3278 | | NETIF_F_LLTX; |
| 3269 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; | 3279 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; |
| 3270 | 3280 | ||
| 3281 | if (use_lro) | ||
| 3282 | dev->features |= NETIF_F_LRO; | ||
| 3283 | |||
| 3271 | INIT_WORK(&port->reset_task, ehea_reset_port); | 3284 | INIT_WORK(&port->reset_task, ehea_reset_port); |
| 3272 | 3285 | ||
| 3273 | ret = register_netdev(dev); | 3286 | ret = register_netdev(dev); |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index a466ef91dd43..aa28b270c045 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
| @@ -1962,7 +1962,8 @@ static void enic_poll_controller(struct net_device *netdev) | |||
| 1962 | case VNIC_DEV_INTR_MODE_MSIX: | 1962 | case VNIC_DEV_INTR_MODE_MSIX: |
| 1963 | for (i = 0; i < enic->rq_count; i++) { | 1963 | for (i = 0; i < enic->rq_count; i++) { |
| 1964 | intr = enic_msix_rq_intr(enic, i); | 1964 | intr = enic_msix_rq_intr(enic, i); |
| 1965 | enic_isr_msix_rq(enic->msix_entry[intr].vector, enic); | 1965 | enic_isr_msix_rq(enic->msix_entry[intr].vector, |
| 1966 | &enic->napi[i]); | ||
| 1966 | } | 1967 | } |
| 1967 | intr = enic_msix_wq_intr(enic, i); | 1968 | intr = enic_msix_wq_intr(enic, i); |
| 1968 | enic_isr_msix_wq(enic->msix_entry[intr].vector, enic); | 1969 | enic_isr_msix_wq(enic->msix_entry[intr].vector, enic); |
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index ab9f675c5b8b..fe337bd121aa 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
| @@ -104,6 +104,8 @@ static void ri_tasklet(unsigned long dev) | |||
| 104 | rcu_read_unlock(); | 104 | rcu_read_unlock(); |
| 105 | dev_kfree_skb(skb); | 105 | dev_kfree_skb(skb); |
| 106 | stats->tx_dropped++; | 106 | stats->tx_dropped++; |
| 107 | if (skb_queue_len(&dp->tq) != 0) | ||
| 108 | goto resched; | ||
| 107 | break; | 109 | break; |
| 108 | } | 110 | } |
| 109 | rcu_read_unlock(); | 111 | rcu_read_unlock(); |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index fbad4d819608..eee0b298bd36 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
| @@ -4771,6 +4771,9 @@ void ixgbe_clear_interrupt_scheme(struct ixgbe_adapter *adapter) | |||
| 4771 | adapter->rx_ring[i] = NULL; | 4771 | adapter->rx_ring[i] = NULL; |
| 4772 | } | 4772 | } |
| 4773 | 4773 | ||
| 4774 | adapter->num_tx_queues = 0; | ||
| 4775 | adapter->num_rx_queues = 0; | ||
| 4776 | |||
| 4774 | ixgbe_free_q_vectors(adapter); | 4777 | ixgbe_free_q_vectors(adapter); |
| 4775 | ixgbe_reset_interrupt_capability(adapter); | 4778 | ixgbe_reset_interrupt_capability(adapter); |
| 4776 | } | 4779 | } |
diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c index 472056b47440..03a1d280105f 100644 --- a/drivers/net/pch_gbe/pch_gbe_main.c +++ b/drivers/net/pch_gbe/pch_gbe_main.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 1999 - 2010 Intel Corporation. | 2 | * Copyright (C) 1999 - 2010 Intel Corporation. |
| 3 | * Copyright (C) 2010 OKI SEMICONDUCTOR Co., LTD. | 3 | * Copyright (C) 2010 OKI SEMICONDUCTOR CO., LTD. |
| 4 | * | 4 | * |
| 5 | * This code was derived from the Intel e1000e Linux driver. | 5 | * This code was derived from the Intel e1000e Linux driver. |
| 6 | * | 6 | * |
| @@ -2464,8 +2464,8 @@ static void __exit pch_gbe_exit_module(void) | |||
| 2464 | module_init(pch_gbe_init_module); | 2464 | module_init(pch_gbe_init_module); |
| 2465 | module_exit(pch_gbe_exit_module); | 2465 | module_exit(pch_gbe_exit_module); |
| 2466 | 2466 | ||
| 2467 | MODULE_DESCRIPTION("OKI semiconductor PCH Gigabit ethernet Driver"); | 2467 | MODULE_DESCRIPTION("EG20T PCH Gigabit ethernet Driver"); |
| 2468 | MODULE_AUTHOR("OKI semiconductor, <masa-korg@dsn.okisemi.com>"); | 2468 | MODULE_AUTHOR("OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com>"); |
| 2469 | MODULE_LICENSE("GPL"); | 2469 | MODULE_LICENSE("GPL"); |
| 2470 | MODULE_VERSION(DRV_VERSION); | 2470 | MODULE_VERSION(DRV_VERSION); |
| 2471 | MODULE_DEVICE_TABLE(pci, pch_gbe_pcidev_id); | 2471 | MODULE_DEVICE_TABLE(pci, pch_gbe_pcidev_id); |
diff --git a/drivers/net/pch_gbe/pch_gbe_param.c b/drivers/net/pch_gbe/pch_gbe_param.c index 2510146fc560..ef0996a0eaaa 100644 --- a/drivers/net/pch_gbe/pch_gbe_param.c +++ b/drivers/net/pch_gbe/pch_gbe_param.c | |||
| @@ -434,8 +434,8 @@ void pch_gbe_check_options(struct pch_gbe_adapter *adapter) | |||
| 434 | .err = "using default of " | 434 | .err = "using default of " |
| 435 | __MODULE_STRING(PCH_GBE_DEFAULT_TXD), | 435 | __MODULE_STRING(PCH_GBE_DEFAULT_TXD), |
| 436 | .def = PCH_GBE_DEFAULT_TXD, | 436 | .def = PCH_GBE_DEFAULT_TXD, |
| 437 | .arg = { .r = { .min = PCH_GBE_MIN_TXD } }, | 437 | .arg = { .r = { .min = PCH_GBE_MIN_TXD, |
| 438 | .arg = { .r = { .max = PCH_GBE_MAX_TXD } } | 438 | .max = PCH_GBE_MAX_TXD } } |
| 439 | }; | 439 | }; |
| 440 | struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring; | 440 | struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring; |
| 441 | tx_ring->count = TxDescriptors; | 441 | tx_ring->count = TxDescriptors; |
| @@ -450,8 +450,8 @@ void pch_gbe_check_options(struct pch_gbe_adapter *adapter) | |||
| 450 | .err = "using default of " | 450 | .err = "using default of " |
| 451 | __MODULE_STRING(PCH_GBE_DEFAULT_RXD), | 451 | __MODULE_STRING(PCH_GBE_DEFAULT_RXD), |
| 452 | .def = PCH_GBE_DEFAULT_RXD, | 452 | .def = PCH_GBE_DEFAULT_RXD, |
| 453 | .arg = { .r = { .min = PCH_GBE_MIN_RXD } }, | 453 | .arg = { .r = { .min = PCH_GBE_MIN_RXD, |
| 454 | .arg = { .r = { .max = PCH_GBE_MAX_RXD } } | 454 | .max = PCH_GBE_MAX_RXD } } |
| 455 | }; | 455 | }; |
| 456 | struct pch_gbe_rx_ring *rx_ring = adapter->rx_ring; | 456 | struct pch_gbe_rx_ring *rx_ring = adapter->rx_ring; |
| 457 | rx_ring->count = RxDescriptors; | 457 | rx_ring->count = RxDescriptors; |
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index cb3d13e4e074..35fda5ac8120 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig | |||
| @@ -64,7 +64,7 @@ config BCM63XX_PHY | |||
| 64 | config ICPLUS_PHY | 64 | config ICPLUS_PHY |
| 65 | tristate "Drivers for ICPlus PHYs" | 65 | tristate "Drivers for ICPlus PHYs" |
| 66 | ---help--- | 66 | ---help--- |
| 67 | Currently supports the IP175C PHY. | 67 | Currently supports the IP175C and IP1001 PHYs. |
| 68 | 68 | ||
| 69 | config REALTEK_PHY | 69 | config REALTEK_PHY |
| 70 | tristate "Drivers for Realtek PHYs" | 70 | tristate "Drivers for Realtek PHYs" |
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index c1d2d251fe8b..9a09e24c30bc 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c | |||
| @@ -30,7 +30,7 @@ | |||
| 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 PHY driver"); | 33 | MODULE_DESCRIPTION("ICPlus IP175C/IC1001 PHY drivers"); |
| 34 | MODULE_AUTHOR("Michael Barkowski"); | 34 | MODULE_AUTHOR("Michael Barkowski"); |
| 35 | MODULE_LICENSE("GPL"); | 35 | MODULE_LICENSE("GPL"); |
| 36 | 36 | ||
| @@ -89,6 +89,33 @@ static int ip175c_config_init(struct phy_device *phydev) | |||
| 89 | return 0; | 89 | return 0; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | static int ip1001_config_init(struct phy_device *phydev) | ||
| 93 | { | ||
| 94 | int err, value; | ||
| 95 | |||
| 96 | /* Software Reset PHY */ | ||
| 97 | value = phy_read(phydev, MII_BMCR); | ||
| 98 | value |= BMCR_RESET; | ||
| 99 | err = phy_write(phydev, MII_BMCR, value); | ||
| 100 | if (err < 0) | ||
| 101 | return err; | ||
| 102 | |||
| 103 | do { | ||
| 104 | value = phy_read(phydev, MII_BMCR); | ||
| 105 | } while (value & BMCR_RESET); | ||
| 106 | |||
| 107 | /* Additional delay (2ns) used to adjust RX clock phase | ||
| 108 | * at GMII/ RGMII interface */ | ||
| 109 | value = phy_read(phydev, 16); | ||
| 110 | value |= 0x3; | ||
| 111 | |||
| 112 | err = phy_write(phydev, 16, value); | ||
| 113 | if (err < 0) | ||
| 114 | return err; | ||
| 115 | |||
| 116 | return err; | ||
| 117 | } | ||
| 118 | |||
| 92 | static int ip175c_read_status(struct phy_device *phydev) | 119 | static int ip175c_read_status(struct phy_device *phydev) |
| 93 | { | 120 | { |
| 94 | if (phydev->addr == 4) /* WAN port */ | 121 | if (phydev->addr == 4) /* WAN port */ |
| @@ -121,21 +148,43 @@ static struct phy_driver ip175c_driver = { | |||
| 121 | .driver = { .owner = THIS_MODULE,}, | 148 | .driver = { .owner = THIS_MODULE,}, |
| 122 | }; | 149 | }; |
| 123 | 150 | ||
| 124 | static int __init ip175c_init(void) | 151 | static struct phy_driver ip1001_driver = { |
| 152 | .phy_id = 0x02430d90, | ||
| 153 | .name = "ICPlus IP1001", | ||
| 154 | .phy_id_mask = 0x0ffffff0, | ||
| 155 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | | ||
| 156 | SUPPORTED_Asym_Pause, | ||
| 157 | .config_init = &ip1001_config_init, | ||
| 158 | .config_aneg = &genphy_config_aneg, | ||
| 159 | .read_status = &genphy_read_status, | ||
| 160 | .suspend = genphy_suspend, | ||
| 161 | .resume = genphy_resume, | ||
| 162 | .driver = { .owner = THIS_MODULE,}, | ||
| 163 | }; | ||
| 164 | |||
| 165 | static int __init icplus_init(void) | ||
| 125 | { | 166 | { |
| 167 | int ret = 0; | ||
| 168 | |||
| 169 | ret = phy_driver_register(&ip1001_driver); | ||
| 170 | if (ret < 0) | ||
| 171 | return -ENODEV; | ||
| 172 | |||
| 126 | return phy_driver_register(&ip175c_driver); | 173 | return phy_driver_register(&ip175c_driver); |
| 127 | } | 174 | } |
| 128 | 175 | ||
| 129 | static void __exit ip175c_exit(void) | 176 | static void __exit icplus_exit(void) |
| 130 | { | 177 | { |
| 178 | phy_driver_unregister(&ip1001_driver); | ||
| 131 | phy_driver_unregister(&ip175c_driver); | 179 | phy_driver_unregister(&ip175c_driver); |
| 132 | } | 180 | } |
| 133 | 181 | ||
| 134 | module_init(ip175c_init); | 182 | module_init(icplus_init); |
| 135 | module_exit(ip175c_exit); | 183 | module_exit(icplus_exit); |
| 136 | 184 | ||
| 137 | static struct mdio_device_id __maybe_unused icplus_tbl[] = { | 185 | static struct mdio_device_id __maybe_unused icplus_tbl[] = { |
| 138 | { 0x02430d80, 0x0ffffff0 }, | 186 | { 0x02430d80, 0x0ffffff0 }, |
| 187 | { 0x02430d90, 0x0ffffff0 }, | ||
| 139 | { } | 188 | { } |
| 140 | }; | 189 | }; |
| 141 | 190 | ||
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 09cf56d0416a..39659976a1ac 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
| @@ -2584,16 +2584,16 @@ ppp_create_interface(struct net *net, int unit, int *retp) | |||
| 2584 | */ | 2584 | */ |
| 2585 | dev_net_set(dev, net); | 2585 | dev_net_set(dev, net); |
| 2586 | 2586 | ||
| 2587 | ret = -EEXIST; | ||
| 2588 | mutex_lock(&pn->all_ppp_mutex); | 2587 | mutex_lock(&pn->all_ppp_mutex); |
| 2589 | 2588 | ||
| 2590 | if (unit < 0) { | 2589 | if (unit < 0) { |
| 2591 | unit = unit_get(&pn->units_idr, ppp); | 2590 | unit = unit_get(&pn->units_idr, ppp); |
| 2592 | if (unit < 0) { | 2591 | if (unit < 0) { |
| 2593 | *retp = unit; | 2592 | ret = unit; |
| 2594 | goto out2; | 2593 | goto out2; |
| 2595 | } | 2594 | } |
| 2596 | } else { | 2595 | } else { |
| 2596 | ret = -EEXIST; | ||
| 2597 | if (unit_find(&pn->units_idr, unit)) | 2597 | if (unit_find(&pn->units_idr, unit)) |
| 2598 | goto out2; /* unit already exists */ | 2598 | goto out2; /* unit already exists */ |
| 2599 | /* | 2599 | /* |
| @@ -2668,10 +2668,10 @@ static void ppp_shutdown_interface(struct ppp *ppp) | |||
| 2668 | ppp->closing = 1; | 2668 | ppp->closing = 1; |
| 2669 | ppp_unlock(ppp); | 2669 | ppp_unlock(ppp); |
| 2670 | unregister_netdev(ppp->dev); | 2670 | unregister_netdev(ppp->dev); |
| 2671 | unit_put(&pn->units_idr, ppp->file.index); | ||
| 2671 | } else | 2672 | } else |
| 2672 | ppp_unlock(ppp); | 2673 | ppp_unlock(ppp); |
| 2673 | 2674 | ||
| 2674 | unit_put(&pn->units_idr, ppp->file.index); | ||
| 2675 | ppp->file.dead = 1; | 2675 | ppp->file.dead = 1; |
| 2676 | ppp->owner = NULL; | 2676 | ppp->owner = NULL; |
| 2677 | wake_up_interruptible(&ppp->file.rwait); | 2677 | wake_up_interruptible(&ppp->file.rwait); |
| @@ -2859,8 +2859,7 @@ static void __exit ppp_cleanup(void) | |||
| 2859 | * by holding all_ppp_mutex | 2859 | * by holding all_ppp_mutex |
| 2860 | */ | 2860 | */ |
| 2861 | 2861 | ||
| 2862 | /* associate pointer with specified number */ | 2862 | static int __unit_alloc(struct idr *p, void *ptr, int n) |
| 2863 | static int unit_set(struct idr *p, void *ptr, int n) | ||
| 2864 | { | 2863 | { |
| 2865 | int unit, err; | 2864 | int unit, err; |
| 2866 | 2865 | ||
| @@ -2871,10 +2870,24 @@ again: | |||
| 2871 | } | 2870 | } |
| 2872 | 2871 | ||
| 2873 | err = idr_get_new_above(p, ptr, n, &unit); | 2872 | err = idr_get_new_above(p, ptr, n, &unit); |
| 2874 | if (err == -EAGAIN) | 2873 | if (err < 0) { |
| 2875 | goto again; | 2874 | if (err == -EAGAIN) |
| 2875 | goto again; | ||
| 2876 | return err; | ||
| 2877 | } | ||
| 2878 | |||
| 2879 | return unit; | ||
| 2880 | } | ||
| 2881 | |||
| 2882 | /* associate pointer with specified number */ | ||
| 2883 | static int unit_set(struct idr *p, void *ptr, int n) | ||
| 2884 | { | ||
| 2885 | int unit; | ||
| 2876 | 2886 | ||
| 2877 | if (unit != n) { | 2887 | unit = __unit_alloc(p, ptr, n); |
| 2888 | if (unit < 0) | ||
| 2889 | return unit; | ||
| 2890 | else if (unit != n) { | ||
| 2878 | idr_remove(p, unit); | 2891 | idr_remove(p, unit); |
| 2879 | return -EINVAL; | 2892 | return -EINVAL; |
| 2880 | } | 2893 | } |
| @@ -2885,19 +2898,7 @@ again: | |||
| 2885 | /* get new free unit number and associate pointer with it */ | 2898 | /* get new free unit number and associate pointer with it */ |
| 2886 | static int unit_get(struct idr *p, void *ptr) | 2899 | static int unit_get(struct idr *p, void *ptr) |
| 2887 | { | 2900 | { |
| 2888 | int unit, err; | 2901 | return __unit_alloc(p, ptr, 0); |
| 2889 | |||
| 2890 | again: | ||
| 2891 | if (!idr_pre_get(p, GFP_KERNEL)) { | ||
| 2892 | printk(KERN_ERR "PPP: No free memory for idr\n"); | ||
| 2893 | return -ENOMEM; | ||
| 2894 | } | ||
| 2895 | |||
| 2896 | err = idr_get_new_above(p, ptr, 0, &unit); | ||
| 2897 | if (err == -EAGAIN) | ||
| 2898 | goto again; | ||
| 2899 | |||
| 2900 | return unit; | ||
| 2901 | } | 2902 | } |
| 2902 | 2903 | ||
| 2903 | /* put unit number back to a pool */ | 2904 | /* put unit number back to a pool */ |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 7d33ef4bcb4a..53b13deade95 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
| @@ -744,26 +744,36 @@ static void rtl8169_xmii_reset_enable(void __iomem *ioaddr) | |||
| 744 | mdio_write(ioaddr, MII_BMCR, val & 0xffff); | 744 | mdio_write(ioaddr, MII_BMCR, val & 0xffff); |
| 745 | } | 745 | } |
| 746 | 746 | ||
| 747 | static void rtl8169_check_link_status(struct net_device *dev, | 747 | static void __rtl8169_check_link_status(struct net_device *dev, |
| 748 | struct rtl8169_private *tp, | 748 | struct rtl8169_private *tp, |
| 749 | void __iomem *ioaddr) | 749 | void __iomem *ioaddr, |
| 750 | bool pm) | ||
| 750 | { | 751 | { |
| 751 | unsigned long flags; | 752 | unsigned long flags; |
| 752 | 753 | ||
| 753 | spin_lock_irqsave(&tp->lock, flags); | 754 | spin_lock_irqsave(&tp->lock, flags); |
| 754 | if (tp->link_ok(ioaddr)) { | 755 | if (tp->link_ok(ioaddr)) { |
| 755 | /* This is to cancel a scheduled suspend if there's one. */ | 756 | /* This is to cancel a scheduled suspend if there's one. */ |
| 756 | pm_request_resume(&tp->pci_dev->dev); | 757 | if (pm) |
| 758 | pm_request_resume(&tp->pci_dev->dev); | ||
| 757 | netif_carrier_on(dev); | 759 | netif_carrier_on(dev); |
| 758 | netif_info(tp, ifup, dev, "link up\n"); | 760 | netif_info(tp, ifup, dev, "link up\n"); |
| 759 | } else { | 761 | } else { |
| 760 | netif_carrier_off(dev); | 762 | netif_carrier_off(dev); |
| 761 | netif_info(tp, ifdown, dev, "link down\n"); | 763 | netif_info(tp, ifdown, dev, "link down\n"); |
| 762 | pm_schedule_suspend(&tp->pci_dev->dev, 100); | 764 | if (pm) |
| 765 | pm_schedule_suspend(&tp->pci_dev->dev, 100); | ||
| 763 | } | 766 | } |
| 764 | spin_unlock_irqrestore(&tp->lock, flags); | 767 | spin_unlock_irqrestore(&tp->lock, flags); |
| 765 | } | 768 | } |
| 766 | 769 | ||
| 770 | static void rtl8169_check_link_status(struct net_device *dev, | ||
| 771 | struct rtl8169_private *tp, | ||
| 772 | void __iomem *ioaddr) | ||
| 773 | { | ||
| 774 | __rtl8169_check_link_status(dev, tp, ioaddr, false); | ||
| 775 | } | ||
| 776 | |||
| 767 | #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST) | 777 | #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST) |
| 768 | 778 | ||
| 769 | static u32 __rtl8169_get_wol(struct rtl8169_private *tp) | 779 | static u32 __rtl8169_get_wol(struct rtl8169_private *tp) |
| @@ -4600,7 +4610,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
| 4600 | } | 4610 | } |
| 4601 | 4611 | ||
| 4602 | if (status & LinkChg) | 4612 | if (status & LinkChg) |
| 4603 | rtl8169_check_link_status(dev, tp, ioaddr); | 4613 | __rtl8169_check_link_status(dev, tp, ioaddr, true); |
| 4604 | 4614 | ||
| 4605 | /* We need to see the lastest version of tp->intr_mask to | 4615 | /* We need to see the lastest version of tp->intr_mask to |
| 4606 | * avoid ignoring an MSI interrupt and having to wait for | 4616 | * avoid ignoring an MSI interrupt and having to wait for |
| @@ -4890,11 +4900,7 @@ static int rtl8169_runtime_idle(struct device *device) | |||
| 4890 | struct net_device *dev = pci_get_drvdata(pdev); | 4900 | struct net_device *dev = pci_get_drvdata(pdev); |
| 4891 | struct rtl8169_private *tp = netdev_priv(dev); | 4901 | struct rtl8169_private *tp = netdev_priv(dev); |
| 4892 | 4902 | ||
| 4893 | if (!tp->TxDescArray) | 4903 | return tp->TxDescArray ? -EBUSY : 0; |
| 4894 | return 0; | ||
| 4895 | |||
| 4896 | rtl8169_check_link_status(dev, tp, tp->mmio_addr); | ||
| 4897 | return -EBUSY; | ||
| 4898 | } | 4904 | } |
| 4899 | 4905 | ||
| 4900 | static const struct dev_pm_ops rtl8169_pm_ops = { | 4906 | static const struct dev_pm_ops rtl8169_pm_ops = { |
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 05df20e47976..fb83cdd94643 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
| @@ -197,7 +197,9 @@ MODULE_PARM_DESC(debug, "Bitmapped debugging message enable value"); | |||
| 197 | 197 | ||
| 198 | static void efx_remove_channels(struct efx_nic *efx); | 198 | static void efx_remove_channels(struct efx_nic *efx); |
| 199 | static void efx_remove_port(struct efx_nic *efx); | 199 | static void efx_remove_port(struct efx_nic *efx); |
| 200 | static void efx_init_napi(struct efx_nic *efx); | ||
| 200 | static void efx_fini_napi(struct efx_nic *efx); | 201 | static void efx_fini_napi(struct efx_nic *efx); |
| 202 | static void efx_fini_napi_channel(struct efx_channel *channel); | ||
| 201 | static void efx_fini_struct(struct efx_nic *efx); | 203 | static void efx_fini_struct(struct efx_nic *efx); |
| 202 | static void efx_start_all(struct efx_nic *efx); | 204 | static void efx_start_all(struct efx_nic *efx); |
| 203 | static void efx_stop_all(struct efx_nic *efx); | 205 | static void efx_stop_all(struct efx_nic *efx); |
| @@ -335,8 +337,10 @@ void efx_process_channel_now(struct efx_channel *channel) | |||
| 335 | 337 | ||
| 336 | /* Disable interrupts and wait for ISRs to complete */ | 338 | /* Disable interrupts and wait for ISRs to complete */ |
| 337 | efx_nic_disable_interrupts(efx); | 339 | efx_nic_disable_interrupts(efx); |
| 338 | if (efx->legacy_irq) | 340 | if (efx->legacy_irq) { |
| 339 | synchronize_irq(efx->legacy_irq); | 341 | synchronize_irq(efx->legacy_irq); |
| 342 | efx->legacy_irq_enabled = false; | ||
| 343 | } | ||
| 340 | if (channel->irq) | 344 | if (channel->irq) |
| 341 | synchronize_irq(channel->irq); | 345 | synchronize_irq(channel->irq); |
| 342 | 346 | ||
| @@ -351,6 +355,8 @@ void efx_process_channel_now(struct efx_channel *channel) | |||
| 351 | efx_channel_processed(channel); | 355 | efx_channel_processed(channel); |
| 352 | 356 | ||
| 353 | napi_enable(&channel->napi_str); | 357 | napi_enable(&channel->napi_str); |
| 358 | if (efx->legacy_irq) | ||
| 359 | efx->legacy_irq_enabled = true; | ||
| 354 | efx_nic_enable_interrupts(efx); | 360 | efx_nic_enable_interrupts(efx); |
| 355 | } | 361 | } |
| 356 | 362 | ||
| @@ -426,6 +432,7 @@ efx_alloc_channel(struct efx_nic *efx, int i, struct efx_channel *old_channel) | |||
| 426 | 432 | ||
| 427 | *channel = *old_channel; | 433 | *channel = *old_channel; |
| 428 | 434 | ||
| 435 | channel->napi_dev = NULL; | ||
| 429 | memset(&channel->eventq, 0, sizeof(channel->eventq)); | 436 | memset(&channel->eventq, 0, sizeof(channel->eventq)); |
| 430 | 437 | ||
| 431 | rx_queue = &channel->rx_queue; | 438 | rx_queue = &channel->rx_queue; |
| @@ -736,9 +743,13 @@ efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries) | |||
| 736 | if (rc) | 743 | if (rc) |
| 737 | goto rollback; | 744 | goto rollback; |
| 738 | 745 | ||
| 746 | efx_init_napi(efx); | ||
| 747 | |||
| 739 | /* Destroy old channels */ | 748 | /* Destroy old channels */ |
| 740 | for (i = 0; i < efx->n_channels; i++) | 749 | for (i = 0; i < efx->n_channels; i++) { |
| 750 | efx_fini_napi_channel(other_channel[i]); | ||
| 741 | efx_remove_channel(other_channel[i]); | 751 | efx_remove_channel(other_channel[i]); |
| 752 | } | ||
| 742 | out: | 753 | out: |
| 743 | /* Free unused channel structures */ | 754 | /* Free unused channel structures */ |
| 744 | for (i = 0; i < efx->n_channels; i++) | 755 | for (i = 0; i < efx->n_channels; i++) |
| @@ -1400,6 +1411,8 @@ static void efx_start_all(struct efx_nic *efx) | |||
| 1400 | efx_start_channel(channel); | 1411 | efx_start_channel(channel); |
| 1401 | } | 1412 | } |
| 1402 | 1413 | ||
| 1414 | if (efx->legacy_irq) | ||
| 1415 | efx->legacy_irq_enabled = true; | ||
| 1403 | efx_nic_enable_interrupts(efx); | 1416 | efx_nic_enable_interrupts(efx); |
| 1404 | 1417 | ||
| 1405 | /* Switch to event based MCDI completions after enabling interrupts. | 1418 | /* Switch to event based MCDI completions after enabling interrupts. |
| @@ -1460,8 +1473,10 @@ static void efx_stop_all(struct efx_nic *efx) | |||
| 1460 | 1473 | ||
| 1461 | /* Disable interrupts and wait for ISR to complete */ | 1474 | /* Disable interrupts and wait for ISR to complete */ |
| 1462 | efx_nic_disable_interrupts(efx); | 1475 | efx_nic_disable_interrupts(efx); |
| 1463 | if (efx->legacy_irq) | 1476 | if (efx->legacy_irq) { |
| 1464 | synchronize_irq(efx->legacy_irq); | 1477 | synchronize_irq(efx->legacy_irq); |
| 1478 | efx->legacy_irq_enabled = false; | ||
| 1479 | } | ||
| 1465 | efx_for_each_channel(channel, efx) { | 1480 | efx_for_each_channel(channel, efx) { |
| 1466 | if (channel->irq) | 1481 | if (channel->irq) |
| 1467 | synchronize_irq(channel->irq); | 1482 | synchronize_irq(channel->irq); |
| @@ -1593,7 +1608,7 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd) | |||
| 1593 | * | 1608 | * |
| 1594 | **************************************************************************/ | 1609 | **************************************************************************/ |
| 1595 | 1610 | ||
| 1596 | static int efx_init_napi(struct efx_nic *efx) | 1611 | static void efx_init_napi(struct efx_nic *efx) |
| 1597 | { | 1612 | { |
| 1598 | struct efx_channel *channel; | 1613 | struct efx_channel *channel; |
| 1599 | 1614 | ||
| @@ -1602,18 +1617,21 @@ static int efx_init_napi(struct efx_nic *efx) | |||
| 1602 | netif_napi_add(channel->napi_dev, &channel->napi_str, | 1617 | netif_napi_add(channel->napi_dev, &channel->napi_str, |
| 1603 | efx_poll, napi_weight); | 1618 | efx_poll, napi_weight); |
| 1604 | } | 1619 | } |
| 1605 | return 0; | 1620 | } |
| 1621 | |||
| 1622 | static void efx_fini_napi_channel(struct efx_channel *channel) | ||
| 1623 | { | ||
| 1624 | if (channel->napi_dev) | ||
| 1625 | netif_napi_del(&channel->napi_str); | ||
| 1626 | channel->napi_dev = NULL; | ||
| 1606 | } | 1627 | } |
| 1607 | 1628 | ||
| 1608 | static void efx_fini_napi(struct efx_nic *efx) | 1629 | static void efx_fini_napi(struct efx_nic *efx) |
| 1609 | { | 1630 | { |
| 1610 | struct efx_channel *channel; | 1631 | struct efx_channel *channel; |
| 1611 | 1632 | ||
| 1612 | efx_for_each_channel(channel, efx) { | 1633 | efx_for_each_channel(channel, efx) |
| 1613 | if (channel->napi_dev) | 1634 | efx_fini_napi_channel(channel); |
| 1614 | netif_napi_del(&channel->napi_str); | ||
| 1615 | channel->napi_dev = NULL; | ||
| 1616 | } | ||
| 1617 | } | 1635 | } |
| 1618 | 1636 | ||
| 1619 | /************************************************************************** | 1637 | /************************************************************************** |
| @@ -2335,9 +2353,7 @@ static int efx_pci_probe_main(struct efx_nic *efx) | |||
| 2335 | if (rc) | 2353 | if (rc) |
| 2336 | goto fail1; | 2354 | goto fail1; |
| 2337 | 2355 | ||
| 2338 | rc = efx_init_napi(efx); | 2356 | efx_init_napi(efx); |
| 2339 | if (rc) | ||
| 2340 | goto fail2; | ||
| 2341 | 2357 | ||
| 2342 | rc = efx->type->init(efx); | 2358 | rc = efx->type->init(efx); |
| 2343 | if (rc) { | 2359 | if (rc) { |
| @@ -2368,7 +2384,6 @@ static int efx_pci_probe_main(struct efx_nic *efx) | |||
| 2368 | efx->type->fini(efx); | 2384 | efx->type->fini(efx); |
| 2369 | fail3: | 2385 | fail3: |
| 2370 | efx_fini_napi(efx); | 2386 | efx_fini_napi(efx); |
| 2371 | fail2: | ||
| 2372 | efx_remove_all(efx); | 2387 | efx_remove_all(efx); |
| 2373 | fail1: | 2388 | fail1: |
| 2374 | return rc; | 2389 | return rc; |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 0a7e26d73b52..b137c889152b 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
| @@ -621,6 +621,7 @@ struct efx_filter_state; | |||
| 621 | * @pci_dev: The PCI device | 621 | * @pci_dev: The PCI device |
| 622 | * @type: Controller type attributes | 622 | * @type: Controller type attributes |
| 623 | * @legacy_irq: IRQ number | 623 | * @legacy_irq: IRQ number |
| 624 | * @legacy_irq_enabled: Are IRQs enabled on NIC (INT_EN_KER register)? | ||
| 624 | * @workqueue: Workqueue for port reconfigures and the HW monitor. | 625 | * @workqueue: Workqueue for port reconfigures and the HW monitor. |
| 625 | * Work items do not hold and must not acquire RTNL. | 626 | * Work items do not hold and must not acquire RTNL. |
| 626 | * @workqueue_name: Name of workqueue | 627 | * @workqueue_name: Name of workqueue |
| @@ -709,6 +710,7 @@ struct efx_nic { | |||
| 709 | struct pci_dev *pci_dev; | 710 | struct pci_dev *pci_dev; |
| 710 | const struct efx_nic_type *type; | 711 | const struct efx_nic_type *type; |
| 711 | int legacy_irq; | 712 | int legacy_irq; |
| 713 | bool legacy_irq_enabled; | ||
| 712 | struct workqueue_struct *workqueue; | 714 | struct workqueue_struct *workqueue; |
| 713 | char workqueue_name[16]; | 715 | char workqueue_name[16]; |
| 714 | struct work_struct reset_work; | 716 | struct work_struct reset_work; |
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c index 41c36b9a4244..67cb0c96838c 100644 --- a/drivers/net/sfc/nic.c +++ b/drivers/net/sfc/nic.c | |||
| @@ -1418,6 +1418,12 @@ static irqreturn_t efx_legacy_interrupt(int irq, void *dev_id) | |||
| 1418 | u32 queues; | 1418 | u32 queues; |
| 1419 | int syserr; | 1419 | int syserr; |
| 1420 | 1420 | ||
| 1421 | /* Could this be ours? If interrupts are disabled then the | ||
| 1422 | * channel state may not be valid. | ||
| 1423 | */ | ||
| 1424 | if (!efx->legacy_irq_enabled) | ||
| 1425 | return result; | ||
| 1426 | |||
| 1421 | /* Read the ISR which also ACKs the interrupts */ | 1427 | /* Read the ISR which also ACKs the interrupts */ |
| 1422 | efx_readd(efx, ®, FR_BZ_INT_ISR0); | 1428 | efx_readd(efx, ®, FR_BZ_INT_ISR0); |
| 1423 | queues = EFX_EXTRACT_DWORD(reg, 0, 31); | 1429 | queues = EFX_EXTRACT_DWORD(reg, 0, 31); |
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index 06bc6034ce81..2114837809e7 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
| @@ -1509,6 +1509,8 @@ static int stmmac_probe(struct net_device *dev) | |||
| 1509 | pr_warning("\tno valid MAC address;" | 1509 | pr_warning("\tno valid MAC address;" |
| 1510 | "please, use ifconfig or nwhwconfig!\n"); | 1510 | "please, use ifconfig or nwhwconfig!\n"); |
| 1511 | 1511 | ||
| 1512 | spin_lock_init(&priv->lock); | ||
| 1513 | |||
| 1512 | ret = register_netdev(dev); | 1514 | ret = register_netdev(dev); |
| 1513 | if (ret) { | 1515 | if (ret) { |
| 1514 | pr_err("%s: ERROR %i registering the device\n", | 1516 | pr_err("%s: ERROR %i registering the device\n", |
| @@ -1520,8 +1522,6 @@ static int stmmac_probe(struct net_device *dev) | |||
| 1520 | dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", | 1522 | dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", |
| 1521 | (dev->features & NETIF_F_HW_CSUM) ? "on" : "off"); | 1523 | (dev->features & NETIF_F_HW_CSUM) ? "on" : "off"); |
| 1522 | 1524 | ||
| 1523 | spin_lock_init(&priv->lock); | ||
| 1524 | |||
| 1525 | return ret; | 1525 | return ret; |
| 1526 | } | 1526 | } |
| 1527 | 1527 | ||
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index a9f7d5d1a269..7064e035757a 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
| @@ -688,9 +688,6 @@ static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb, | |||
| 688 | 688 | ||
| 689 | DMFE_DBUG(0, "dmfe_start_xmit", 0); | 689 | DMFE_DBUG(0, "dmfe_start_xmit", 0); |
| 690 | 690 | ||
| 691 | /* Resource flag check */ | ||
| 692 | netif_stop_queue(dev); | ||
| 693 | |||
| 694 | /* Too large packet check */ | 691 | /* Too large packet check */ |
| 695 | if (skb->len > MAX_PACKET_SIZE) { | 692 | if (skb->len > MAX_PACKET_SIZE) { |
| 696 | pr_err("big packet = %d\n", (u16)skb->len); | 693 | pr_err("big packet = %d\n", (u16)skb->len); |
| @@ -698,6 +695,9 @@ static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb, | |||
| 698 | return NETDEV_TX_OK; | 695 | return NETDEV_TX_OK; |
| 699 | } | 696 | } |
| 700 | 697 | ||
| 698 | /* Resource flag check */ | ||
| 699 | netif_stop_queue(dev); | ||
| 700 | |||
| 701 | spin_lock_irqsave(&db->lock, flags); | 701 | spin_lock_irqsave(&db->lock, flags); |
| 702 | 702 | ||
| 703 | /* No Tx resource check, it never happen nromally */ | 703 | /* No Tx resource check, it never happen nromally */ |
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h index 05a95586f3c5..055b87ab4f07 100644 --- a/drivers/net/ucc_geth.h +++ b/drivers/net/ucc_geth.h | |||
| @@ -899,7 +899,8 @@ struct ucc_geth_hardware_statistics { | |||
| 899 | #define UCC_GETH_UTFS_INIT 512 /* Tx virtual FIFO size | 899 | #define UCC_GETH_UTFS_INIT 512 /* Tx virtual FIFO size |
| 900 | */ | 900 | */ |
| 901 | #define UCC_GETH_UTFET_INIT 256 /* 1/2 utfs */ | 901 | #define UCC_GETH_UTFET_INIT 256 /* 1/2 utfs */ |
| 902 | #define UCC_GETH_UTFTT_INIT 512 | 902 | #define UCC_GETH_UTFTT_INIT 256 /* 1/2 utfs |
| 903 | due to errata */ | ||
| 903 | /* Gigabit Ethernet (1000 Mbps) */ | 904 | /* Gigabit Ethernet (1000 Mbps) */ |
| 904 | #define UCC_GETH_URFS_GIGA_INIT 4096/*2048*/ /* Rx virtual | 905 | #define UCC_GETH_URFS_GIGA_INIT 4096/*2048*/ /* Rx virtual |
| 905 | FIFO size */ | 906 | FIFO size */ |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index b154a94de03e..812edf85d6d3 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
| @@ -958,10 +958,6 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt, | |||
| 958 | /* Packet is complete. Inject into stack. */ | 958 | /* Packet is complete. Inject into stack. */ |
| 959 | /* We have IP packet here */ | 959 | /* We have IP packet here */ |
| 960 | odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP); | 960 | odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP); |
| 961 | /* don't check it */ | ||
| 962 | odev->skb_rx_buf->ip_summed = | ||
| 963 | CHECKSUM_UNNECESSARY; | ||
| 964 | |||
| 965 | skb_reset_mac_header(odev->skb_rx_buf); | 961 | skb_reset_mac_header(odev->skb_rx_buf); |
| 966 | 962 | ||
| 967 | /* Ship it off to the kernel */ | 963 | /* Ship it off to the kernel */ |
| @@ -2994,12 +2990,14 @@ static int hso_probe(struct usb_interface *interface, | |||
| 2994 | 2990 | ||
| 2995 | case HSO_INTF_BULK: | 2991 | case HSO_INTF_BULK: |
| 2996 | /* It's a regular bulk interface */ | 2992 | /* It's a regular bulk interface */ |
| 2997 | if (((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) && | 2993 | if ((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) { |
| 2998 | !disable_net) | 2994 | if (!disable_net) |
| 2999 | hso_dev = hso_create_net_device(interface, port_spec); | 2995 | hso_dev = |
| 3000 | else | 2996 | hso_create_net_device(interface, port_spec); |
| 2997 | } else { | ||
| 3001 | hso_dev = | 2998 | hso_dev = |
| 3002 | hso_create_bulk_serial_device(interface, port_spec); | 2999 | hso_create_bulk_serial_device(interface, port_spec); |
| 3000 | } | ||
| 3003 | if (!hso_dev) | 3001 | if (!hso_dev) |
| 3004 | goto exit; | 3002 | goto exit; |
| 3005 | break; | 3003 | break; |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index d81ad8397885..cf05504d9511 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
| @@ -498,7 +498,6 @@ norbuff: | |||
| 498 | static int x25_asy_close(struct net_device *dev) | 498 | static int x25_asy_close(struct net_device *dev) |
| 499 | { | 499 | { |
| 500 | struct x25_asy *sl = netdev_priv(dev); | 500 | struct x25_asy *sl = netdev_priv(dev); |
| 501 | int err; | ||
| 502 | 501 | ||
| 503 | spin_lock(&sl->lock); | 502 | spin_lock(&sl->lock); |
| 504 | if (sl->tty) | 503 | if (sl->tty) |
| @@ -507,10 +506,6 @@ static int x25_asy_close(struct net_device *dev) | |||
| 507 | netif_stop_queue(dev); | 506 | netif_stop_queue(dev); |
| 508 | sl->rcount = 0; | 507 | sl->rcount = 0; |
| 509 | sl->xleft = 0; | 508 | sl->xleft = 0; |
| 510 | err = lapb_unregister(dev); | ||
| 511 | if (err != LAPB_OK) | ||
| 512 | printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n", | ||
| 513 | err); | ||
| 514 | spin_unlock(&sl->lock); | 509 | spin_unlock(&sl->lock); |
| 515 | return 0; | 510 | return 0; |
| 516 | } | 511 | } |
| @@ -595,6 +590,7 @@ static int x25_asy_open_tty(struct tty_struct *tty) | |||
| 595 | static void x25_asy_close_tty(struct tty_struct *tty) | 590 | static void x25_asy_close_tty(struct tty_struct *tty) |
| 596 | { | 591 | { |
| 597 | struct x25_asy *sl = tty->disc_data; | 592 | struct x25_asy *sl = tty->disc_data; |
| 593 | int err; | ||
| 598 | 594 | ||
| 599 | /* First make sure we're connected. */ | 595 | /* First make sure we're connected. */ |
| 600 | if (!sl || sl->magic != X25_ASY_MAGIC) | 596 | if (!sl || sl->magic != X25_ASY_MAGIC) |
| @@ -605,6 +601,11 @@ static void x25_asy_close_tty(struct tty_struct *tty) | |||
| 605 | dev_close(sl->dev); | 601 | dev_close(sl->dev); |
| 606 | rtnl_unlock(); | 602 | rtnl_unlock(); |
| 607 | 603 | ||
| 604 | err = lapb_unregister(sl->dev); | ||
| 605 | if (err != LAPB_OK) | ||
| 606 | printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n", | ||
| 607 | err); | ||
| 608 | |||
| 608 | tty->disc_data = NULL; | 609 | tty->disc_data = NULL; |
| 609 | sl->tty = NULL; | 610 | sl->tty = NULL; |
| 610 | x25_asy_free(sl); | 611 | x25_asy_free(sl); |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 8251946842e6..42ed923cdb1a 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
| @@ -1917,7 +1917,8 @@ ath5k_beacon_send(struct ath5k_softc *sc) | |||
| 1917 | sc->bmisscount = 0; | 1917 | sc->bmisscount = 0; |
| 1918 | } | 1918 | } |
| 1919 | 1919 | ||
| 1920 | if (sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) { | 1920 | if ((sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) || |
| 1921 | sc->opmode == NL80211_IFTYPE_MESH_POINT) { | ||
| 1921 | u64 tsf = ath5k_hw_get_tsf64(ah); | 1922 | u64 tsf = ath5k_hw_get_tsf64(ah); |
| 1922 | u32 tsftu = TSF_TO_TU(tsf); | 1923 | u32 tsftu = TSF_TO_TU(tsf); |
| 1923 | int slot = ((tsftu % sc->bintval) * ATH_BCBUF) / sc->bintval; | 1924 | int slot = ((tsftu % sc->bintval) * ATH_BCBUF) / sc->bintval; |
| @@ -1949,8 +1950,9 @@ ath5k_beacon_send(struct ath5k_softc *sc) | |||
| 1949 | /* NB: hw still stops DMA, so proceed */ | 1950 | /* NB: hw still stops DMA, so proceed */ |
| 1950 | } | 1951 | } |
| 1951 | 1952 | ||
| 1952 | /* refresh the beacon for AP mode */ | 1953 | /* refresh the beacon for AP or MESH mode */ |
| 1953 | if (sc->opmode == NL80211_IFTYPE_AP) | 1954 | if (sc->opmode == NL80211_IFTYPE_AP || |
| 1955 | sc->opmode == NL80211_IFTYPE_MESH_POINT) | ||
| 1954 | ath5k_beacon_update(sc->hw, vif); | 1956 | ath5k_beacon_update(sc->hw, vif); |
| 1955 | 1957 | ||
| 1956 | ath5k_hw_set_txdp(ah, sc->bhalq, bf->daddr); | 1958 | ath5k_hw_set_txdp(ah, sc->bhalq, bf->daddr); |
| @@ -2851,7 +2853,8 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, | |||
| 2851 | 2853 | ||
| 2852 | /* Assign the vap/adhoc to a beacon xmit slot. */ | 2854 | /* Assign the vap/adhoc to a beacon xmit slot. */ |
| 2853 | if ((avf->opmode == NL80211_IFTYPE_AP) || | 2855 | if ((avf->opmode == NL80211_IFTYPE_AP) || |
| 2854 | (avf->opmode == NL80211_IFTYPE_ADHOC)) { | 2856 | (avf->opmode == NL80211_IFTYPE_ADHOC) || |
| 2857 | (avf->opmode == NL80211_IFTYPE_MESH_POINT)) { | ||
| 2855 | int slot; | 2858 | int slot; |
| 2856 | 2859 | ||
| 2857 | WARN_ON(list_empty(&sc->bcbuf)); | 2860 | WARN_ON(list_empty(&sc->bcbuf)); |
| @@ -2870,7 +2873,7 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, | |||
| 2870 | sc->bslot[avf->bslot] = vif; | 2873 | sc->bslot[avf->bslot] = vif; |
| 2871 | if (avf->opmode == NL80211_IFTYPE_AP) | 2874 | if (avf->opmode == NL80211_IFTYPE_AP) |
| 2872 | sc->num_ap_vifs++; | 2875 | sc->num_ap_vifs++; |
| 2873 | else | 2876 | else if (avf->opmode == NL80211_IFTYPE_ADHOC) |
| 2874 | sc->num_adhoc_vifs++; | 2877 | sc->num_adhoc_vifs++; |
| 2875 | } | 2878 | } |
| 2876 | 2879 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index c4182359bee4..a7b82f0085d2 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
| @@ -55,6 +55,8 @@ | |||
| 55 | #define SUB_NUM_CTL_MODES_AT_5G_40 2 /* excluding HT40, EXT-OFDM */ | 55 | #define SUB_NUM_CTL_MODES_AT_5G_40 2 /* excluding HT40, EXT-OFDM */ |
| 56 | #define SUB_NUM_CTL_MODES_AT_2G_40 3 /* excluding HT40, EXT-OFDM, EXT-CCK */ | 56 | #define SUB_NUM_CTL_MODES_AT_2G_40 3 /* excluding HT40, EXT-OFDM, EXT-CCK */ |
| 57 | 57 | ||
| 58 | #define CTL(_tpower, _flag) ((_tpower) | ((_flag) << 6)) | ||
| 59 | |||
| 58 | static const struct ar9300_eeprom ar9300_default = { | 60 | static const struct ar9300_eeprom ar9300_default = { |
| 59 | .eepromVersion = 2, | 61 | .eepromVersion = 2, |
| 60 | .templateVersion = 2, | 62 | .templateVersion = 2, |
| @@ -290,20 +292,21 @@ static const struct ar9300_eeprom ar9300_default = { | |||
| 290 | } | 292 | } |
| 291 | }, | 293 | }, |
| 292 | .ctlPowerData_2G = { | 294 | .ctlPowerData_2G = { |
| 293 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 295 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 294 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 296 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 295 | { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } }, | 297 | { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } }, |
| 296 | 298 | ||
| 297 | { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } }, | 299 | { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } }, |
| 298 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 300 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 299 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 301 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 300 | 302 | ||
| 301 | { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } }, | 303 | { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0) } }, |
| 302 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 304 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 303 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 305 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 304 | 306 | ||
| 305 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 307 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 306 | { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } }, | 308 | { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } }, |
| 309 | { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } }, | ||
| 307 | }, | 310 | }, |
| 308 | .modalHeader5G = { | 311 | .modalHeader5G = { |
| 309 | /* 4 idle,t1,t2,b (4 bits per setting) */ | 312 | /* 4 idle,t1,t2,b (4 bits per setting) */ |
| @@ -568,56 +571,56 @@ static const struct ar9300_eeprom ar9300_default = { | |||
| 568 | .ctlPowerData_5G = { | 571 | .ctlPowerData_5G = { |
| 569 | { | 572 | { |
| 570 | { | 573 | { |
| 571 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 574 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
| 572 | {60, 1}, {60, 1}, {60, 1}, {60, 0}, | 575 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
| 573 | } | 576 | } |
| 574 | }, | 577 | }, |
| 575 | { | 578 | { |
| 576 | { | 579 | { |
| 577 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 580 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
| 578 | {60, 1}, {60, 1}, {60, 1}, {60, 0}, | 581 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
| 579 | } | 582 | } |
| 580 | }, | 583 | }, |
| 581 | { | 584 | { |
| 582 | { | 585 | { |
| 583 | {60, 0}, {60, 1}, {60, 0}, {60, 1}, | 586 | CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 1), |
| 584 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 587 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
| 585 | } | 588 | } |
| 586 | }, | 589 | }, |
| 587 | { | 590 | { |
| 588 | { | 591 | { |
| 589 | {60, 0}, {60, 1}, {60, 1}, {60, 0}, | 592 | CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
| 590 | {60, 1}, {60, 0}, {60, 0}, {60, 0}, | 593 | CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0), |
| 591 | } | 594 | } |
| 592 | }, | 595 | }, |
| 593 | { | 596 | { |
| 594 | { | 597 | { |
| 595 | {60, 1}, {60, 1}, {60, 1}, {60, 0}, | 598 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
| 596 | {60, 0}, {60, 0}, {60, 0}, {60, 0}, | 599 | CTL(60, 0), CTL(60, 0), CTL(60, 0), CTL(60, 0), |
| 597 | } | 600 | } |
| 598 | }, | 601 | }, |
| 599 | { | 602 | { |
| 600 | { | 603 | { |
| 601 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 604 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
| 602 | {60, 1}, {60, 0}, {60, 0}, {60, 0}, | 605 | CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0), |
| 603 | } | 606 | } |
| 604 | }, | 607 | }, |
| 605 | { | 608 | { |
| 606 | { | 609 | { |
| 607 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 610 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
| 608 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 611 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
| 609 | } | 612 | } |
| 610 | }, | 613 | }, |
| 611 | { | 614 | { |
| 612 | { | 615 | { |
| 613 | {60, 1}, {60, 1}, {60, 0}, {60, 1}, | 616 | CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1), |
| 614 | {60, 1}, {60, 1}, {60, 1}, {60, 0}, | 617 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
| 615 | } | 618 | } |
| 616 | }, | 619 | }, |
| 617 | { | 620 | { |
| 618 | { | 621 | { |
| 619 | {60, 1}, {60, 0}, {60, 1}, {60, 1}, | 622 | CTL(60, 1), CTL(60, 0), CTL(60, 1), CTL(60, 1), |
| 620 | {60, 1}, {60, 1}, {60, 0}, {60, 1}, | 623 | CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1), |
| 621 | } | 624 | } |
| 622 | }, | 625 | }, |
| 623 | } | 626 | } |
| @@ -1827,9 +1830,9 @@ static u16 ar9003_hw_get_direct_edge_power(struct ar9300_eeprom *eep, | |||
| 1827 | struct cal_ctl_data_5g *ctl_5g = eep->ctlPowerData_5G; | 1830 | struct cal_ctl_data_5g *ctl_5g = eep->ctlPowerData_5G; |
| 1828 | 1831 | ||
| 1829 | if (is2GHz) | 1832 | if (is2GHz) |
| 1830 | return ctl_2g[idx].ctlEdges[edge].tPower; | 1833 | return CTL_EDGE_TPOWER(ctl_2g[idx].ctlEdges[edge]); |
| 1831 | else | 1834 | else |
| 1832 | return ctl_5g[idx].ctlEdges[edge].tPower; | 1835 | return CTL_EDGE_TPOWER(ctl_5g[idx].ctlEdges[edge]); |
| 1833 | } | 1836 | } |
| 1834 | 1837 | ||
| 1835 | static u16 ar9003_hw_get_indirect_edge_power(struct ar9300_eeprom *eep, | 1838 | static u16 ar9003_hw_get_indirect_edge_power(struct ar9300_eeprom *eep, |
| @@ -1847,12 +1850,12 @@ static u16 ar9003_hw_get_indirect_edge_power(struct ar9300_eeprom *eep, | |||
| 1847 | 1850 | ||
| 1848 | if (is2GHz) { | 1851 | if (is2GHz) { |
| 1849 | if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 1) < freq && | 1852 | if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 1) < freq && |
| 1850 | ctl_2g[idx].ctlEdges[edge - 1].flag) | 1853 | CTL_EDGE_FLAGS(ctl_2g[idx].ctlEdges[edge - 1])) |
| 1851 | return ctl_2g[idx].ctlEdges[edge - 1].tPower; | 1854 | return CTL_EDGE_TPOWER(ctl_2g[idx].ctlEdges[edge - 1]); |
| 1852 | } else { | 1855 | } else { |
| 1853 | if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 0) < freq && | 1856 | if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 0) < freq && |
| 1854 | ctl_5g[idx].ctlEdges[edge - 1].flag) | 1857 | CTL_EDGE_FLAGS(ctl_5g[idx].ctlEdges[edge - 1])) |
| 1855 | return ctl_5g[idx].ctlEdges[edge - 1].tPower; | 1858 | return CTL_EDGE_TPOWER(ctl_5g[idx].ctlEdges[edge - 1]); |
| 1856 | } | 1859 | } |
| 1857 | 1860 | ||
| 1858 | return AR9300_MAX_RATE_POWER; | 1861 | return AR9300_MAX_RATE_POWER; |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h index 3c533bb983c7..655b3033396c 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | |||
| @@ -261,17 +261,12 @@ struct cal_tgt_pow_ht { | |||
| 261 | u8 tPow2x[14]; | 261 | u8 tPow2x[14]; |
| 262 | } __packed; | 262 | } __packed; |
| 263 | 263 | ||
| 264 | struct cal_ctl_edge_pwr { | ||
| 265 | u8 tPower:6, | ||
| 266 | flag:2; | ||
| 267 | } __packed; | ||
| 268 | |||
| 269 | struct cal_ctl_data_2g { | 264 | struct cal_ctl_data_2g { |
| 270 | struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_2G]; | 265 | u8 ctlEdges[AR9300_NUM_BAND_EDGES_2G]; |
| 271 | } __packed; | 266 | } __packed; |
| 272 | 267 | ||
| 273 | struct cal_ctl_data_5g { | 268 | struct cal_ctl_data_5g { |
| 274 | struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_5G]; | 269 | u8 ctlEdges[AR9300_NUM_BAND_EDGES_5G]; |
| 275 | } __packed; | 270 | } __packed; |
| 276 | 271 | ||
| 277 | struct ar9300_eeprom { | 272 | struct ar9300_eeprom { |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 170d44a35ccb..0963071e8f90 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
| 22 | #include <linux/leds.h> | 22 | #include <linux/leds.h> |
| 23 | #include <linux/completion.h> | 23 | #include <linux/completion.h> |
| 24 | #include <linux/pm_qos_params.h> | ||
| 24 | 25 | ||
| 25 | #include "debug.h" | 26 | #include "debug.h" |
| 26 | #include "common.h" | 27 | #include "common.h" |
| @@ -328,7 +329,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp); | |||
| 328 | struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype); | 329 | struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype); |
| 329 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq); | 330 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq); |
| 330 | int ath_tx_setup(struct ath_softc *sc, int haltype); | 331 | int ath_tx_setup(struct ath_softc *sc, int haltype); |
| 331 | void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx); | 332 | bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx); |
| 332 | void ath_draintxq(struct ath_softc *sc, | 333 | void ath_draintxq(struct ath_softc *sc, |
| 333 | struct ath_txq *txq, bool retry_tx); | 334 | struct ath_txq *txq, bool retry_tx); |
| 334 | void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an); | 335 | void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an); |
| @@ -646,6 +647,8 @@ struct ath_softc { | |||
| 646 | struct ath_descdma txsdma; | 647 | struct ath_descdma txsdma; |
| 647 | 648 | ||
| 648 | struct ath_ant_comb ant_comb; | 649 | struct ath_ant_comb ant_comb; |
| 650 | |||
| 651 | struct pm_qos_request_list pm_qos_req; | ||
| 649 | }; | 652 | }; |
| 650 | 653 | ||
| 651 | struct ath_wiphy { | 654 | struct ath_wiphy { |
| @@ -675,7 +678,6 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) | |||
| 675 | } | 678 | } |
| 676 | 679 | ||
| 677 | extern struct ieee80211_ops ath9k_ops; | 680 | extern struct ieee80211_ops ath9k_ops; |
| 678 | extern struct pm_qos_request_list ath9k_pm_qos_req; | ||
| 679 | extern int modparam_nohwcrypt; | 681 | extern int modparam_nohwcrypt; |
| 680 | extern int led_blink; | 682 | extern int led_blink; |
| 681 | 683 | ||
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c index 1266333f586d..2bbf94d0191e 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.c +++ b/drivers/net/wireless/ath/ath9k/eeprom.c | |||
| @@ -240,16 +240,16 @@ u16 ath9k_hw_get_max_edge_power(u16 freq, struct cal_ctl_edges *pRdEdgesPower, | |||
| 240 | for (i = 0; (i < num_band_edges) && | 240 | for (i = 0; (i < num_band_edges) && |
| 241 | (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) { | 241 | (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) { |
| 242 | if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) { | 242 | if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) { |
| 243 | twiceMaxEdgePower = pRdEdgesPower[i].tPower; | 243 | twiceMaxEdgePower = CTL_EDGE_TPOWER(pRdEdgesPower[i].ctl); |
| 244 | break; | 244 | break; |
| 245 | } else if ((i > 0) && | 245 | } else if ((i > 0) && |
| 246 | (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, | 246 | (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, |
| 247 | is2GHz))) { | 247 | is2GHz))) { |
| 248 | if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel, | 248 | if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel, |
| 249 | is2GHz) < freq && | 249 | is2GHz) < freq && |
| 250 | pRdEdgesPower[i - 1].flag) { | 250 | CTL_EDGE_FLAGS(pRdEdgesPower[i - 1].ctl)) { |
| 251 | twiceMaxEdgePower = | 251 | twiceMaxEdgePower = |
| 252 | pRdEdgesPower[i - 1].tPower; | 252 | CTL_EDGE_TPOWER(pRdEdgesPower[i - 1].ctl); |
| 253 | } | 253 | } |
| 254 | break; | 254 | break; |
| 255 | } | 255 | } |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h index dacb45e1b906..dd59f09441a3 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/drivers/net/wireless/ath/ath9k/eeprom.h | |||
| @@ -233,6 +233,18 @@ | |||
| 233 | 233 | ||
| 234 | #define AR9287_CHECKSUM_LOCATION (AR9287_EEP_START_LOC + 1) | 234 | #define AR9287_CHECKSUM_LOCATION (AR9287_EEP_START_LOC + 1) |
| 235 | 235 | ||
| 236 | #define CTL_EDGE_TPOWER(_ctl) ((_ctl) & 0x3f) | ||
| 237 | #define CTL_EDGE_FLAGS(_ctl) (((_ctl) >> 6) & 0x03) | ||
| 238 | |||
| 239 | #define LNA_CTL_BUF_MODE BIT(0) | ||
| 240 | #define LNA_CTL_ISEL_LO BIT(1) | ||
| 241 | #define LNA_CTL_ISEL_HI BIT(2) | ||
| 242 | #define LNA_CTL_BUF_IN BIT(3) | ||
| 243 | #define LNA_CTL_FEM_BAND BIT(4) | ||
| 244 | #define LNA_CTL_LOCAL_BIAS BIT(5) | ||
| 245 | #define LNA_CTL_FORCE_XPA BIT(6) | ||
| 246 | #define LNA_CTL_USE_ANT1 BIT(7) | ||
| 247 | |||
| 236 | enum eeprom_param { | 248 | enum eeprom_param { |
| 237 | EEP_NFTHRESH_5, | 249 | EEP_NFTHRESH_5, |
| 238 | EEP_NFTHRESH_2, | 250 | EEP_NFTHRESH_2, |
| @@ -378,10 +390,7 @@ struct modal_eep_header { | |||
| 378 | u8 xatten2Margin[AR5416_MAX_CHAINS]; | 390 | u8 xatten2Margin[AR5416_MAX_CHAINS]; |
| 379 | u8 ob_ch1; | 391 | u8 ob_ch1; |
| 380 | u8 db_ch1; | 392 | u8 db_ch1; |
| 381 | u8 useAnt1:1, | 393 | u8 lna_ctl; |
| 382 | force_xpaon:1, | ||
| 383 | local_bias:1, | ||
| 384 | femBandSelectUsed:1, xlnabufin:1, xlnaisel:2, xlnabufmode:1; | ||
| 385 | u8 miscBits; | 394 | u8 miscBits; |
| 386 | u16 xpaBiasLvlFreq[3]; | 395 | u16 xpaBiasLvlFreq[3]; |
| 387 | u8 futureModal[6]; | 396 | u8 futureModal[6]; |
| @@ -535,18 +544,10 @@ struct cal_target_power_ht { | |||
| 535 | u8 tPow2x[8]; | 544 | u8 tPow2x[8]; |
| 536 | } __packed; | 545 | } __packed; |
| 537 | 546 | ||
| 538 | |||
| 539 | #ifdef __BIG_ENDIAN_BITFIELD | ||
| 540 | struct cal_ctl_edges { | ||
| 541 | u8 bChannel; | ||
| 542 | u8 flag:2, tPower:6; | ||
| 543 | } __packed; | ||
| 544 | #else | ||
| 545 | struct cal_ctl_edges { | 547 | struct cal_ctl_edges { |
| 546 | u8 bChannel; | 548 | u8 bChannel; |
| 547 | u8 tPower:6, flag:2; | 549 | u8 ctl; |
| 548 | } __packed; | 550 | } __packed; |
| 549 | #endif | ||
| 550 | 551 | ||
| 551 | struct cal_data_op_loop_ar9287 { | 552 | struct cal_data_op_loop_ar9287 { |
| 552 | u8 pwrPdg[2][5]; | 553 | u8 pwrPdg[2][5]; |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c index 76b4d65472dd..a3ccb1b9638d 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom_def.c +++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c | |||
| @@ -451,9 +451,10 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah, | |||
| 451 | ath9k_hw_analog_shift_rmw(ah, AR_AN_TOP2, | 451 | ath9k_hw_analog_shift_rmw(ah, AR_AN_TOP2, |
| 452 | AR_AN_TOP2_LOCALBIAS, | 452 | AR_AN_TOP2_LOCALBIAS, |
| 453 | AR_AN_TOP2_LOCALBIAS_S, | 453 | AR_AN_TOP2_LOCALBIAS_S, |
| 454 | pModal->local_bias); | 454 | !!(pModal->lna_ctl & |
| 455 | LNA_CTL_LOCAL_BIAS)); | ||
| 455 | REG_RMW_FIELD(ah, AR_PHY_XPA_CFG, AR_PHY_FORCE_XPA_CFG, | 456 | REG_RMW_FIELD(ah, AR_PHY_XPA_CFG, AR_PHY_FORCE_XPA_CFG, |
| 456 | pModal->force_xpaon); | 457 | !!(pModal->lna_ctl & LNA_CTL_FORCE_XPA)); |
| 457 | } | 458 | } |
| 458 | 459 | ||
| 459 | REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, | 460 | REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, |
| @@ -1062,15 +1063,19 @@ static void ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah, | |||
| 1062 | case 1: | 1063 | case 1: |
| 1063 | break; | 1064 | break; |
| 1064 | case 2: | 1065 | case 2: |
| 1065 | scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; | 1066 | if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN) |
| 1067 | scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; | ||
| 1068 | else | ||
| 1069 | scaledPower = 0; | ||
| 1066 | break; | 1070 | break; |
| 1067 | case 3: | 1071 | case 3: |
| 1068 | scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; | 1072 | if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN) |
| 1073 | scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; | ||
| 1074 | else | ||
| 1075 | scaledPower = 0; | ||
| 1069 | break; | 1076 | break; |
| 1070 | } | 1077 | } |
| 1071 | 1078 | ||
| 1072 | scaledPower = max((u16)0, scaledPower); | ||
| 1073 | |||
| 1074 | if (IS_CHAN_2GHZ(chan)) { | 1079 | if (IS_CHAN_2GHZ(chan)) { |
| 1075 | numCtlModes = ARRAY_SIZE(ctlModesFor11g) - | 1080 | numCtlModes = ARRAY_SIZE(ctlModesFor11g) - |
| 1076 | SUB_NUM_CTL_MODES_AT_2G_40; | 1081 | SUB_NUM_CTL_MODES_AT_2G_40; |
| @@ -1428,9 +1433,9 @@ static u8 ath9k_hw_def_get_num_ant_config(struct ath_hw *ah, | |||
| 1428 | 1433 | ||
| 1429 | num_ant_config = 1; | 1434 | num_ant_config = 1; |
| 1430 | 1435 | ||
| 1431 | if (pBase->version >= 0x0E0D) | 1436 | if (pBase->version >= 0x0E0D && |
| 1432 | if (pModal->useAnt1) | 1437 | (pModal->lna_ctl & LNA_CTL_USE_ANT1)) |
| 1433 | num_ant_config += 1; | 1438 | num_ant_config += 1; |
| 1434 | 1439 | ||
| 1435 | return num_ant_config; | 1440 | return num_ant_config; |
| 1436 | } | 1441 | } |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index dfb6560dab92..0de3c3d3c245 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
| @@ -1024,6 +1024,13 @@ static int ath9k_hif_usb_suspend(struct usb_interface *interface, | |||
| 1024 | struct hif_device_usb *hif_dev = | 1024 | struct hif_device_usb *hif_dev = |
| 1025 | (struct hif_device_usb *) usb_get_intfdata(interface); | 1025 | (struct hif_device_usb *) usb_get_intfdata(interface); |
| 1026 | 1026 | ||
| 1027 | /* | ||
| 1028 | * The device has to be set to FULLSLEEP mode in case no | ||
| 1029 | * interface is up. | ||
| 1030 | */ | ||
| 1031 | if (!(hif_dev->flags & HIF_USB_START)) | ||
| 1032 | ath9k_htc_suspend(hif_dev->htc_handle); | ||
| 1033 | |||
| 1027 | ath9k_hif_usb_dealloc_urbs(hif_dev); | 1034 | ath9k_hif_usb_dealloc_urbs(hif_dev); |
| 1028 | 1035 | ||
| 1029 | return 0; | 1036 | return 0; |
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 75ecf6a30d25..c3b561daa6c1 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
| @@ -455,6 +455,8 @@ u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv); | |||
| 455 | void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv); | 455 | void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv); |
| 456 | void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv); | 456 | void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv); |
| 457 | void ath9k_ps_work(struct work_struct *work); | 457 | void ath9k_ps_work(struct work_struct *work); |
| 458 | bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, | ||
| 459 | enum ath9k_power_mode mode); | ||
| 458 | 460 | ||
| 459 | void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv); | 461 | void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv); |
| 460 | void ath9k_init_leds(struct ath9k_htc_priv *priv); | 462 | void ath9k_init_leds(struct ath9k_htc_priv *priv); |
| @@ -464,6 +466,7 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, | |||
| 464 | u16 devid, char *product); | 466 | u16 devid, char *product); |
| 465 | void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug); | 467 | void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug); |
| 466 | #ifdef CONFIG_PM | 468 | #ifdef CONFIG_PM |
| 469 | void ath9k_htc_suspend(struct htc_target *htc_handle); | ||
| 467 | int ath9k_htc_resume(struct htc_target *htc_handle); | 470 | int ath9k_htc_resume(struct htc_target *htc_handle); |
| 468 | #endif | 471 | #endif |
| 469 | #ifdef CONFIG_ATH9K_HTC_DEBUGFS | 472 | #ifdef CONFIG_ATH9K_HTC_DEBUGFS |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 7c8a38d04561..8776f49ffd41 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
| @@ -891,6 +891,12 @@ void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug) | |||
| 891 | } | 891 | } |
| 892 | 892 | ||
| 893 | #ifdef CONFIG_PM | 893 | #ifdef CONFIG_PM |
| 894 | |||
| 895 | void ath9k_htc_suspend(struct htc_target *htc_handle) | ||
| 896 | { | ||
| 897 | ath9k_htc_setpower(htc_handle->drv_priv, ATH9K_PM_FULL_SLEEP); | ||
| 898 | } | ||
| 899 | |||
| 894 | int ath9k_htc_resume(struct htc_target *htc_handle) | 900 | int ath9k_htc_resume(struct htc_target *htc_handle) |
| 895 | { | 901 | { |
| 896 | int ret; | 902 | int ret; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 9a3be8da755d..51977caca47f 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
| @@ -63,8 +63,8 @@ static enum htc_phymode ath9k_htc_get_curmode(struct ath9k_htc_priv *priv, | |||
| 63 | return mode; | 63 | return mode; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | static bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, | 66 | bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, |
| 67 | enum ath9k_power_mode mode) | 67 | enum ath9k_power_mode mode) |
| 68 | { | 68 | { |
| 69 | bool ret; | 69 | bool ret; |
| 70 | 70 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 6ebc68bca91f..c7fbe25cc128 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
| @@ -2044,7 +2044,8 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio) | |||
| 2044 | val = REG_READ(ah, AR7010_GPIO_IN); | 2044 | val = REG_READ(ah, AR7010_GPIO_IN); |
| 2045 | return (MS(val, AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) == 0; | 2045 | return (MS(val, AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) == 0; |
| 2046 | } else if (AR_SREV_9300_20_OR_LATER(ah)) | 2046 | } else if (AR_SREV_9300_20_OR_LATER(ah)) |
| 2047 | return MS_REG_READ(AR9300, gpio) != 0; | 2047 | return (MS(REG_READ(ah, AR_GPIO_IN), AR9300_GPIO_IN_VAL) & |
| 2048 | AR_GPIO_BIT(gpio)) != 0; | ||
| 2048 | else if (AR_SREV_9271(ah)) | 2049 | else if (AR_SREV_9271(ah)) |
| 2049 | return MS_REG_READ(AR9271, gpio) != 0; | 2050 | return MS_REG_READ(AR9271, gpio) != 0; |
| 2050 | else if (AR_SREV_9287_11_OR_LATER(ah)) | 2051 | else if (AR_SREV_9287_11_OR_LATER(ah)) |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 92bc5c5f4876..14b8ab386daf 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
| 18 | #include <linux/pm_qos_params.h> | ||
| 19 | 18 | ||
| 20 | #include "ath9k.h" | 19 | #include "ath9k.h" |
| 21 | 20 | ||
| @@ -180,8 +179,6 @@ static const struct ath_ops ath9k_common_ops = { | |||
| 180 | .write = ath9k_iowrite32, | 179 | .write = ath9k_iowrite32, |
| 181 | }; | 180 | }; |
| 182 | 181 | ||
| 183 | struct pm_qos_request_list ath9k_pm_qos_req; | ||
| 184 | |||
| 185 | /**************************/ | 182 | /**************************/ |
| 186 | /* Initialization */ | 183 | /* Initialization */ |
| 187 | /**************************/ | 184 | /**************************/ |
| @@ -664,6 +661,8 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
| 664 | hw->flags |= IEEE80211_HW_MFP_CAPABLE; | 661 | hw->flags |= IEEE80211_HW_MFP_CAPABLE; |
| 665 | 662 | ||
| 666 | hw->wiphy->interface_modes = | 663 | hw->wiphy->interface_modes = |
| 664 | BIT(NL80211_IFTYPE_P2P_GO) | | ||
| 665 | BIT(NL80211_IFTYPE_P2P_CLIENT) | | ||
| 667 | BIT(NL80211_IFTYPE_AP) | | 666 | BIT(NL80211_IFTYPE_AP) | |
| 668 | BIT(NL80211_IFTYPE_WDS) | | 667 | BIT(NL80211_IFTYPE_WDS) | |
| 669 | BIT(NL80211_IFTYPE_STATION) | | 668 | BIT(NL80211_IFTYPE_STATION) | |
| @@ -759,7 +758,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
| 759 | ath_init_leds(sc); | 758 | ath_init_leds(sc); |
| 760 | ath_start_rfkill_poll(sc); | 759 | ath_start_rfkill_poll(sc); |
| 761 | 760 | ||
| 762 | pm_qos_add_request(&ath9k_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, | 761 | pm_qos_add_request(&sc->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, |
| 763 | PM_QOS_DEFAULT_VALUE); | 762 | PM_QOS_DEFAULT_VALUE); |
| 764 | 763 | ||
| 765 | return 0; | 764 | return 0; |
| @@ -830,7 +829,7 @@ void ath9k_deinit_device(struct ath_softc *sc) | |||
| 830 | } | 829 | } |
| 831 | 830 | ||
| 832 | ieee80211_unregister_hw(hw); | 831 | ieee80211_unregister_hw(hw); |
| 833 | pm_qos_remove_request(&ath9k_pm_qos_req); | 832 | pm_qos_remove_request(&sc->pm_qos_req); |
| 834 | ath_rx_cleanup(sc); | 833 | ath_rx_cleanup(sc); |
| 835 | ath_tx_cleanup(sc); | 834 | ath_tx_cleanup(sc); |
| 836 | ath9k_deinit_softc(sc); | 835 | ath9k_deinit_softc(sc); |
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c index 8c13479b17cd..c996963ab339 100644 --- a/drivers/net/wireless/ath/ath9k/mac.c +++ b/drivers/net/wireless/ath/ath9k/mac.c | |||
| @@ -703,8 +703,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds, | |||
| 703 | rs->rs_phyerr = phyerr; | 703 | rs->rs_phyerr = phyerr; |
| 704 | } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr) | 704 | } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr) |
| 705 | rs->rs_status |= ATH9K_RXERR_DECRYPT; | 705 | rs->rs_status |= ATH9K_RXERR_DECRYPT; |
| 706 | else if ((ads.ds_rxstatus8 & AR_MichaelErr) && | 706 | else if (ads.ds_rxstatus8 & AR_MichaelErr) |
| 707 | rs->rs_keyix != ATH9K_RXKEYIX_INVALID) | ||
| 708 | rs->rs_status |= ATH9K_RXERR_MIC; | 707 | rs->rs_status |= ATH9K_RXERR_MIC; |
| 709 | else if (ads.ds_rxstatus8 & AR_KeyMiss) | 708 | else if (ads.ds_rxstatus8 & AR_KeyMiss) |
| 710 | rs->rs_status |= ATH9K_RXERR_DECRYPT; | 709 | rs->rs_status |= ATH9K_RXERR_DECRYPT; |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 25d3ef4c338e..c0c3464d3a86 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include <linux/nl80211.h> | 17 | #include <linux/nl80211.h> |
| 18 | #include <linux/pm_qos_params.h> | ||
| 19 | #include "ath9k.h" | 18 | #include "ath9k.h" |
| 20 | #include "btcoex.h" | 19 | #include "btcoex.h" |
| 21 | 20 | ||
| @@ -245,11 +244,12 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, | |||
| 245 | * the relevant bits of the h/w. | 244 | * the relevant bits of the h/w. |
| 246 | */ | 245 | */ |
| 247 | ath9k_hw_set_interrupts(ah, 0); | 246 | ath9k_hw_set_interrupts(ah, 0); |
| 248 | ath_drain_all_txq(sc, false); | 247 | stopped = ath_drain_all_txq(sc, false); |
| 249 | 248 | ||
| 250 | spin_lock_bh(&sc->rx.pcu_lock); | 249 | spin_lock_bh(&sc->rx.pcu_lock); |
| 251 | 250 | ||
| 252 | stopped = ath_stoprecv(sc); | 251 | if (!ath_stoprecv(sc)) |
| 252 | stopped = false; | ||
| 253 | 253 | ||
| 254 | /* XXX: do not flush receive queue here. We don't want | 254 | /* XXX: do not flush receive queue here. We don't want |
| 255 | * to flush data frames already in queue because of | 255 | * to flush data frames already in queue because of |
| @@ -1244,7 +1244,7 @@ static int ath9k_start(struct ieee80211_hw *hw) | |||
| 1244 | ath9k_btcoex_timer_resume(sc); | 1244 | ath9k_btcoex_timer_resume(sc); |
| 1245 | } | 1245 | } |
| 1246 | 1246 | ||
| 1247 | pm_qos_update_request(&ath9k_pm_qos_req, 55); | 1247 | pm_qos_update_request(&sc->pm_qos_req, 55); |
| 1248 | 1248 | ||
| 1249 | mutex_unlock: | 1249 | mutex_unlock: |
| 1250 | mutex_unlock(&sc->mutex); | 1250 | mutex_unlock(&sc->mutex); |
| @@ -1423,7 +1423,7 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
| 1423 | 1423 | ||
| 1424 | sc->sc_flags |= SC_OP_INVALID; | 1424 | sc->sc_flags |= SC_OP_INVALID; |
| 1425 | 1425 | ||
| 1426 | pm_qos_update_request(&ath9k_pm_qos_req, PM_QOS_DEFAULT_VALUE); | 1426 | pm_qos_update_request(&sc->pm_qos_req, PM_QOS_DEFAULT_VALUE); |
| 1427 | 1427 | ||
| 1428 | mutex_unlock(&sc->mutex); | 1428 | mutex_unlock(&sc->mutex); |
| 1429 | 1429 | ||
| @@ -1520,7 +1520,6 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
| 1520 | struct ath_softc *sc = aphy->sc; | 1520 | struct ath_softc *sc = aphy->sc; |
| 1521 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1521 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
| 1522 | struct ath_vif *avp = (void *)vif->drv_priv; | 1522 | struct ath_vif *avp = (void *)vif->drv_priv; |
| 1523 | int i; | ||
| 1524 | 1523 | ||
| 1525 | ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); | 1524 | ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); |
| 1526 | 1525 | ||
| @@ -1534,21 +1533,24 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
| 1534 | if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || | 1533 | if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || |
| 1535 | (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || | 1534 | (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || |
| 1536 | (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { | 1535 | (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { |
| 1536 | /* Disable SWBA interrupt */ | ||
| 1537 | sc->sc_ah->imask &= ~ATH9K_INT_SWBA; | ||
| 1537 | ath9k_ps_wakeup(sc); | 1538 | ath9k_ps_wakeup(sc); |
| 1539 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask); | ||
| 1538 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); | 1540 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); |
| 1539 | ath9k_ps_restore(sc); | 1541 | ath9k_ps_restore(sc); |
| 1542 | tasklet_kill(&sc->bcon_tasklet); | ||
| 1540 | } | 1543 | } |
| 1541 | 1544 | ||
| 1542 | ath_beacon_return(sc, avp); | 1545 | ath_beacon_return(sc, avp); |
| 1543 | sc->sc_flags &= ~SC_OP_BEACONS; | 1546 | sc->sc_flags &= ~SC_OP_BEACONS; |
| 1544 | 1547 | ||
| 1545 | for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) { | 1548 | if (sc->nbcnvifs) { |
| 1546 | if (sc->beacon.bslot[i] == vif) { | 1549 | /* Re-enable SWBA interrupt */ |
| 1547 | printk(KERN_DEBUG "%s: vif had allocated beacon " | 1550 | sc->sc_ah->imask |= ATH9K_INT_SWBA; |
| 1548 | "slot\n", __func__); | 1551 | ath9k_ps_wakeup(sc); |
| 1549 | sc->beacon.bslot[i] = NULL; | 1552 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask); |
| 1550 | sc->beacon.bslot_aphy[i] = NULL; | 1553 | ath9k_ps_restore(sc); |
| 1551 | } | ||
| 1552 | } | 1554 | } |
| 1553 | 1555 | ||
| 1554 | sc->nvifs--; | 1556 | sc->nvifs--; |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 1a62e351ec77..fdc2ec52b42f 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
| @@ -838,6 +838,10 @@ static bool ath9k_rx_accept(struct ath_common *common, | |||
| 838 | struct ath_rx_status *rx_stats, | 838 | struct ath_rx_status *rx_stats, |
| 839 | bool *decrypt_error) | 839 | bool *decrypt_error) |
| 840 | { | 840 | { |
| 841 | #define is_mc_or_valid_tkip_keyix ((is_mc || \ | ||
| 842 | (rx_stats->rs_keyix != ATH9K_RXKEYIX_INVALID && \ | ||
| 843 | test_bit(rx_stats->rs_keyix, common->tkip_keymap)))) | ||
| 844 | |||
| 841 | struct ath_hw *ah = common->ah; | 845 | struct ath_hw *ah = common->ah; |
| 842 | __le16 fc; | 846 | __le16 fc; |
| 843 | u8 rx_status_len = ah->caps.rx_status_len; | 847 | u8 rx_status_len = ah->caps.rx_status_len; |
| @@ -879,15 +883,18 @@ static bool ath9k_rx_accept(struct ath_common *common, | |||
| 879 | if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) { | 883 | if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) { |
| 880 | *decrypt_error = true; | 884 | *decrypt_error = true; |
| 881 | } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) { | 885 | } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) { |
| 886 | bool is_mc; | ||
| 882 | /* | 887 | /* |
| 883 | * The MIC error bit is only valid if the frame | 888 | * The MIC error bit is only valid if the frame |
| 884 | * is not a control frame or fragment, and it was | 889 | * is not a control frame or fragment, and it was |
| 885 | * decrypted using a valid TKIP key. | 890 | * decrypted using a valid TKIP key. |
| 886 | */ | 891 | */ |
| 892 | is_mc = !!is_multicast_ether_addr(hdr->addr1); | ||
| 893 | |||
| 887 | if (!ieee80211_is_ctl(fc) && | 894 | if (!ieee80211_is_ctl(fc) && |
| 888 | !ieee80211_has_morefrags(fc) && | 895 | !ieee80211_has_morefrags(fc) && |
| 889 | !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) && | 896 | !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) && |
| 890 | test_bit(rx_stats->rs_keyix, common->tkip_keymap)) | 897 | is_mc_or_valid_tkip_keyix) |
| 891 | rxs->flag |= RX_FLAG_MMIC_ERROR; | 898 | rxs->flag |= RX_FLAG_MMIC_ERROR; |
| 892 | else | 899 | else |
| 893 | rx_stats->rs_status &= ~ATH9K_RXERR_MIC; | 900 | rx_stats->rs_status &= ~ATH9K_RXERR_MIC; |
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index dddf579aacf1..2c6a22fbb0f0 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
| @@ -984,11 +984,13 @@ enum { | |||
| 984 | #define AR9287_GPIO_IN_VAL_S 11 | 984 | #define AR9287_GPIO_IN_VAL_S 11 |
| 985 | #define AR9271_GPIO_IN_VAL 0xFFFF0000 | 985 | #define AR9271_GPIO_IN_VAL 0xFFFF0000 |
| 986 | #define AR9271_GPIO_IN_VAL_S 16 | 986 | #define AR9271_GPIO_IN_VAL_S 16 |
| 987 | #define AR9300_GPIO_IN_VAL 0x0001FFFF | ||
| 988 | #define AR9300_GPIO_IN_VAL_S 0 | ||
| 989 | #define AR7010_GPIO_IN_VAL 0x0000FFFF | 987 | #define AR7010_GPIO_IN_VAL 0x0000FFFF |
| 990 | #define AR7010_GPIO_IN_VAL_S 0 | 988 | #define AR7010_GPIO_IN_VAL_S 0 |
| 991 | 989 | ||
| 990 | #define AR_GPIO_IN 0x404c | ||
| 991 | #define AR9300_GPIO_IN_VAL 0x0001FFFF | ||
| 992 | #define AR9300_GPIO_IN_VAL_S 0 | ||
| 993 | |||
| 992 | #define AR_GPIO_OE_OUT (AR_SREV_9300_20_OR_LATER(ah) ? 0x4050 : 0x404c) | 994 | #define AR_GPIO_OE_OUT (AR_SREV_9300_20_OR_LATER(ah) ? 0x4050 : 0x404c) |
| 993 | #define AR_GPIO_OE_OUT_DRV 0x3 | 995 | #define AR_GPIO_OE_OUT_DRV 0x3 |
| 994 | #define AR_GPIO_OE_OUT_DRV_NO 0x0 | 996 | #define AR_GPIO_OE_OUT_DRV_NO 0x0 |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index f2ade2402ce2..aff04789f794 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
| @@ -1120,7 +1120,7 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx) | |||
| 1120 | } | 1120 | } |
| 1121 | } | 1121 | } |
| 1122 | 1122 | ||
| 1123 | void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) | 1123 | bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) |
| 1124 | { | 1124 | { |
| 1125 | struct ath_hw *ah = sc->sc_ah; | 1125 | struct ath_hw *ah = sc->sc_ah; |
| 1126 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1126 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
| @@ -1128,7 +1128,7 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) | |||
| 1128 | int i, npend = 0; | 1128 | int i, npend = 0; |
| 1129 | 1129 | ||
| 1130 | if (sc->sc_flags & SC_OP_INVALID) | 1130 | if (sc->sc_flags & SC_OP_INVALID) |
| 1131 | return; | 1131 | return true; |
| 1132 | 1132 | ||
| 1133 | /* Stop beacon queue */ | 1133 | /* Stop beacon queue */ |
| 1134 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); | 1134 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); |
| @@ -1142,25 +1142,15 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) | |||
| 1142 | } | 1142 | } |
| 1143 | } | 1143 | } |
| 1144 | 1144 | ||
| 1145 | if (npend) { | 1145 | if (npend) |
| 1146 | int r; | 1146 | ath_print(common, ATH_DBG_FATAL, "Failed to stop TX DMA!\n"); |
| 1147 | |||
| 1148 | ath_print(common, ATH_DBG_FATAL, | ||
| 1149 | "Failed to stop TX DMA. Resetting hardware!\n"); | ||
| 1150 | |||
| 1151 | spin_lock_bh(&sc->sc_resetlock); | ||
| 1152 | r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false); | ||
| 1153 | if (r) | ||
| 1154 | ath_print(common, ATH_DBG_FATAL, | ||
| 1155 | "Unable to reset hardware; reset status %d\n", | ||
| 1156 | r); | ||
| 1157 | spin_unlock_bh(&sc->sc_resetlock); | ||
| 1158 | } | ||
| 1159 | 1147 | ||
| 1160 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { | 1148 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { |
| 1161 | if (ATH_TXQ_SETUP(sc, i)) | 1149 | if (ATH_TXQ_SETUP(sc, i)) |
| 1162 | ath_draintxq(sc, &sc->tx.txq[i], retry_tx); | 1150 | ath_draintxq(sc, &sc->tx.txq[i], retry_tx); |
| 1163 | } | 1151 | } |
| 1152 | |||
| 1153 | return !npend; | ||
| 1164 | } | 1154 | } |
| 1165 | 1155 | ||
| 1166 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq) | 1156 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq) |
diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c index ae6c006bbc56..546b4e4ec5ea 100644 --- a/drivers/net/wireless/ath/carl9170/fw.c +++ b/drivers/net/wireless/ath/carl9170/fw.c | |||
| @@ -291,7 +291,8 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) | |||
| 291 | 291 | ||
| 292 | if (SUPP(CARL9170FW_WLANTX_CAB)) { | 292 | if (SUPP(CARL9170FW_WLANTX_CAB)) { |
| 293 | ar->hw->wiphy->interface_modes |= | 293 | ar->hw->wiphy->interface_modes |= |
| 294 | BIT(NL80211_IFTYPE_AP); | 294 | BIT(NL80211_IFTYPE_AP) | |
| 295 | BIT(NL80211_IFTYPE_P2P_GO); | ||
| 295 | } | 296 | } |
| 296 | } | 297 | } |
| 297 | 298 | ||
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c index a314c2c2bfbe..dc7b30b170d0 100644 --- a/drivers/net/wireless/ath/carl9170/main.c +++ b/drivers/net/wireless/ath/carl9170/main.c | |||
| @@ -1631,7 +1631,8 @@ void *carl9170_alloc(size_t priv_size) | |||
| 1631 | * supports these modes. The code which will add the | 1631 | * supports these modes. The code which will add the |
| 1632 | * additional interface_modes is in fw.c. | 1632 | * additional interface_modes is in fw.c. |
| 1633 | */ | 1633 | */ |
| 1634 | hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); | 1634 | hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | |
| 1635 | BIT(NL80211_IFTYPE_P2P_CLIENT); | ||
| 1635 | 1636 | ||
| 1636 | hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | | 1637 | hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | |
| 1637 | IEEE80211_HW_REPORTS_TX_ACK_STATUS | | 1638 | IEEE80211_HW_REPORTS_TX_ACK_STATUS | |
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index b575c865142d..7e6506a77bbb 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c | |||
| @@ -810,7 +810,7 @@ static int carl9170_tx_prepare(struct ar9170 *ar, struct sk_buff *skb) | |||
| 810 | 810 | ||
| 811 | mac_tmp = cpu_to_le16(AR9170_TX_MAC_HW_DURATION | | 811 | mac_tmp = cpu_to_le16(AR9170_TX_MAC_HW_DURATION | |
| 812 | AR9170_TX_MAC_BACKOFF); | 812 | AR9170_TX_MAC_BACKOFF); |
| 813 | mac_tmp |= cpu_to_le16((hw_queue << AR9170_TX_MAC_QOS_S) && | 813 | mac_tmp |= cpu_to_le16((hw_queue << AR9170_TX_MAC_QOS_S) & |
| 814 | AR9170_TX_MAC_QOS); | 814 | AR9170_TX_MAC_QOS); |
| 815 | 815 | ||
| 816 | no_ack = !!(info->flags & IEEE80211_TX_CTL_NO_ACK); | 816 | no_ack = !!(info->flags & IEEE80211_TX_CTL_NO_ACK); |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index e5685dc317a8..b4de0ca10feb 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
| @@ -1170,7 +1170,6 @@ static void if_sdio_remove(struct sdio_func *func) | |||
| 1170 | lbs_deb_sdio("call remove card\n"); | 1170 | lbs_deb_sdio("call remove card\n"); |
| 1171 | lbs_stop_card(card->priv); | 1171 | lbs_stop_card(card->priv); |
| 1172 | lbs_remove_card(card->priv); | 1172 | lbs_remove_card(card->priv); |
| 1173 | card->priv->surpriseremoved = 1; | ||
| 1174 | 1173 | ||
| 1175 | flush_workqueue(card->workqueue); | 1174 | flush_workqueue(card->workqueue); |
| 1176 | destroy_workqueue(card->workqueue); | 1175 | destroy_workqueue(card->workqueue); |
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c index 79bcb4e5d2ca..ecd4d04b2c3c 100644 --- a/drivers/net/wireless/libertas/if_spi.c +++ b/drivers/net/wireless/libertas/if_spi.c | |||
| @@ -1055,7 +1055,6 @@ static int __devexit libertas_spi_remove(struct spi_device *spi) | |||
| 1055 | lbs_stop_card(priv); | 1055 | lbs_stop_card(priv); |
| 1056 | lbs_remove_card(priv); /* will call free_netdev */ | 1056 | lbs_remove_card(priv); /* will call free_netdev */ |
| 1057 | 1057 | ||
| 1058 | priv->surpriseremoved = 1; | ||
| 1059 | free_irq(spi->irq, card); | 1058 | free_irq(spi->irq, card); |
| 1060 | if_spi_terminate_spi_thread(card); | 1059 | if_spi_terminate_spi_thread(card); |
| 1061 | if (card->pdata->teardown) | 1060 | if (card->pdata->teardown) |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 46b88b118c99..fcd1bbfc632d 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
| @@ -915,8 +915,6 @@ void lbs_remove_card(struct lbs_private *priv) | |||
| 915 | 915 | ||
| 916 | lbs_free_adapter(priv); | 916 | lbs_free_adapter(priv); |
| 917 | lbs_cfg_free(priv); | 917 | lbs_cfg_free(priv); |
| 918 | |||
| 919 | priv->dev = NULL; | ||
| 920 | free_netdev(dev); | 918 | free_netdev(dev); |
| 921 | 919 | ||
| 922 | lbs_deb_leave(LBS_DEB_MAIN); | 920 | lbs_deb_leave(LBS_DEB_MAIN); |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index e8e2d0f4763d..f3d396e7544b 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
| @@ -1392,10 +1392,9 @@ static void orinoco_process_scan_results(struct work_struct *work) | |||
| 1392 | orinoco_add_hostscan_results(priv, buf, len); | 1392 | orinoco_add_hostscan_results(priv, buf, len); |
| 1393 | 1393 | ||
| 1394 | kfree(buf); | 1394 | kfree(buf); |
| 1395 | } else if (priv->scan_request) { | 1395 | } else { |
| 1396 | /* Either abort or complete the scan */ | 1396 | /* Either abort or complete the scan */ |
| 1397 | cfg80211_scan_done(priv->scan_request, (len < 0)); | 1397 | orinoco_scan_done(priv, (len < 0)); |
| 1398 | priv->scan_request = NULL; | ||
| 1399 | } | 1398 | } |
| 1400 | 1399 | ||
| 1401 | spin_lock_irqsave(&priv->scan_lock, flags); | 1400 | spin_lock_irqsave(&priv->scan_lock, flags); |
| @@ -1684,6 +1683,8 @@ static int __orinoco_down(struct orinoco_private *priv) | |||
| 1684 | hermes_write_regn(hw, EVACK, 0xffff); | 1683 | hermes_write_regn(hw, EVACK, 0xffff); |
| 1685 | } | 1684 | } |
| 1686 | 1685 | ||
| 1686 | orinoco_scan_done(priv, true); | ||
| 1687 | |||
| 1687 | /* firmware will have to reassociate */ | 1688 | /* firmware will have to reassociate */ |
| 1688 | netif_carrier_off(dev); | 1689 | netif_carrier_off(dev); |
| 1689 | priv->last_linkstatus = 0xffff; | 1690 | priv->last_linkstatus = 0xffff; |
| @@ -1762,10 +1763,7 @@ void orinoco_reset(struct work_struct *work) | |||
| 1762 | orinoco_unlock(priv, &flags); | 1763 | orinoco_unlock(priv, &flags); |
| 1763 | 1764 | ||
| 1764 | /* Scanning support: Notify scan cancellation */ | 1765 | /* Scanning support: Notify scan cancellation */ |
| 1765 | if (priv->scan_request) { | 1766 | orinoco_scan_done(priv, true); |
| 1766 | cfg80211_scan_done(priv->scan_request, 1); | ||
| 1767 | priv->scan_request = NULL; | ||
| 1768 | } | ||
| 1769 | 1767 | ||
| 1770 | if (priv->hard_reset) { | 1768 | if (priv->hard_reset) { |
| 1771 | err = (*priv->hard_reset)(priv); | 1769 | err = (*priv->hard_reset)(priv); |
| @@ -1813,6 +1811,12 @@ static int __orinoco_commit(struct orinoco_private *priv) | |||
| 1813 | struct net_device *dev = priv->ndev; | 1811 | struct net_device *dev = priv->ndev; |
| 1814 | int err = 0; | 1812 | int err = 0; |
| 1815 | 1813 | ||
| 1814 | /* If we've called commit, we are reconfiguring or bringing the | ||
| 1815 | * interface up. Maintaining countermeasures across this would | ||
| 1816 | * be confusing, so note that we've disabled them. The port will | ||
| 1817 | * be enabled later in orinoco_commit or __orinoco_up. */ | ||
| 1818 | priv->tkip_cm_active = 0; | ||
| 1819 | |||
| 1816 | err = orinoco_hw_program_rids(priv); | 1820 | err = orinoco_hw_program_rids(priv); |
| 1817 | 1821 | ||
| 1818 | /* FIXME: what about netif_tx_lock */ | 1822 | /* FIXME: what about netif_tx_lock */ |
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c index 71b3d68b9403..32954c4b243a 100644 --- a/drivers/net/wireless/orinoco/orinoco_cs.c +++ b/drivers/net/wireless/orinoco/orinoco_cs.c | |||
| @@ -151,20 +151,20 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
| 151 | goto failed; | 151 | goto failed; |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
| 155 | if (ret) | ||
| 156 | goto failed; | ||
| 157 | |||
| 158 | /* We initialize the hermes structure before completing PCMCIA | ||
| 159 | * configuration just in case the interrupt handler gets | ||
| 160 | * called. */ | ||
| 161 | mem = ioport_map(link->resource[0]->start, | 154 | mem = ioport_map(link->resource[0]->start, |
| 162 | resource_size(link->resource[0])); | 155 | resource_size(link->resource[0])); |
| 163 | if (!mem) | 156 | if (!mem) |
| 164 | goto failed; | 157 | goto failed; |
| 165 | 158 | ||
| 159 | /* We initialize the hermes structure before completing PCMCIA | ||
| 160 | * configuration just in case the interrupt handler gets | ||
| 161 | * called. */ | ||
| 166 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); | 162 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); |
| 167 | 163 | ||
| 164 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
| 165 | if (ret) | ||
| 166 | goto failed; | ||
| 167 | |||
| 168 | ret = pcmcia_enable_device(link); | 168 | ret = pcmcia_enable_device(link); |
| 169 | if (ret) | 169 | if (ret) |
| 170 | goto failed; | 170 | goto failed; |
diff --git a/drivers/net/wireless/orinoco/scan.c b/drivers/net/wireless/orinoco/scan.c index 4300d9db7d8c..86cb54c842e7 100644 --- a/drivers/net/wireless/orinoco/scan.c +++ b/drivers/net/wireless/orinoco/scan.c | |||
| @@ -229,3 +229,11 @@ void orinoco_add_hostscan_results(struct orinoco_private *priv, | |||
| 229 | priv->scan_request = NULL; | 229 | priv->scan_request = NULL; |
| 230 | } | 230 | } |
| 231 | } | 231 | } |
| 232 | |||
| 233 | void orinoco_scan_done(struct orinoco_private *priv, bool abort) | ||
| 234 | { | ||
| 235 | if (priv->scan_request) { | ||
| 236 | cfg80211_scan_done(priv->scan_request, abort); | ||
| 237 | priv->scan_request = NULL; | ||
| 238 | } | ||
| 239 | } | ||
diff --git a/drivers/net/wireless/orinoco/scan.h b/drivers/net/wireless/orinoco/scan.h index 2dc4e046dbdb..27281fb0a6dc 100644 --- a/drivers/net/wireless/orinoco/scan.h +++ b/drivers/net/wireless/orinoco/scan.h | |||
| @@ -16,5 +16,6 @@ void orinoco_add_extscan_result(struct orinoco_private *priv, | |||
| 16 | void orinoco_add_hostscan_results(struct orinoco_private *dev, | 16 | void orinoco_add_hostscan_results(struct orinoco_private *dev, |
| 17 | unsigned char *buf, | 17 | unsigned char *buf, |
| 18 | size_t len); | 18 | size_t len); |
| 19 | void orinoco_scan_done(struct orinoco_private *priv, bool abort); | ||
| 19 | 20 | ||
| 20 | #endif /* _ORINOCO_SCAN_H_ */ | 21 | #endif /* _ORINOCO_SCAN_H_ */ |
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c index fb859a5ad2eb..db34c282e59b 100644 --- a/drivers/net/wireless/orinoco/spectrum_cs.c +++ b/drivers/net/wireless/orinoco/spectrum_cs.c | |||
| @@ -214,21 +214,21 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
| 214 | goto failed; | 214 | goto failed; |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
| 218 | if (ret) | ||
| 219 | goto failed; | ||
| 220 | |||
| 221 | /* We initialize the hermes structure before completing PCMCIA | ||
| 222 | * configuration just in case the interrupt handler gets | ||
| 223 | * called. */ | ||
| 224 | mem = ioport_map(link->resource[0]->start, | 217 | mem = ioport_map(link->resource[0]->start, |
| 225 | resource_size(link->resource[0])); | 218 | resource_size(link->resource[0])); |
| 226 | if (!mem) | 219 | if (!mem) |
| 227 | goto failed; | 220 | goto failed; |
| 228 | 221 | ||
| 222 | /* We initialize the hermes structure before completing PCMCIA | ||
| 223 | * configuration just in case the interrupt handler gets | ||
| 224 | * called. */ | ||
| 229 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); | 225 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); |
| 230 | hw->eeprom_pda = true; | 226 | hw->eeprom_pda = true; |
| 231 | 227 | ||
| 228 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
| 229 | if (ret) | ||
| 230 | goto failed; | ||
| 231 | |||
| 232 | ret = pcmcia_enable_device(link); | 232 | ret = pcmcia_enable_device(link); |
| 233 | if (ret) | 233 | if (ret) |
| 234 | goto failed; | 234 | goto failed; |
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c index 93505f93bf97..e5afabee60d1 100644 --- a/drivers/net/wireless/orinoco/wext.c +++ b/drivers/net/wireless/orinoco/wext.c | |||
| @@ -911,10 +911,10 @@ static int orinoco_ioctl_set_auth(struct net_device *dev, | |||
| 911 | */ | 911 | */ |
| 912 | if (param->value) { | 912 | if (param->value) { |
| 913 | priv->tkip_cm_active = 1; | 913 | priv->tkip_cm_active = 1; |
| 914 | ret = hermes_enable_port(hw, 0); | 914 | ret = hermes_disable_port(hw, 0); |
| 915 | } else { | 915 | } else { |
| 916 | priv->tkip_cm_active = 0; | 916 | priv->tkip_cm_active = 0; |
| 917 | ret = hermes_disable_port(hw, 0); | 917 | ret = hermes_enable_port(hw, 0); |
| 918 | } | 918 | } |
| 919 | break; | 919 | break; |
| 920 | 920 | ||
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index 05bf5a27b5b0..989e16e4ab5c 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c | |||
| @@ -951,7 +951,9 @@ static int usbatm_atm_init(struct usbatm_data *instance) | |||
| 951 | * condition: callbacks we register can be executed at once, before we have | 951 | * condition: callbacks we register can be executed at once, before we have |
| 952 | * initialized the struct atm_dev. To protect against this, all callbacks | 952 | * initialized the struct atm_dev. To protect against this, all callbacks |
| 953 | * abort if atm_dev->dev_data is NULL. */ | 953 | * abort if atm_dev->dev_data is NULL. */ |
| 954 | atm_dev = atm_dev_register(instance->driver_name, &usbatm_atm_devops, -1, NULL); | 954 | atm_dev = atm_dev_register(instance->driver_name, |
| 955 | &instance->usb_intf->dev, &usbatm_atm_devops, | ||
| 956 | -1, NULL); | ||
| 955 | if (!atm_dev) { | 957 | if (!atm_dev) { |
| 956 | usb_err(instance, "%s: failed to register ATM device!\n", __func__); | 958 | usb_err(instance, "%s: failed to register ATM device!\n", __func__); |
| 957 | return -1; | 959 | return -1; |
| @@ -966,14 +968,6 @@ static int usbatm_atm_init(struct usbatm_data *instance) | |||
| 966 | /* temp init ATM device, set to 128kbit */ | 968 | /* temp init ATM device, set to 128kbit */ |
| 967 | atm_dev->link_rate = 128 * 1000 / 424; | 969 | atm_dev->link_rate = 128 * 1000 / 424; |
| 968 | 970 | ||
| 969 | ret = sysfs_create_link(&atm_dev->class_dev.kobj, | ||
| 970 | &instance->usb_intf->dev.kobj, "device"); | ||
| 971 | if (ret) { | ||
| 972 | atm_err(instance, "%s: sysfs_create_link failed: %d\n", | ||
| 973 | __func__, ret); | ||
| 974 | goto fail_sysfs; | ||
| 975 | } | ||
| 976 | |||
| 977 | if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) { | 971 | if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) { |
| 978 | atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret); | 972 | atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret); |
| 979 | goto fail; | 973 | goto fail; |
| @@ -992,8 +986,6 @@ static int usbatm_atm_init(struct usbatm_data *instance) | |||
| 992 | return 0; | 986 | return 0; |
| 993 | 987 | ||
| 994 | fail: | 988 | fail: |
| 995 | sysfs_remove_link(&atm_dev->class_dev.kobj, "device"); | ||
| 996 | fail_sysfs: | ||
| 997 | instance->atm_dev = NULL; | 989 | instance->atm_dev = NULL; |
| 998 | atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ | 990 | atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ |
| 999 | return ret; | 991 | return ret; |
| @@ -1329,7 +1321,6 @@ void usbatm_usb_disconnect(struct usb_interface *intf) | |||
| 1329 | 1321 | ||
| 1330 | /* ATM finalize */ | 1322 | /* ATM finalize */ |
| 1331 | if (instance->atm_dev) { | 1323 | if (instance->atm_dev) { |
| 1332 | sysfs_remove_link(&instance->atm_dev->class_dev.kobj, "device"); | ||
| 1333 | atm_dev_deregister(instance->atm_dev); | 1324 | atm_dev_deregister(instance->atm_dev); |
| 1334 | instance->atm_dev = NULL; | 1325 | instance->atm_dev = NULL; |
| 1335 | } | 1326 | } |
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index a8e4e832cdbb..475f8c42c0e9 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
| @@ -427,8 +427,10 @@ extern rwlock_t vcc_sklist_lock; | |||
| 427 | 427 | ||
| 428 | #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) | 428 | #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) |
| 429 | 429 | ||
| 430 | struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, | 430 | struct atm_dev *atm_dev_register(const char *type, struct device *parent, |
| 431 | int number,unsigned long *flags); /* number == -1: pick first available */ | 431 | const struct atmdev_ops *ops, |
| 432 | int number, /* -1 == pick first available */ | ||
| 433 | unsigned long *flags); | ||
| 432 | struct atm_dev *atm_dev_lookup(int number); | 434 | struct atm_dev *atm_dev_lookup(int number); |
| 433 | void atm_dev_deregister(struct atm_dev *dev); | 435 | void atm_dev_deregister(struct atm_dev *dev); |
| 434 | 436 | ||
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index ebb0c80ffd6e..12b2b18e50c1 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
| @@ -230,6 +230,7 @@ enum | |||
| 230 | LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ | 230 | LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ |
| 231 | LINUX_MIB_TCPDEFERACCEPTDROP, | 231 | LINUX_MIB_TCPDEFERACCEPTDROP, |
| 232 | LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ | 232 | LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ |
| 233 | LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */ | ||
| 233 | __LINUX_MIB_MAX | 234 | __LINUX_MIB_MAX |
| 234 | }; | 235 | }; |
| 235 | 236 | ||
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 90c9e2872f27..18e5c3f67580 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
| @@ -10,6 +10,7 @@ extern void unix_inflight(struct file *fp); | |||
| 10 | extern void unix_notinflight(struct file *fp); | 10 | extern void unix_notinflight(struct file *fp); |
| 11 | extern void unix_gc(void); | 11 | extern void unix_gc(void); |
| 12 | extern void wait_for_unix_gc(void); | 12 | extern void wait_for_unix_gc(void); |
| 13 | extern struct sock *unix_get_socket(struct file *filp); | ||
| 13 | 14 | ||
| 14 | #define UNIX_HASH_SIZE 256 | 15 | #define UNIX_HASH_SIZE 256 |
| 15 | 16 | ||
| @@ -56,6 +57,7 @@ struct unix_sock { | |||
| 56 | spinlock_t lock; | 57 | spinlock_t lock; |
| 57 | unsigned int gc_candidate : 1; | 58 | unsigned int gc_candidate : 1; |
| 58 | unsigned int gc_maybe_cycle : 1; | 59 | unsigned int gc_maybe_cycle : 1; |
| 60 | unsigned char recursion_level; | ||
| 59 | struct socket_wq peer_wq; | 61 | struct socket_wq peer_wq; |
| 60 | }; | 62 | }; |
| 61 | #define unix_sk(__sk) ((struct unix_sock *)__sk) | 63 | #define unix_sk(__sk) ((struct unix_sock *)__sk) |
diff --git a/include/net/sock.h b/include/net/sock.h index a6338d039857..659d968d95c5 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -1155,6 +1155,8 @@ extern void sk_common_release(struct sock *sk); | |||
| 1155 | /* Initialise core socket variables */ | 1155 | /* Initialise core socket variables */ |
| 1156 | extern void sock_init_data(struct socket *sock, struct sock *sk); | 1156 | extern void sock_init_data(struct socket *sock, struct sock *sk); |
| 1157 | 1157 | ||
| 1158 | extern void sk_filter_release_rcu(struct rcu_head *rcu); | ||
| 1159 | |||
| 1158 | /** | 1160 | /** |
| 1159 | * sk_filter_release - release a socket filter | 1161 | * sk_filter_release - release a socket filter |
| 1160 | * @fp: filter to remove | 1162 | * @fp: filter to remove |
| @@ -1165,7 +1167,7 @@ extern void sock_init_data(struct socket *sock, struct sock *sk); | |||
| 1165 | static inline void sk_filter_release(struct sk_filter *fp) | 1167 | static inline void sk_filter_release(struct sk_filter *fp) |
| 1166 | { | 1168 | { |
| 1167 | if (atomic_dec_and_test(&fp->refcnt)) | 1169 | if (atomic_dec_and_test(&fp->refcnt)) |
| 1168 | kfree(fp); | 1170 | call_rcu_bh(&fp->rcu, sk_filter_release_rcu); |
| 1169 | } | 1171 | } |
| 1170 | 1172 | ||
| 1171 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) | 1173 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) |
diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c index 799c631f0fed..f7fa67c78766 100644 --- a/net/atm/atm_sysfs.c +++ b/net/atm/atm_sysfs.c | |||
| @@ -143,12 +143,13 @@ static struct class atm_class = { | |||
| 143 | .dev_uevent = atm_uevent, | 143 | .dev_uevent = atm_uevent, |
| 144 | }; | 144 | }; |
| 145 | 145 | ||
| 146 | int atm_register_sysfs(struct atm_dev *adev) | 146 | int atm_register_sysfs(struct atm_dev *adev, struct device *parent) |
| 147 | { | 147 | { |
| 148 | struct device *cdev = &adev->class_dev; | 148 | struct device *cdev = &adev->class_dev; |
| 149 | int i, j, err; | 149 | int i, j, err; |
| 150 | 150 | ||
| 151 | cdev->class = &atm_class; | 151 | cdev->class = &atm_class; |
| 152 | cdev->parent = parent; | ||
| 152 | dev_set_drvdata(cdev, adev); | 153 | dev_set_drvdata(cdev, adev); |
| 153 | 154 | ||
| 154 | dev_set_name(cdev, "%s%d", adev->type, adev->number); | 155 | dev_set_name(cdev, "%s%d", adev->type, adev->number); |
diff --git a/net/atm/resources.c b/net/atm/resources.c index d29e58261511..23f45ce6f351 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c | |||
| @@ -74,8 +74,9 @@ struct atm_dev *atm_dev_lookup(int number) | |||
| 74 | } | 74 | } |
| 75 | EXPORT_SYMBOL(atm_dev_lookup); | 75 | EXPORT_SYMBOL(atm_dev_lookup); |
| 76 | 76 | ||
| 77 | struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, | 77 | struct atm_dev *atm_dev_register(const char *type, struct device *parent, |
| 78 | int number, unsigned long *flags) | 78 | const struct atmdev_ops *ops, int number, |
| 79 | unsigned long *flags) | ||
| 79 | { | 80 | { |
| 80 | struct atm_dev *dev, *inuse; | 81 | struct atm_dev *dev, *inuse; |
| 81 | 82 | ||
| @@ -115,7 +116,7 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, | |||
| 115 | goto out_fail; | 116 | goto out_fail; |
| 116 | } | 117 | } |
| 117 | 118 | ||
| 118 | if (atm_register_sysfs(dev) < 0) { | 119 | if (atm_register_sysfs(dev, parent) < 0) { |
| 119 | pr_err("atm_register_sysfs failed for dev %s\n", type); | 120 | pr_err("atm_register_sysfs failed for dev %s\n", type); |
| 120 | atm_proc_dev_deregister(dev); | 121 | atm_proc_dev_deregister(dev); |
| 121 | goto out_fail; | 122 | goto out_fail; |
diff --git a/net/atm/resources.h b/net/atm/resources.h index 126fb1840dfb..521431e30507 100644 --- a/net/atm/resources.h +++ b/net/atm/resources.h | |||
| @@ -42,6 +42,6 @@ static inline void atm_proc_dev_deregister(struct atm_dev *dev) | |||
| 42 | 42 | ||
| 43 | #endif /* CONFIG_PROC_FS */ | 43 | #endif /* CONFIG_PROC_FS */ |
| 44 | 44 | ||
| 45 | int atm_register_sysfs(struct atm_dev *adev); | 45 | int atm_register_sysfs(struct atm_dev *adev, struct device *parent); |
| 46 | void atm_unregister_sysfs(struct atm_dev *adev); | 46 | void atm_unregister_sysfs(struct atm_dev *adev); |
| 47 | #endif | 47 | #endif |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index d0927d1fdada..66b9e5c0523a 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
| @@ -882,7 +882,7 @@ static int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) | |||
| 882 | int lm = 0; | 882 | int lm = 0; |
| 883 | 883 | ||
| 884 | if (type != SCO_LINK && type != ESCO_LINK) | 884 | if (type != SCO_LINK && type != ESCO_LINK) |
| 885 | return 0; | 885 | return -EINVAL; |
| 886 | 886 | ||
| 887 | BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); | 887 | BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); |
| 888 | 888 | ||
| @@ -908,7 +908,7 @@ static int sco_connect_cfm(struct hci_conn *hcon, __u8 status) | |||
| 908 | BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); | 908 | BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); |
| 909 | 909 | ||
| 910 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) | 910 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) |
| 911 | return 0; | 911 | return -EINVAL; |
| 912 | 912 | ||
| 913 | if (!status) { | 913 | if (!status) { |
| 914 | struct sco_conn *conn; | 914 | struct sco_conn *conn; |
| @@ -927,7 +927,7 @@ static int sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) | |||
| 927 | BT_DBG("hcon %p reason %d", hcon, reason); | 927 | BT_DBG("hcon %p reason %d", hcon, reason); |
| 928 | 928 | ||
| 929 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) | 929 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) |
| 930 | return 0; | 930 | return -EINVAL; |
| 931 | 931 | ||
| 932 | sco_conn_del(hcon, bt_err(reason)); | 932 | sco_conn_del(hcon, bt_err(reason)); |
| 933 | 933 | ||
diff --git a/net/ceph/Makefile b/net/ceph/Makefile index aab1cabb8035..5f19415ec9c0 100644 --- a/net/ceph/Makefile +++ b/net/ceph/Makefile | |||
| @@ -1,9 +1,6 @@ | |||
| 1 | # | 1 | # |
| 2 | # Makefile for CEPH filesystem. | 2 | # Makefile for CEPH filesystem. |
| 3 | # | 3 | # |
| 4 | |||
| 5 | ifneq ($(KERNELRELEASE),) | ||
| 6 | |||
| 7 | obj-$(CONFIG_CEPH_LIB) += libceph.o | 4 | obj-$(CONFIG_CEPH_LIB) += libceph.o |
| 8 | 5 | ||
| 9 | libceph-objs := ceph_common.o messenger.o msgpool.o buffer.o pagelist.o \ | 6 | libceph-objs := ceph_common.o messenger.o msgpool.o buffer.o pagelist.o \ |
| @@ -16,22 +13,3 @@ libceph-objs := ceph_common.o messenger.o msgpool.o buffer.o pagelist.o \ | |||
| 16 | ceph_fs.o ceph_strings.o ceph_hash.o \ | 13 | ceph_fs.o ceph_strings.o ceph_hash.o \ |
| 17 | pagevec.o | 14 | pagevec.o |
| 18 | 15 | ||
| 19 | else | ||
| 20 | #Otherwise we were called directly from the command | ||
| 21 | # line; invoke the kernel build system. | ||
| 22 | |||
| 23 | KERNELDIR ?= /lib/modules/$(shell uname -r)/build | ||
| 24 | PWD := $(shell pwd) | ||
| 25 | |||
| 26 | default: all | ||
| 27 | |||
| 28 | all: | ||
| 29 | $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_CEPH_LIB=m modules | ||
| 30 | |||
| 31 | modules_install: | ||
| 32 | $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_CEPH_LIB=m modules_install | ||
| 33 | |||
| 34 | clean: | ||
| 35 | $(MAKE) -C $(KERNELDIR) M=$(PWD) clean | ||
| 36 | |||
| 37 | endif | ||
diff --git a/net/core/filter.c b/net/core/filter.c index c1ee800bc080..ae21a0d3c4a2 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
| @@ -589,23 +589,16 @@ int sk_chk_filter(struct sock_filter *filter, int flen) | |||
| 589 | EXPORT_SYMBOL(sk_chk_filter); | 589 | EXPORT_SYMBOL(sk_chk_filter); |
| 590 | 590 | ||
| 591 | /** | 591 | /** |
| 592 | * sk_filter_rcu_release - Release a socket filter by rcu_head | 592 | * sk_filter_release_rcu - Release a socket filter by rcu_head |
| 593 | * @rcu: rcu_head that contains the sk_filter to free | 593 | * @rcu: rcu_head that contains the sk_filter to free |
| 594 | */ | 594 | */ |
| 595 | static void sk_filter_rcu_release(struct rcu_head *rcu) | 595 | void sk_filter_release_rcu(struct rcu_head *rcu) |
| 596 | { | 596 | { |
| 597 | struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); | 597 | struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); |
| 598 | 598 | ||
| 599 | sk_filter_release(fp); | 599 | kfree(fp); |
| 600 | } | ||
| 601 | |||
| 602 | static void sk_filter_delayed_uncharge(struct sock *sk, struct sk_filter *fp) | ||
| 603 | { | ||
| 604 | unsigned int size = sk_filter_len(fp); | ||
| 605 | |||
| 606 | atomic_sub(size, &sk->sk_omem_alloc); | ||
| 607 | call_rcu_bh(&fp->rcu, sk_filter_rcu_release); | ||
| 608 | } | 600 | } |
| 601 | EXPORT_SYMBOL(sk_filter_release_rcu); | ||
| 609 | 602 | ||
| 610 | /** | 603 | /** |
| 611 | * sk_attach_filter - attach a socket filter | 604 | * sk_attach_filter - attach a socket filter |
| @@ -649,7 +642,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) | |||
| 649 | rcu_assign_pointer(sk->sk_filter, fp); | 642 | rcu_assign_pointer(sk->sk_filter, fp); |
| 650 | 643 | ||
| 651 | if (old_fp) | 644 | if (old_fp) |
| 652 | sk_filter_delayed_uncharge(sk, old_fp); | 645 | sk_filter_uncharge(sk, old_fp); |
| 653 | return 0; | 646 | return 0; |
| 654 | } | 647 | } |
| 655 | EXPORT_SYMBOL_GPL(sk_attach_filter); | 648 | EXPORT_SYMBOL_GPL(sk_attach_filter); |
| @@ -663,7 +656,7 @@ int sk_detach_filter(struct sock *sk) | |||
| 663 | sock_owned_by_user(sk)); | 656 | sock_owned_by_user(sk)); |
| 664 | if (filter) { | 657 | if (filter) { |
| 665 | rcu_assign_pointer(sk->sk_filter, NULL); | 658 | rcu_assign_pointer(sk->sk_filter, NULL); |
| 666 | sk_filter_delayed_uncharge(sk, filter); | 659 | sk_filter_uncharge(sk, filter); |
| 667 | ret = 0; | 660 | ret = 0; |
| 668 | } | 661 | } |
| 669 | return ret; | 662 | return ret; |
diff --git a/net/core/timestamping.c b/net/core/timestamping.c index 0ae6c22da85b..c19bb4ee405e 100644 --- a/net/core/timestamping.c +++ b/net/core/timestamping.c | |||
| @@ -96,11 +96,13 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb) | |||
| 96 | struct phy_device *phydev; | 96 | struct phy_device *phydev; |
| 97 | unsigned int type; | 97 | unsigned int type; |
| 98 | 98 | ||
| 99 | skb_push(skb, ETH_HLEN); | 99 | if (skb_headroom(skb) < ETH_HLEN) |
| 100 | return false; | ||
| 101 | __skb_push(skb, ETH_HLEN); | ||
| 100 | 102 | ||
| 101 | type = classify(skb); | 103 | type = classify(skb); |
| 102 | 104 | ||
| 103 | skb_pull(skb, ETH_HLEN); | 105 | __skb_pull(skb, ETH_HLEN); |
| 104 | 106 | ||
| 105 | switch (type) { | 107 | switch (type) { |
| 106 | case PTP_CLASS_V1_IPV4: | 108 | case PTP_CLASS_V1_IPV4: |
diff --git a/net/dccp/input.c b/net/dccp/input.c index 265985370fa1..e424a09e83f6 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
| @@ -239,7 +239,8 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) | |||
| 239 | dccp_update_gsr(sk, seqno); | 239 | dccp_update_gsr(sk, seqno); |
| 240 | 240 | ||
| 241 | if (dh->dccph_type != DCCP_PKT_SYNC && | 241 | if (dh->dccph_type != DCCP_PKT_SYNC && |
| 242 | (ackno != DCCP_PKT_WITHOUT_ACK_SEQ)) | 242 | ackno != DCCP_PKT_WITHOUT_ACK_SEQ && |
| 243 | after48(ackno, dp->dccps_gar)) | ||
| 243 | dp->dccps_gar = ackno; | 244 | dp->dccps_gar = ackno; |
| 244 | } else { | 245 | } else { |
| 245 | unsigned long now = jiffies; | 246 | unsigned long now = jiffies; |
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index a76b78de679f..6f97268ed85f 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c | |||
| @@ -1556,6 +1556,8 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us | |||
| 1556 | if (r_len > sizeof(struct linkinfo_dn)) | 1556 | if (r_len > sizeof(struct linkinfo_dn)) |
| 1557 | r_len = sizeof(struct linkinfo_dn); | 1557 | r_len = sizeof(struct linkinfo_dn); |
| 1558 | 1558 | ||
| 1559 | memset(&link, 0, sizeof(link)); | ||
| 1560 | |||
| 1559 | switch(sock->state) { | 1561 | switch(sock->state) { |
| 1560 | case SS_CONNECTING: | 1562 | case SS_CONNECTING: |
| 1561 | link.idn_linkstate = LL_CONNECTING; | 1563 | link.idn_linkstate = LL_CONNECTING; |
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 13992e1d2726..15dcc1a586b4 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
| @@ -661,8 +661,10 @@ static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg) | |||
| 661 | err = 0; | 661 | err = 0; |
| 662 | switch (cmd) { | 662 | switch (cmd) { |
| 663 | case SIOCSIFADDR: | 663 | case SIOCSIFADDR: |
| 664 | if (!capable(CAP_NET_ADMIN)) | 664 | if (!capable(CAP_NET_ADMIN)) { |
| 665 | return -EPERM; | 665 | err = -EPERM; |
| 666 | break; | ||
| 667 | } | ||
| 666 | 668 | ||
| 667 | edev = dev->ec_ptr; | 669 | edev = dev->ec_ptr; |
| 668 | if (edev == NULL) { | 670 | if (edev == NULL) { |
| @@ -849,9 +851,13 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len) | |||
| 849 | { | 851 | { |
| 850 | struct iphdr *ip = ip_hdr(skb); | 852 | struct iphdr *ip = ip_hdr(skb); |
| 851 | unsigned char stn = ntohl(ip->saddr) & 0xff; | 853 | unsigned char stn = ntohl(ip->saddr) & 0xff; |
| 854 | struct dst_entry *dst = skb_dst(skb); | ||
| 855 | struct ec_device *edev = NULL; | ||
| 852 | struct sock *sk = NULL; | 856 | struct sock *sk = NULL; |
| 853 | struct sk_buff *newskb; | 857 | struct sk_buff *newskb; |
| 854 | struct ec_device *edev = skb->dev->ec_ptr; | 858 | |
| 859 | if (dst) | ||
| 860 | edev = dst->dev->ec_ptr; | ||
| 855 | 861 | ||
| 856 | if (! edev) | 862 | if (! edev) |
| 857 | goto bad; | 863 | goto bad; |
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 1b344f30b463..3c0369a3a663 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c | |||
| @@ -133,8 +133,7 @@ int __inet_inherit_port(struct sock *sk, struct sock *child) | |||
| 133 | } | 133 | } |
| 134 | } | 134 | } |
| 135 | } | 135 | } |
| 136 | sk_add_bind_node(child, &tb->owners); | 136 | inet_bind_hash(child, tb, port); |
| 137 | inet_csk(child)->icsk_bind_hash = tb; | ||
| 138 | spin_unlock(&head->lock); | 137 | spin_unlock(&head->lock); |
| 139 | 138 | ||
| 140 | return 0; | 139 | return 0; |
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index 1b48eb1ed453..b14ec7d03b6e 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
| @@ -253,6 +253,7 @@ static const struct snmp_mib snmp4_net_list[] = { | |||
| 253 | SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP), | 253 | SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP), |
| 254 | SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP), | 254 | SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP), |
| 255 | SNMP_MIB_ITEM("IPReversePathFilter", LINUX_MIB_IPRPFILTER), | 255 | SNMP_MIB_ITEM("IPReversePathFilter", LINUX_MIB_IPRPFILTER), |
| 256 | SNMP_MIB_ITEM("TCPTimeWaitOverflow", LINUX_MIB_TCPTIMEWAITOVERFLOW), | ||
| 256 | SNMP_MIB_SENTINEL | 257 | SNMP_MIB_SENTINEL |
| 257 | }; | 258 | }; |
| 258 | 259 | ||
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index e91911d7aae2..1b4ec21497a4 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
| @@ -26,6 +26,8 @@ static int zero; | |||
| 26 | static int tcp_retr1_max = 255; | 26 | static int tcp_retr1_max = 255; |
| 27 | static int ip_local_port_range_min[] = { 1, 1 }; | 27 | static int ip_local_port_range_min[] = { 1, 1 }; |
| 28 | static int ip_local_port_range_max[] = { 65535, 65535 }; | 28 | static int ip_local_port_range_max[] = { 65535, 65535 }; |
| 29 | static int tcp_adv_win_scale_min = -31; | ||
| 30 | static int tcp_adv_win_scale_max = 31; | ||
| 29 | 31 | ||
| 30 | /* Update system visible IP port range */ | 32 | /* Update system visible IP port range */ |
| 31 | static void set_local_port_range(int range[2]) | 33 | static void set_local_port_range(int range[2]) |
| @@ -426,7 +428,9 @@ static struct ctl_table ipv4_table[] = { | |||
| 426 | .data = &sysctl_tcp_adv_win_scale, | 428 | .data = &sysctl_tcp_adv_win_scale, |
| 427 | .maxlen = sizeof(int), | 429 | .maxlen = sizeof(int), |
| 428 | .mode = 0644, | 430 | .mode = 0644, |
| 429 | .proc_handler = proc_dointvec | 431 | .proc_handler = proc_dointvec_minmax, |
| 432 | .extra1 = &tcp_adv_win_scale_min, | ||
| 433 | .extra2 = &tcp_adv_win_scale_max, | ||
| 430 | }, | 434 | }, |
| 431 | { | 435 | { |
| 432 | .procname = "tcp_tw_reuse", | 436 | .procname = "tcp_tw_reuse", |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 69ccbc1dde9c..e13da6de1fc7 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
| @@ -2043,7 +2043,9 @@ get_req: | |||
| 2043 | } | 2043 | } |
| 2044 | get_sk: | 2044 | get_sk: |
| 2045 | sk_nulls_for_each_from(sk, node) { | 2045 | sk_nulls_for_each_from(sk, node) { |
| 2046 | if (sk->sk_family == st->family && net_eq(sock_net(sk), net)) { | 2046 | if (!net_eq(sock_net(sk), net)) |
| 2047 | continue; | ||
| 2048 | if (sk->sk_family == st->family) { | ||
| 2047 | cur = sk; | 2049 | cur = sk; |
| 2048 | goto out; | 2050 | goto out; |
| 2049 | } | 2051 | } |
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 43cf901d7659..a66735f75963 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
| @@ -347,7 +347,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) | |||
| 347 | * socket up. We've got bigger problems than | 347 | * socket up. We've got bigger problems than |
| 348 | * non-graceful socket closings. | 348 | * non-graceful socket closings. |
| 349 | */ | 349 | */ |
| 350 | LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow\n"); | 350 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW); |
| 351 | } | 351 | } |
| 352 | 352 | ||
| 353 | tcp_update_metrics(sk); | 353 | tcp_update_metrics(sk); |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 05b1ecf36763..61c2463e2753 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -231,11 +231,10 @@ void tcp_select_initial_window(int __space, __u32 mss, | |||
| 231 | /* when initializing use the value from init_rcv_wnd | 231 | /* when initializing use the value from init_rcv_wnd |
| 232 | * rather than the default from above | 232 | * rather than the default from above |
| 233 | */ | 233 | */ |
| 234 | if (init_rcv_wnd && | 234 | if (init_rcv_wnd) |
| 235 | (*rcv_wnd > init_rcv_wnd * mss)) | 235 | *rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss); |
| 236 | *rcv_wnd = init_rcv_wnd * mss; | 236 | else |
| 237 | else if (*rcv_wnd > init_cwnd * mss) | 237 | *rcv_wnd = min(*rcv_wnd, init_cwnd * mss); |
| 238 | *rcv_wnd = init_cwnd * mss; | ||
| 239 | } | 238 | } |
| 240 | 239 | ||
| 241 | /* Set the clamp no higher than max representable value */ | 240 | /* Set the clamp no higher than max representable value */ |
| @@ -386,27 +385,30 @@ struct tcp_out_options { | |||
| 386 | */ | 385 | */ |
| 387 | static u8 tcp_cookie_size_check(u8 desired) | 386 | static u8 tcp_cookie_size_check(u8 desired) |
| 388 | { | 387 | { |
| 389 | if (desired > 0) { | 388 | int cookie_size; |
| 389 | |||
| 390 | if (desired > 0) | ||
| 390 | /* previously specified */ | 391 | /* previously specified */ |
| 391 | return desired; | 392 | return desired; |
| 392 | } | 393 | |
| 393 | if (sysctl_tcp_cookie_size <= 0) { | 394 | cookie_size = ACCESS_ONCE(sysctl_tcp_cookie_size); |
| 395 | if (cookie_size <= 0) | ||
| 394 | /* no default specified */ | 396 | /* no default specified */ |
| 395 | return 0; | 397 | return 0; |
| 396 | } | 398 | |
| 397 | if (sysctl_tcp_cookie_size <= TCP_COOKIE_MIN) { | 399 | if (cookie_size <= TCP_COOKIE_MIN) |
| 398 | /* value too small, specify minimum */ | 400 | /* value too small, specify minimum */ |
| 399 | return TCP_COOKIE_MIN; | 401 | return TCP_COOKIE_MIN; |
| 400 | } | 402 | |
| 401 | if (sysctl_tcp_cookie_size >= TCP_COOKIE_MAX) { | 403 | if (cookie_size >= TCP_COOKIE_MAX) |
| 402 | /* value too large, specify maximum */ | 404 | /* value too large, specify maximum */ |
| 403 | return TCP_COOKIE_MAX; | 405 | return TCP_COOKIE_MAX; |
| 404 | } | 406 | |
| 405 | if (0x1 & sysctl_tcp_cookie_size) { | 407 | if (cookie_size & 1) |
| 406 | /* 8-bit multiple, illegal, fix it */ | 408 | /* 8-bit multiple, illegal, fix it */ |
| 407 | return (u8)(sysctl_tcp_cookie_size + 0x1); | 409 | cookie_size++; |
| 408 | } | 410 | |
| 409 | return (u8)sysctl_tcp_cookie_size; | 411 | return (u8)cookie_size; |
| 410 | } | 412 | } |
| 411 | 413 | ||
| 412 | /* Write previously computed TCP options to the packet. | 414 | /* Write previously computed TCP options to the packet. |
| @@ -1513,6 +1515,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) | |||
| 1513 | struct tcp_sock *tp = tcp_sk(sk); | 1515 | struct tcp_sock *tp = tcp_sk(sk); |
| 1514 | const struct inet_connection_sock *icsk = inet_csk(sk); | 1516 | const struct inet_connection_sock *icsk = inet_csk(sk); |
| 1515 | u32 send_win, cong_win, limit, in_flight; | 1517 | u32 send_win, cong_win, limit, in_flight; |
| 1518 | int win_divisor; | ||
| 1516 | 1519 | ||
| 1517 | if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) | 1520 | if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) |
| 1518 | goto send_now; | 1521 | goto send_now; |
| @@ -1544,13 +1547,14 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) | |||
| 1544 | if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) | 1547 | if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) |
| 1545 | goto send_now; | 1548 | goto send_now; |
| 1546 | 1549 | ||
| 1547 | if (sysctl_tcp_tso_win_divisor) { | 1550 | win_divisor = ACCESS_ONCE(sysctl_tcp_tso_win_divisor); |
| 1551 | if (win_divisor) { | ||
| 1548 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); | 1552 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); |
| 1549 | 1553 | ||
| 1550 | /* If at least some fraction of a window is available, | 1554 | /* If at least some fraction of a window is available, |
| 1551 | * just use it. | 1555 | * just use it. |
| 1552 | */ | 1556 | */ |
| 1553 | chunk /= sysctl_tcp_tso_win_divisor; | 1557 | chunk /= win_divisor; |
| 1554 | if (limit >= chunk) | 1558 | if (limit >= chunk) |
| 1555 | goto send_now; | 1559 | goto send_now; |
| 1556 | } else { | 1560 | } else { |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 23cc8e1ce8d4..93b7a933a775 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -4021,11 +4021,11 @@ void inet6_ifinfo_notify(int event, struct inet6_dev *idev) | |||
| 4021 | kfree_skb(skb); | 4021 | kfree_skb(skb); |
| 4022 | goto errout; | 4022 | goto errout; |
| 4023 | } | 4023 | } |
| 4024 | rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); | 4024 | rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFINFO, NULL, GFP_ATOMIC); |
| 4025 | return; | 4025 | return; |
| 4026 | errout: | 4026 | errout: |
| 4027 | if (err < 0) | 4027 | if (err < 0) |
| 4028 | rtnl_set_sk_err(net, RTNLGRP_IPV6_IFADDR, err); | 4028 | rtnl_set_sk_err(net, RTNLGRP_IPV6_IFINFO, err); |
| 4029 | } | 4029 | } |
| 4030 | 4030 | ||
| 4031 | static inline size_t inet6_prefix_nlmsg_size(void) | 4031 | static inline size_t inet6_prefix_nlmsg_size(void) |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 2a59610c2a58..70e891a20fb9 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
| @@ -1175,6 +1175,8 @@ static void ip6_tnl_link_config(struct ip6_tnl *t) | |||
| 1175 | sizeof (struct ipv6hdr); | 1175 | sizeof (struct ipv6hdr); |
| 1176 | 1176 | ||
| 1177 | dev->mtu = rt->rt6i_dev->mtu - sizeof (struct ipv6hdr); | 1177 | dev->mtu = rt->rt6i_dev->mtu - sizeof (struct ipv6hdr); |
| 1178 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | ||
| 1179 | dev->mtu-=8; | ||
| 1178 | 1180 | ||
| 1179 | if (dev->mtu < IPV6_MIN_MTU) | 1181 | if (dev->mtu < IPV6_MIN_MTU) |
| 1180 | dev->mtu = IPV6_MIN_MTU; | 1182 | dev->mtu = IPV6_MIN_MTU; |
| @@ -1363,12 +1365,17 @@ static const struct net_device_ops ip6_tnl_netdev_ops = { | |||
| 1363 | 1365 | ||
| 1364 | static void ip6_tnl_dev_setup(struct net_device *dev) | 1366 | static void ip6_tnl_dev_setup(struct net_device *dev) |
| 1365 | { | 1367 | { |
| 1368 | struct ip6_tnl *t; | ||
| 1369 | |||
| 1366 | dev->netdev_ops = &ip6_tnl_netdev_ops; | 1370 | dev->netdev_ops = &ip6_tnl_netdev_ops; |
| 1367 | dev->destructor = ip6_dev_free; | 1371 | dev->destructor = ip6_dev_free; |
| 1368 | 1372 | ||
| 1369 | dev->type = ARPHRD_TUNNEL6; | 1373 | dev->type = ARPHRD_TUNNEL6; |
| 1370 | dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); | 1374 | dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); |
| 1371 | dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); | 1375 | dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); |
| 1376 | t = netdev_priv(dev); | ||
| 1377 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | ||
| 1378 | dev->mtu-=8; | ||
| 1372 | dev->flags |= IFF_NOARP; | 1379 | dev->flags |= IFF_NOARP; |
| 1373 | dev->addr_len = sizeof(struct in6_addr); | 1380 | dev->addr_len = sizeof(struct in6_addr); |
| 1374 | dev->features |= NETIF_F_NETNS_LOCAL; | 1381 | dev->features |= NETIF_F_NETNS_LOCAL; |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index d6bfaec3bbbf..8c4d00c7cd2b 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
| @@ -606,8 +606,9 @@ static int ipip6_rcv(struct sk_buff *skb) | |||
| 606 | return 0; | 606 | return 0; |
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); | 609 | /* no tunnel matched, let upstream know, ipsec may handle it */ |
| 610 | rcu_read_unlock(); | 610 | rcu_read_unlock(); |
| 611 | return 1; | ||
| 611 | out: | 612 | out: |
| 612 | kfree_skb(skb); | 613 | kfree_skb(skb); |
| 613 | return 0; | 614 | return 0; |
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 0bf6a59545ab..522e219f3558 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
| @@ -674,4 +674,8 @@ MODULE_LICENSE("GPL"); | |||
| 674 | MODULE_AUTHOR("James Chapman <jchapman@katalix.com>"); | 674 | MODULE_AUTHOR("James Chapman <jchapman@katalix.com>"); |
| 675 | MODULE_DESCRIPTION("L2TP over IP"); | 675 | MODULE_DESCRIPTION("L2TP over IP"); |
| 676 | MODULE_VERSION("1.0"); | 676 | MODULE_VERSION("1.0"); |
| 677 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, SOCK_DGRAM, IPPROTO_L2TP); | 677 | |
| 678 | /* Use the value of SOCK_DGRAM (2) directory, because __stringify does't like | ||
| 679 | * enums | ||
| 680 | */ | ||
| 681 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP); | ||
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 582612998211..e35dbe55f520 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
| @@ -317,8 +317,9 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) | |||
| 317 | goto out; | 317 | goto out; |
| 318 | rc = -ENODEV; | 318 | rc = -ENODEV; |
| 319 | rtnl_lock(); | 319 | rtnl_lock(); |
| 320 | rcu_read_lock(); | ||
| 320 | if (sk->sk_bound_dev_if) { | 321 | if (sk->sk_bound_dev_if) { |
| 321 | llc->dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if); | 322 | llc->dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if); |
| 322 | if (llc->dev) { | 323 | if (llc->dev) { |
| 323 | if (!addr->sllc_arphrd) | 324 | if (!addr->sllc_arphrd) |
| 324 | addr->sllc_arphrd = llc->dev->type; | 325 | addr->sllc_arphrd = llc->dev->type; |
| @@ -329,13 +330,13 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) | |||
| 329 | !llc_mac_match(addr->sllc_mac, | 330 | !llc_mac_match(addr->sllc_mac, |
| 330 | llc->dev->dev_addr)) { | 331 | llc->dev->dev_addr)) { |
| 331 | rc = -EINVAL; | 332 | rc = -EINVAL; |
| 332 | dev_put(llc->dev); | ||
| 333 | llc->dev = NULL; | 333 | llc->dev = NULL; |
| 334 | } | 334 | } |
| 335 | } | 335 | } |
| 336 | } else | 336 | } else |
| 337 | llc->dev = dev_getbyhwaddr(&init_net, addr->sllc_arphrd, | 337 | llc->dev = dev_getbyhwaddr(&init_net, addr->sllc_arphrd, |
| 338 | addr->sllc_mac); | 338 | addr->sllc_mac); |
| 339 | rcu_read_unlock(); | ||
| 339 | rtnl_unlock(); | 340 | rtnl_unlock(); |
| 340 | if (!llc->dev) | 341 | if (!llc->dev) |
| 341 | goto out; | 342 | goto out; |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 902b03ee8f60..54fb4a0e76f0 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -2247,6 +2247,10 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) | |||
| 2247 | break; | 2247 | break; |
| 2248 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): | 2248 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): |
| 2249 | case cpu_to_le16(IEEE80211_STYPE_DISASSOC): | 2249 | case cpu_to_le16(IEEE80211_STYPE_DISASSOC): |
| 2250 | if (is_multicast_ether_addr(mgmt->da) && | ||
| 2251 | !is_broadcast_ether_addr(mgmt->da)) | ||
| 2252 | return RX_DROP_MONITOR; | ||
| 2253 | |||
| 2250 | /* process only for station */ | 2254 | /* process only for station */ |
| 2251 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 2255 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| 2252 | return RX_DROP_MONITOR; | 2256 | return RX_DROP_MONITOR; |
| @@ -2741,6 +2745,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
| 2741 | 2745 | ||
| 2742 | if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) | 2746 | if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) |
| 2743 | return; | 2747 | return; |
| 2748 | goto out; | ||
| 2744 | } | 2749 | } |
| 2745 | } | 2750 | } |
| 2746 | 2751 | ||
| @@ -2780,6 +2785,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
| 2780 | return; | 2785 | return; |
| 2781 | } | 2786 | } |
| 2782 | 2787 | ||
| 2788 | out: | ||
| 2783 | dev_kfree_skb(skb); | 2789 | dev_kfree_skb(skb); |
| 2784 | } | 2790 | } |
| 2785 | 2791 | ||
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 96c594309506..7a637b80a62e 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
| @@ -1587,7 +1587,12 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, | |||
| 1587 | list) { | 1587 | list) { |
| 1588 | if (!ieee80211_sdata_running(tmp_sdata)) | 1588 | if (!ieee80211_sdata_running(tmp_sdata)) |
| 1589 | continue; | 1589 | continue; |
| 1590 | if (tmp_sdata->vif.type != NL80211_IFTYPE_AP) | 1590 | if (tmp_sdata->vif.type == |
| 1591 | NL80211_IFTYPE_MONITOR || | ||
| 1592 | tmp_sdata->vif.type == | ||
| 1593 | NL80211_IFTYPE_AP_VLAN || | ||
| 1594 | tmp_sdata->vif.type == | ||
| 1595 | NL80211_IFTYPE_WDS) | ||
| 1591 | continue; | 1596 | continue; |
| 1592 | if (compare_ether_addr(tmp_sdata->vif.addr, | 1597 | if (compare_ether_addr(tmp_sdata->vif.addr, |
| 1593 | hdr->addr2) == 0) { | 1598 | hdr->addr2) == 0) { |
| @@ -1732,15 +1737,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
| 1732 | int nh_pos, h_pos; | 1737 | int nh_pos, h_pos; |
| 1733 | struct sta_info *sta = NULL; | 1738 | struct sta_info *sta = NULL; |
| 1734 | u32 sta_flags = 0; | 1739 | u32 sta_flags = 0; |
| 1740 | struct sk_buff *tmp_skb; | ||
| 1735 | 1741 | ||
| 1736 | if (unlikely(skb->len < ETH_HLEN)) { | 1742 | if (unlikely(skb->len < ETH_HLEN)) { |
| 1737 | ret = NETDEV_TX_OK; | 1743 | ret = NETDEV_TX_OK; |
| 1738 | goto fail; | 1744 | goto fail; |
| 1739 | } | 1745 | } |
| 1740 | 1746 | ||
| 1741 | nh_pos = skb_network_header(skb) - skb->data; | ||
| 1742 | h_pos = skb_transport_header(skb) - skb->data; | ||
| 1743 | |||
| 1744 | /* convert Ethernet header to proper 802.11 header (based on | 1747 | /* convert Ethernet header to proper 802.11 header (based on |
| 1745 | * operation mode) */ | 1748 | * operation mode) */ |
| 1746 | ethertype = (skb->data[12] << 8) | skb->data[13]; | 1749 | ethertype = (skb->data[12] << 8) | skb->data[13]; |
| @@ -1913,6 +1916,20 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
| 1913 | goto fail; | 1916 | goto fail; |
| 1914 | } | 1917 | } |
| 1915 | 1918 | ||
| 1919 | /* | ||
| 1920 | * If the skb is shared we need to obtain our own copy. | ||
| 1921 | */ | ||
| 1922 | if (skb_shared(skb)) { | ||
| 1923 | tmp_skb = skb; | ||
| 1924 | skb = skb_copy(skb, GFP_ATOMIC); | ||
| 1925 | kfree_skb(tmp_skb); | ||
| 1926 | |||
| 1927 | if (!skb) { | ||
| 1928 | ret = NETDEV_TX_OK; | ||
| 1929 | goto fail; | ||
| 1930 | } | ||
| 1931 | } | ||
| 1932 | |||
| 1916 | hdr.frame_control = fc; | 1933 | hdr.frame_control = fc; |
| 1917 | hdr.duration_id = 0; | 1934 | hdr.duration_id = 0; |
| 1918 | hdr.seq_ctrl = 0; | 1935 | hdr.seq_ctrl = 0; |
| @@ -1931,6 +1948,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
| 1931 | encaps_len = 0; | 1948 | encaps_len = 0; |
| 1932 | } | 1949 | } |
| 1933 | 1950 | ||
| 1951 | nh_pos = skb_network_header(skb) - skb->data; | ||
| 1952 | h_pos = skb_transport_header(skb) - skb->data; | ||
| 1953 | |||
| 1934 | skb_pull(skb, skip_header_bytes); | 1954 | skb_pull(skb, skip_header_bytes); |
| 1935 | nh_pos -= skip_header_bytes; | 1955 | nh_pos -= skip_header_bytes; |
| 1936 | h_pos -= skip_header_bytes; | 1956 | h_pos -= skip_header_bytes; |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 6bd554323a34..0b9ee34ad35c 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
| @@ -2932,6 +2932,7 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva | |||
| 2932 | struct sctp_association *asoc = NULL; | 2932 | struct sctp_association *asoc = NULL; |
| 2933 | struct sctp_setpeerprim prim; | 2933 | struct sctp_setpeerprim prim; |
| 2934 | struct sctp_chunk *chunk; | 2934 | struct sctp_chunk *chunk; |
| 2935 | struct sctp_af *af; | ||
| 2935 | int err; | 2936 | int err; |
| 2936 | 2937 | ||
| 2937 | sp = sctp_sk(sk); | 2938 | sp = sctp_sk(sk); |
| @@ -2959,6 +2960,13 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva | |||
| 2959 | if (!sctp_state(asoc, ESTABLISHED)) | 2960 | if (!sctp_state(asoc, ESTABLISHED)) |
| 2960 | return -ENOTCONN; | 2961 | return -ENOTCONN; |
| 2961 | 2962 | ||
| 2963 | af = sctp_get_af_specific(prim.sspp_addr.ss_family); | ||
| 2964 | if (!af) | ||
| 2965 | return -EINVAL; | ||
| 2966 | |||
| 2967 | if (!af->addr_valid((union sctp_addr *)&prim.sspp_addr, sp, NULL)) | ||
| 2968 | return -EADDRNOTAVAIL; | ||
| 2969 | |||
| 2962 | if (!sctp_assoc_lookup_laddr(asoc, (union sctp_addr *)&prim.sspp_addr)) | 2970 | if (!sctp_assoc_lookup_laddr(asoc, (union sctp_addr *)&prim.sspp_addr)) |
| 2963 | return -EADDRNOTAVAIL; | 2971 | return -EADDRNOTAVAIL; |
| 2964 | 2972 | ||
diff --git a/net/socket.c b/net/socket.c index 3ca2fd9e3720..088fb3fd45e0 100644 --- a/net/socket.c +++ b/net/socket.c | |||
| @@ -732,6 +732,21 @@ static int sock_recvmsg_nosec(struct socket *sock, struct msghdr *msg, | |||
| 732 | return ret; | 732 | return ret; |
| 733 | } | 733 | } |
| 734 | 734 | ||
| 735 | /** | ||
| 736 | * kernel_recvmsg - Receive a message from a socket (kernel space) | ||
| 737 | * @sock: The socket to receive the message from | ||
| 738 | * @msg: Received message | ||
| 739 | * @vec: Input s/g array for message data | ||
| 740 | * @num: Size of input s/g array | ||
| 741 | * @size: Number of bytes to read | ||
| 742 | * @flags: Message flags (MSG_DONTWAIT, etc...) | ||
| 743 | * | ||
| 744 | * On return the msg structure contains the scatter/gather array passed in the | ||
| 745 | * vec argument. The array is modified so that it consists of the unfilled | ||
| 746 | * portion of the original array. | ||
| 747 | * | ||
| 748 | * The returned value is the total number of bytes received, or an error. | ||
| 749 | */ | ||
| 735 | int kernel_recvmsg(struct socket *sock, struct msghdr *msg, | 750 | int kernel_recvmsg(struct socket *sock, struct msghdr *msg, |
| 736 | struct kvec *vec, size_t num, size_t size, int flags) | 751 | struct kvec *vec, size_t num, size_t size, int flags) |
| 737 | { | 752 | { |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 3c95304a0817..2268e6798124 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
| @@ -1343,9 +1343,25 @@ static void unix_destruct_scm(struct sk_buff *skb) | |||
| 1343 | sock_wfree(skb); | 1343 | sock_wfree(skb); |
| 1344 | } | 1344 | } |
| 1345 | 1345 | ||
| 1346 | #define MAX_RECURSION_LEVEL 4 | ||
| 1347 | |||
| 1346 | static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb) | 1348 | static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb) |
| 1347 | { | 1349 | { |
| 1348 | int i; | 1350 | int i; |
| 1351 | unsigned char max_level = 0; | ||
| 1352 | int unix_sock_count = 0; | ||
| 1353 | |||
| 1354 | for (i = scm->fp->count - 1; i >= 0; i--) { | ||
| 1355 | struct sock *sk = unix_get_socket(scm->fp->fp[i]); | ||
| 1356 | |||
| 1357 | if (sk) { | ||
| 1358 | unix_sock_count++; | ||
| 1359 | max_level = max(max_level, | ||
| 1360 | unix_sk(sk)->recursion_level); | ||
| 1361 | } | ||
| 1362 | } | ||
| 1363 | if (unlikely(max_level > MAX_RECURSION_LEVEL)) | ||
| 1364 | return -ETOOMANYREFS; | ||
| 1349 | 1365 | ||
| 1350 | /* | 1366 | /* |
| 1351 | * Need to duplicate file references for the sake of garbage | 1367 | * Need to duplicate file references for the sake of garbage |
| @@ -1356,9 +1372,11 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb) | |||
| 1356 | if (!UNIXCB(skb).fp) | 1372 | if (!UNIXCB(skb).fp) |
| 1357 | return -ENOMEM; | 1373 | return -ENOMEM; |
| 1358 | 1374 | ||
| 1359 | for (i = scm->fp->count-1; i >= 0; i--) | 1375 | if (unix_sock_count) { |
| 1360 | unix_inflight(scm->fp->fp[i]); | 1376 | for (i = scm->fp->count - 1; i >= 0; i--) |
| 1361 | return 0; | 1377 | unix_inflight(scm->fp->fp[i]); |
| 1378 | } | ||
| 1379 | return max_level; | ||
| 1362 | } | 1380 | } |
| 1363 | 1381 | ||
| 1364 | static int unix_scm_to_skb(struct scm_cookie *scm, struct sk_buff *skb, bool send_fds) | 1382 | static int unix_scm_to_skb(struct scm_cookie *scm, struct sk_buff *skb, bool send_fds) |
| @@ -1393,6 +1411,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
| 1393 | struct sk_buff *skb; | 1411 | struct sk_buff *skb; |
| 1394 | long timeo; | 1412 | long timeo; |
| 1395 | struct scm_cookie tmp_scm; | 1413 | struct scm_cookie tmp_scm; |
| 1414 | int max_level; | ||
| 1396 | 1415 | ||
| 1397 | if (NULL == siocb->scm) | 1416 | if (NULL == siocb->scm) |
| 1398 | siocb->scm = &tmp_scm; | 1417 | siocb->scm = &tmp_scm; |
| @@ -1431,8 +1450,9 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
| 1431 | goto out; | 1450 | goto out; |
| 1432 | 1451 | ||
| 1433 | err = unix_scm_to_skb(siocb->scm, skb, true); | 1452 | err = unix_scm_to_skb(siocb->scm, skb, true); |
| 1434 | if (err) | 1453 | if (err < 0) |
| 1435 | goto out_free; | 1454 | goto out_free; |
| 1455 | max_level = err + 1; | ||
| 1436 | unix_get_secdata(siocb->scm, skb); | 1456 | unix_get_secdata(siocb->scm, skb); |
| 1437 | 1457 | ||
| 1438 | skb_reset_transport_header(skb); | 1458 | skb_reset_transport_header(skb); |
| @@ -1514,6 +1534,8 @@ restart: | |||
| 1514 | if (sock_flag(other, SOCK_RCVTSTAMP)) | 1534 | if (sock_flag(other, SOCK_RCVTSTAMP)) |
| 1515 | __net_timestamp(skb); | 1535 | __net_timestamp(skb); |
| 1516 | skb_queue_tail(&other->sk_receive_queue, skb); | 1536 | skb_queue_tail(&other->sk_receive_queue, skb); |
| 1537 | if (max_level > unix_sk(other)->recursion_level) | ||
| 1538 | unix_sk(other)->recursion_level = max_level; | ||
| 1517 | unix_state_unlock(other); | 1539 | unix_state_unlock(other); |
| 1518 | other->sk_data_ready(other, len); | 1540 | other->sk_data_ready(other, len); |
| 1519 | sock_put(other); | 1541 | sock_put(other); |
| @@ -1544,6 +1566,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
| 1544 | int sent = 0; | 1566 | int sent = 0; |
| 1545 | struct scm_cookie tmp_scm; | 1567 | struct scm_cookie tmp_scm; |
| 1546 | bool fds_sent = false; | 1568 | bool fds_sent = false; |
| 1569 | int max_level; | ||
| 1547 | 1570 | ||
| 1548 | if (NULL == siocb->scm) | 1571 | if (NULL == siocb->scm) |
| 1549 | siocb->scm = &tmp_scm; | 1572 | siocb->scm = &tmp_scm; |
| @@ -1607,10 +1630,11 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
| 1607 | 1630 | ||
| 1608 | /* Only send the fds in the first buffer */ | 1631 | /* Only send the fds in the first buffer */ |
| 1609 | err = unix_scm_to_skb(siocb->scm, skb, !fds_sent); | 1632 | err = unix_scm_to_skb(siocb->scm, skb, !fds_sent); |
| 1610 | if (err) { | 1633 | if (err < 0) { |
| 1611 | kfree_skb(skb); | 1634 | kfree_skb(skb); |
| 1612 | goto out_err; | 1635 | goto out_err; |
| 1613 | } | 1636 | } |
| 1637 | max_level = err + 1; | ||
| 1614 | fds_sent = true; | 1638 | fds_sent = true; |
| 1615 | 1639 | ||
| 1616 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); | 1640 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); |
| @@ -1626,6 +1650,8 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
| 1626 | goto pipe_err_free; | 1650 | goto pipe_err_free; |
| 1627 | 1651 | ||
| 1628 | skb_queue_tail(&other->sk_receive_queue, skb); | 1652 | skb_queue_tail(&other->sk_receive_queue, skb); |
| 1653 | if (max_level > unix_sk(other)->recursion_level) | ||
| 1654 | unix_sk(other)->recursion_level = max_level; | ||
| 1629 | unix_state_unlock(other); | 1655 | unix_state_unlock(other); |
| 1630 | other->sk_data_ready(other, size); | 1656 | other->sk_data_ready(other, size); |
| 1631 | sent += size; | 1657 | sent += size; |
| @@ -1845,6 +1871,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 1845 | unix_state_lock(sk); | 1871 | unix_state_lock(sk); |
| 1846 | skb = skb_dequeue(&sk->sk_receive_queue); | 1872 | skb = skb_dequeue(&sk->sk_receive_queue); |
| 1847 | if (skb == NULL) { | 1873 | if (skb == NULL) { |
| 1874 | unix_sk(sk)->recursion_level = 0; | ||
| 1848 | if (copied >= target) | 1875 | if (copied >= target) |
| 1849 | goto unlock; | 1876 | goto unlock; |
| 1850 | 1877 | ||
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 40df93d1cf35..f89f83bf828e 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c | |||
| @@ -96,7 +96,7 @@ static DECLARE_WAIT_QUEUE_HEAD(unix_gc_wait); | |||
| 96 | unsigned int unix_tot_inflight; | 96 | unsigned int unix_tot_inflight; |
| 97 | 97 | ||
| 98 | 98 | ||
| 99 | static struct sock *unix_get_socket(struct file *filp) | 99 | struct sock *unix_get_socket(struct file *filp) |
| 100 | { | 100 | { |
| 101 | struct sock *u_sock = NULL; | 101 | struct sock *u_sock = NULL; |
| 102 | struct inode *inode = filp->f_path.dentry->d_inode; | 102 | struct inode *inode = filp->f_path.dentry->d_inode; |
diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c index 73e7b954ad28..b25c6463c3e9 100644 --- a/net/x25/x25_link.c +++ b/net/x25/x25_link.c | |||
| @@ -394,6 +394,7 @@ void __exit x25_link_free(void) | |||
| 394 | list_for_each_safe(entry, tmp, &x25_neigh_list) { | 394 | list_for_each_safe(entry, tmp, &x25_neigh_list) { |
| 395 | nb = list_entry(entry, struct x25_neigh, node); | 395 | nb = list_entry(entry, struct x25_neigh, node); |
| 396 | __x25_remove_neigh(nb); | 396 | __x25_remove_neigh(nb); |
| 397 | dev_put(nb->dev); | ||
| 397 | } | 398 | } |
| 398 | write_unlock_bh(&x25_neigh_list_lock); | 399 | write_unlock_bh(&x25_neigh_list_lock); |
| 399 | } | 400 | } |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index eb96ce52f178..220ebc05c7af 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
| @@ -1268,7 +1268,7 @@ struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x, | |||
| 1268 | 1268 | ||
| 1269 | return xc; | 1269 | return xc; |
| 1270 | error: | 1270 | error: |
| 1271 | kfree(xc); | 1271 | xfrm_state_put(xc); |
| 1272 | return NULL; | 1272 | return NULL; |
| 1273 | } | 1273 | } |
| 1274 | EXPORT_SYMBOL(xfrm_state_migrate); | 1274 | EXPORT_SYMBOL(xfrm_state_migrate); |
