diff options
70 files changed, 458 insertions, 202 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 2a5e60fb3b5d..f5630a5b3f49 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -5943,7 +5943,6 @@ F: include/linux/tty.h | |||
5943 | 5943 | ||
5944 | TULIP NETWORK DRIVERS | 5944 | TULIP NETWORK DRIVERS |
5945 | M: Grant Grundler <grundler@parisc-linux.org> | 5945 | M: Grant Grundler <grundler@parisc-linux.org> |
5946 | M: Kyle McMartin <kyle@mcmartin.ca> | ||
5947 | L: netdev@vger.kernel.org | 5946 | L: netdev@vger.kernel.org |
5948 | S: Maintained | 5947 | S: Maintained |
5949 | F: drivers/net/tulip/ | 5948 | 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 c09761959354..44f778507770 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 930051d941a7..52880c8387d8 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
@@ -2588,7 +2588,7 @@ static int __devinit lanai_init_one(struct pci_dev *pci, | |||
2588 | return -ENOMEM; | 2588 | return -ENOMEM; |
2589 | } | 2589 | } |
2590 | 2590 | ||
2591 | atmdev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); | 2591 | atmdev = atm_dev_register(DEV_LABEL, &pci->dev, &ops, -1, NULL); |
2592 | if (atmdev == NULL) { | 2592 | if (atmdev == NULL) { |
2593 | printk(KERN_ERR DEV_LABEL | 2593 | printk(KERN_ERR DEV_LABEL |
2594 | ": couldn't register atm device!\n"); | 2594 | ": 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/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 720148294e64..3c6cabcb7d84 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c | |||
@@ -311,8 +311,10 @@ static void hci_uart_tty_close(struct tty_struct *tty) | |||
311 | 311 | ||
312 | if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) { | 312 | if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) { |
313 | hu->proto->close(hu); | 313 | hu->proto->close(hu); |
314 | hci_unregister_dev(hdev); | 314 | if (hdev) { |
315 | hci_free_dev(hdev); | 315 | hci_unregister_dev(hdev); |
316 | hci_free_dev(hdev); | ||
317 | } | ||
316 | } | 318 | } |
317 | } | 319 | } |
318 | } | 320 | } |
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/benet/be.h b/drivers/net/benet/be.h index 9cab32328bba..add0b93350dd 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -242,7 +242,7 @@ struct be_adapter { | |||
242 | u8 __iomem *db; /* Door Bell */ | 242 | u8 __iomem *db; /* Door Bell */ |
243 | u8 __iomem *pcicfg; /* PCI config space */ | 243 | u8 __iomem *pcicfg; /* PCI config space */ |
244 | 244 | ||
245 | spinlock_t mbox_lock; /* For serializing mbox cmds to BE card */ | 245 | struct mutex mbox_lock; /* For serializing mbox cmds to BE card */ |
246 | struct be_dma_mem mbox_mem; | 246 | struct be_dma_mem mbox_mem; |
247 | /* Mbox mem is adjusted to align to 16 bytes. The allocated addr | 247 | /* Mbox mem is adjusted to align to 16 bytes. The allocated addr |
248 | * is stored for freeing purpose */ | 248 | * is stored for freeing purpose */ |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 171a08caf2be..0c7811faf72c 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -467,7 +467,8 @@ int be_cmd_fw_init(struct be_adapter *adapter) | |||
467 | u8 *wrb; | 467 | u8 *wrb; |
468 | int status; | 468 | int status; |
469 | 469 | ||
470 | spin_lock(&adapter->mbox_lock); | 470 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
471 | return -1; | ||
471 | 472 | ||
472 | wrb = (u8 *)wrb_from_mbox(adapter); | 473 | wrb = (u8 *)wrb_from_mbox(adapter); |
473 | *wrb++ = 0xFF; | 474 | *wrb++ = 0xFF; |
@@ -481,7 +482,7 @@ int be_cmd_fw_init(struct be_adapter *adapter) | |||
481 | 482 | ||
482 | status = be_mbox_notify_wait(adapter); | 483 | status = be_mbox_notify_wait(adapter); |
483 | 484 | ||
484 | spin_unlock(&adapter->mbox_lock); | 485 | mutex_unlock(&adapter->mbox_lock); |
485 | return status; | 486 | return status; |
486 | } | 487 | } |
487 | 488 | ||
@@ -496,7 +497,8 @@ int be_cmd_fw_clean(struct be_adapter *adapter) | |||
496 | if (adapter->eeh_err) | 497 | if (adapter->eeh_err) |
497 | return -EIO; | 498 | return -EIO; |
498 | 499 | ||
499 | spin_lock(&adapter->mbox_lock); | 500 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
501 | return -1; | ||
500 | 502 | ||
501 | wrb = (u8 *)wrb_from_mbox(adapter); | 503 | wrb = (u8 *)wrb_from_mbox(adapter); |
502 | *wrb++ = 0xFF; | 504 | *wrb++ = 0xFF; |
@@ -510,7 +512,7 @@ int be_cmd_fw_clean(struct be_adapter *adapter) | |||
510 | 512 | ||
511 | status = be_mbox_notify_wait(adapter); | 513 | status = be_mbox_notify_wait(adapter); |
512 | 514 | ||
513 | spin_unlock(&adapter->mbox_lock); | 515 | mutex_unlock(&adapter->mbox_lock); |
514 | return status; | 516 | return status; |
515 | } | 517 | } |
516 | int be_cmd_eq_create(struct be_adapter *adapter, | 518 | int be_cmd_eq_create(struct be_adapter *adapter, |
@@ -521,7 +523,8 @@ int be_cmd_eq_create(struct be_adapter *adapter, | |||
521 | struct be_dma_mem *q_mem = &eq->dma_mem; | 523 | struct be_dma_mem *q_mem = &eq->dma_mem; |
522 | int status; | 524 | int status; |
523 | 525 | ||
524 | spin_lock(&adapter->mbox_lock); | 526 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
527 | return -1; | ||
525 | 528 | ||
526 | wrb = wrb_from_mbox(adapter); | 529 | wrb = wrb_from_mbox(adapter); |
527 | req = embedded_payload(wrb); | 530 | req = embedded_payload(wrb); |
@@ -551,7 +554,7 @@ int be_cmd_eq_create(struct be_adapter *adapter, | |||
551 | eq->created = true; | 554 | eq->created = true; |
552 | } | 555 | } |
553 | 556 | ||
554 | spin_unlock(&adapter->mbox_lock); | 557 | mutex_unlock(&adapter->mbox_lock); |
555 | return status; | 558 | return status; |
556 | } | 559 | } |
557 | 560 | ||
@@ -563,7 +566,8 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, | |||
563 | struct be_cmd_req_mac_query *req; | 566 | struct be_cmd_req_mac_query *req; |
564 | int status; | 567 | int status; |
565 | 568 | ||
566 | spin_lock(&adapter->mbox_lock); | 569 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
570 | return -1; | ||
567 | 571 | ||
568 | wrb = wrb_from_mbox(adapter); | 572 | wrb = wrb_from_mbox(adapter); |
569 | req = embedded_payload(wrb); | 573 | req = embedded_payload(wrb); |
@@ -588,7 +592,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, | |||
588 | memcpy(mac_addr, resp->mac.addr, ETH_ALEN); | 592 | memcpy(mac_addr, resp->mac.addr, ETH_ALEN); |
589 | } | 593 | } |
590 | 594 | ||
591 | spin_unlock(&adapter->mbox_lock); | 595 | mutex_unlock(&adapter->mbox_lock); |
592 | return status; | 596 | return status; |
593 | } | 597 | } |
594 | 598 | ||
@@ -672,7 +676,8 @@ int be_cmd_cq_create(struct be_adapter *adapter, | |||
672 | void *ctxt; | 676 | void *ctxt; |
673 | int status; | 677 | int status; |
674 | 678 | ||
675 | spin_lock(&adapter->mbox_lock); | 679 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
680 | return -1; | ||
676 | 681 | ||
677 | wrb = wrb_from_mbox(adapter); | 682 | wrb = wrb_from_mbox(adapter); |
678 | req = embedded_payload(wrb); | 683 | req = embedded_payload(wrb); |
@@ -726,7 +731,7 @@ int be_cmd_cq_create(struct be_adapter *adapter, | |||
726 | cq->created = true; | 731 | cq->created = true; |
727 | } | 732 | } |
728 | 733 | ||
729 | spin_unlock(&adapter->mbox_lock); | 734 | mutex_unlock(&adapter->mbox_lock); |
730 | 735 | ||
731 | return status; | 736 | return status; |
732 | } | 737 | } |
@@ -749,7 +754,8 @@ int be_cmd_mccq_create(struct be_adapter *adapter, | |||
749 | void *ctxt; | 754 | void *ctxt; |
750 | int status; | 755 | int status; |
751 | 756 | ||
752 | spin_lock(&adapter->mbox_lock); | 757 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
758 | return -1; | ||
753 | 759 | ||
754 | wrb = wrb_from_mbox(adapter); | 760 | wrb = wrb_from_mbox(adapter); |
755 | req = embedded_payload(wrb); | 761 | req = embedded_payload(wrb); |
@@ -793,7 +799,7 @@ int be_cmd_mccq_create(struct be_adapter *adapter, | |||
793 | mccq->id = le16_to_cpu(resp->id); | 799 | mccq->id = le16_to_cpu(resp->id); |
794 | mccq->created = true; | 800 | mccq->created = true; |
795 | } | 801 | } |
796 | spin_unlock(&adapter->mbox_lock); | 802 | mutex_unlock(&adapter->mbox_lock); |
797 | 803 | ||
798 | return status; | 804 | return status; |
799 | } | 805 | } |
@@ -808,7 +814,8 @@ int be_cmd_txq_create(struct be_adapter *adapter, | |||
808 | void *ctxt; | 814 | void *ctxt; |
809 | int status; | 815 | int status; |
810 | 816 | ||
811 | spin_lock(&adapter->mbox_lock); | 817 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
818 | return -1; | ||
812 | 819 | ||
813 | wrb = wrb_from_mbox(adapter); | 820 | wrb = wrb_from_mbox(adapter); |
814 | req = embedded_payload(wrb); | 821 | req = embedded_payload(wrb); |
@@ -840,7 +847,7 @@ int be_cmd_txq_create(struct be_adapter *adapter, | |||
840 | txq->created = true; | 847 | txq->created = true; |
841 | } | 848 | } |
842 | 849 | ||
843 | spin_unlock(&adapter->mbox_lock); | 850 | mutex_unlock(&adapter->mbox_lock); |
844 | 851 | ||
845 | return status; | 852 | return status; |
846 | } | 853 | } |
@@ -855,7 +862,8 @@ int be_cmd_rxq_create(struct be_adapter *adapter, | |||
855 | struct be_dma_mem *q_mem = &rxq->dma_mem; | 862 | struct be_dma_mem *q_mem = &rxq->dma_mem; |
856 | int status; | 863 | int status; |
857 | 864 | ||
858 | spin_lock(&adapter->mbox_lock); | 865 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
866 | return -1; | ||
859 | 867 | ||
860 | wrb = wrb_from_mbox(adapter); | 868 | wrb = wrb_from_mbox(adapter); |
861 | req = embedded_payload(wrb); | 869 | req = embedded_payload(wrb); |
@@ -882,7 +890,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter, | |||
882 | *rss_id = resp->rss_id; | 890 | *rss_id = resp->rss_id; |
883 | } | 891 | } |
884 | 892 | ||
885 | spin_unlock(&adapter->mbox_lock); | 893 | mutex_unlock(&adapter->mbox_lock); |
886 | 894 | ||
887 | return status; | 895 | return status; |
888 | } | 896 | } |
@@ -901,7 +909,8 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, | |||
901 | if (adapter->eeh_err) | 909 | if (adapter->eeh_err) |
902 | return -EIO; | 910 | return -EIO; |
903 | 911 | ||
904 | spin_lock(&adapter->mbox_lock); | 912 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
913 | return -1; | ||
905 | 914 | ||
906 | wrb = wrb_from_mbox(adapter); | 915 | wrb = wrb_from_mbox(adapter); |
907 | req = embedded_payload(wrb); | 916 | req = embedded_payload(wrb); |
@@ -938,7 +947,7 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, | |||
938 | 947 | ||
939 | status = be_mbox_notify_wait(adapter); | 948 | status = be_mbox_notify_wait(adapter); |
940 | 949 | ||
941 | spin_unlock(&adapter->mbox_lock); | 950 | mutex_unlock(&adapter->mbox_lock); |
942 | 951 | ||
943 | return status; | 952 | return status; |
944 | } | 953 | } |
@@ -954,7 +963,8 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, | |||
954 | struct be_cmd_req_if_create *req; | 963 | struct be_cmd_req_if_create *req; |
955 | int status; | 964 | int status; |
956 | 965 | ||
957 | spin_lock(&adapter->mbox_lock); | 966 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
967 | return -1; | ||
958 | 968 | ||
959 | wrb = wrb_from_mbox(adapter); | 969 | wrb = wrb_from_mbox(adapter); |
960 | req = embedded_payload(wrb); | 970 | req = embedded_payload(wrb); |
@@ -980,7 +990,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, | |||
980 | *pmac_id = le32_to_cpu(resp->pmac_id); | 990 | *pmac_id = le32_to_cpu(resp->pmac_id); |
981 | } | 991 | } |
982 | 992 | ||
983 | spin_unlock(&adapter->mbox_lock); | 993 | mutex_unlock(&adapter->mbox_lock); |
984 | return status; | 994 | return status; |
985 | } | 995 | } |
986 | 996 | ||
@@ -994,7 +1004,8 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id) | |||
994 | if (adapter->eeh_err) | 1004 | if (adapter->eeh_err) |
995 | return -EIO; | 1005 | return -EIO; |
996 | 1006 | ||
997 | spin_lock(&adapter->mbox_lock); | 1007 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
1008 | return -1; | ||
998 | 1009 | ||
999 | wrb = wrb_from_mbox(adapter); | 1010 | wrb = wrb_from_mbox(adapter); |
1000 | req = embedded_payload(wrb); | 1011 | req = embedded_payload(wrb); |
@@ -1009,7 +1020,7 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id) | |||
1009 | 1020 | ||
1010 | status = be_mbox_notify_wait(adapter); | 1021 | status = be_mbox_notify_wait(adapter); |
1011 | 1022 | ||
1012 | spin_unlock(&adapter->mbox_lock); | 1023 | mutex_unlock(&adapter->mbox_lock); |
1013 | 1024 | ||
1014 | return status; | 1025 | return status; |
1015 | } | 1026 | } |
@@ -1099,7 +1110,8 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver) | |||
1099 | struct be_cmd_req_get_fw_version *req; | 1110 | struct be_cmd_req_get_fw_version *req; |
1100 | int status; | 1111 | int status; |
1101 | 1112 | ||
1102 | spin_lock(&adapter->mbox_lock); | 1113 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
1114 | return -1; | ||
1103 | 1115 | ||
1104 | wrb = wrb_from_mbox(adapter); | 1116 | wrb = wrb_from_mbox(adapter); |
1105 | req = embedded_payload(wrb); | 1117 | req = embedded_payload(wrb); |
@@ -1116,7 +1128,7 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver) | |||
1116 | strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN); | 1128 | strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN); |
1117 | } | 1129 | } |
1118 | 1130 | ||
1119 | spin_unlock(&adapter->mbox_lock); | 1131 | mutex_unlock(&adapter->mbox_lock); |
1120 | return status; | 1132 | return status; |
1121 | } | 1133 | } |
1122 | 1134 | ||
@@ -1361,7 +1373,8 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, | |||
1361 | struct be_cmd_req_query_fw_cfg *req; | 1373 | struct be_cmd_req_query_fw_cfg *req; |
1362 | int status; | 1374 | int status; |
1363 | 1375 | ||
1364 | spin_lock(&adapter->mbox_lock); | 1376 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
1377 | return -1; | ||
1365 | 1378 | ||
1366 | wrb = wrb_from_mbox(adapter); | 1379 | wrb = wrb_from_mbox(adapter); |
1367 | req = embedded_payload(wrb); | 1380 | req = embedded_payload(wrb); |
@@ -1380,7 +1393,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, | |||
1380 | *caps = le32_to_cpu(resp->function_caps); | 1393 | *caps = le32_to_cpu(resp->function_caps); |
1381 | } | 1394 | } |
1382 | 1395 | ||
1383 | spin_unlock(&adapter->mbox_lock); | 1396 | mutex_unlock(&adapter->mbox_lock); |
1384 | return status; | 1397 | return status; |
1385 | } | 1398 | } |
1386 | 1399 | ||
@@ -1391,7 +1404,8 @@ int be_cmd_reset_function(struct be_adapter *adapter) | |||
1391 | struct be_cmd_req_hdr *req; | 1404 | struct be_cmd_req_hdr *req; |
1392 | int status; | 1405 | int status; |
1393 | 1406 | ||
1394 | spin_lock(&adapter->mbox_lock); | 1407 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
1408 | return -1; | ||
1395 | 1409 | ||
1396 | wrb = wrb_from_mbox(adapter); | 1410 | wrb = wrb_from_mbox(adapter); |
1397 | req = embedded_payload(wrb); | 1411 | req = embedded_payload(wrb); |
@@ -1404,7 +1418,7 @@ int be_cmd_reset_function(struct be_adapter *adapter) | |||
1404 | 1418 | ||
1405 | status = be_mbox_notify_wait(adapter); | 1419 | status = be_mbox_notify_wait(adapter); |
1406 | 1420 | ||
1407 | spin_unlock(&adapter->mbox_lock); | 1421 | mutex_unlock(&adapter->mbox_lock); |
1408 | return status; | 1422 | return status; |
1409 | } | 1423 | } |
1410 | 1424 | ||
@@ -1415,7 +1429,8 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size) | |||
1415 | u32 myhash[10]; | 1429 | u32 myhash[10]; |
1416 | int status; | 1430 | int status; |
1417 | 1431 | ||
1418 | spin_lock(&adapter->mbox_lock); | 1432 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
1433 | return -1; | ||
1419 | 1434 | ||
1420 | wrb = wrb_from_mbox(adapter); | 1435 | wrb = wrb_from_mbox(adapter); |
1421 | req = embedded_payload(wrb); | 1436 | req = embedded_payload(wrb); |
@@ -1435,7 +1450,7 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size) | |||
1435 | 1450 | ||
1436 | status = be_mbox_notify_wait(adapter); | 1451 | status = be_mbox_notify_wait(adapter); |
1437 | 1452 | ||
1438 | spin_unlock(&adapter->mbox_lock); | 1453 | mutex_unlock(&adapter->mbox_lock); |
1439 | return status; | 1454 | return status; |
1440 | } | 1455 | } |
1441 | 1456 | ||
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 0b35e4a8bf19..88ce68d63bca 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -2746,7 +2746,7 @@ static int be_ctrl_init(struct be_adapter *adapter) | |||
2746 | } | 2746 | } |
2747 | memset(mc_cmd_mem->va, 0, mc_cmd_mem->size); | 2747 | memset(mc_cmd_mem->va, 0, mc_cmd_mem->size); |
2748 | 2748 | ||
2749 | spin_lock_init(&adapter->mbox_lock); | 2749 | mutex_init(&adapter->mbox_lock); |
2750 | spin_lock_init(&adapter->mcc_lock); | 2750 | spin_lock_init(&adapter->mcc_lock); |
2751 | spin_lock_init(&adapter->mcc_cq_lock); | 2751 | spin_lock_init(&adapter->mcc_cq_lock); |
2752 | 2752 | ||
diff --git a/drivers/net/bonding/bond_ipv6.c b/drivers/net/bonding/bond_ipv6.c index 121b073a6c3f..84fbd4ebd778 100644 --- a/drivers/net/bonding/bond_ipv6.c +++ b/drivers/net/bonding/bond_ipv6.c | |||
@@ -88,7 +88,12 @@ static void bond_na_send(struct net_device *slave_dev, | |||
88 | } | 88 | } |
89 | 89 | ||
90 | if (vlan_id) { | 90 | if (vlan_id) { |
91 | skb = vlan_put_tag(skb, vlan_id); | 91 | /* The Ethernet header is not present yet, so it is |
92 | * too early to insert a VLAN tag. Force use of an | ||
93 | * out-of-line tag here and let dev_hard_start_xmit() | ||
94 | * insert it if the slave hardware can't. | ||
95 | */ | ||
96 | skb = __vlan_hwaccel_put_tag(skb, vlan_id); | ||
92 | if (!skb) { | 97 | if (!skb) { |
93 | pr_err("failed to insert VLAN tag\n"); | 98 | pr_err("failed to insert VLAN tag\n"); |
94 | return; | 99 | return; |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 07011e42cec7..b1025b85acf1 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 = |
@@ -418,36 +418,11 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr) | |||
418 | * @bond: bond device that got this skb for tx. | 418 | * @bond: bond device that got this skb for tx. |
419 | * @skb: hw accel VLAN tagged skb to transmit | 419 | * @skb: hw accel VLAN tagged skb to transmit |
420 | * @slave_dev: slave that is supposed to xmit this skbuff | 420 | * @slave_dev: slave that is supposed to xmit this skbuff |
421 | * | ||
422 | * When the bond gets an skb to transmit that is | ||
423 | * already hardware accelerated VLAN tagged, and it | ||
424 | * needs to relay this skb to a slave that is not | ||
425 | * hw accel capable, the skb needs to be "unaccelerated", | ||
426 | * i.e. strip the hwaccel tag and re-insert it as part | ||
427 | * of the payload. | ||
428 | */ | 421 | */ |
429 | int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, | 422 | int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, |
430 | struct net_device *slave_dev) | 423 | struct net_device *slave_dev) |
431 | { | 424 | { |
432 | unsigned short uninitialized_var(vlan_id); | 425 | skb->dev = slave_dev; |
433 | |||
434 | /* Test vlan_list not vlgrp to catch and handle 802.1p tags */ | ||
435 | if (!list_empty(&bond->vlan_list) && | ||
436 | !(slave_dev->features & NETIF_F_HW_VLAN_TX) && | ||
437 | vlan_get_tag(skb, &vlan_id) == 0) { | ||
438 | skb->dev = slave_dev; | ||
439 | skb = vlan_put_tag(skb, vlan_id); | ||
440 | if (!skb) { | ||
441 | /* vlan_put_tag() frees the skb in case of error, | ||
442 | * so return success here so the calling functions | ||
443 | * won't attempt to free is again. | ||
444 | */ | ||
445 | return 0; | ||
446 | } | ||
447 | } else { | ||
448 | skb->dev = slave_dev; | ||
449 | } | ||
450 | |||
451 | skb->priority = 1; | 426 | skb->priority = 1; |
452 | #ifdef CONFIG_NET_POLL_CONTROLLER | 427 | #ifdef CONFIG_NET_POLL_CONTROLLER |
453 | if (unlikely(bond->dev->priv_flags & IFF_IN_NETPOLL)) { | 428 | if (unlikely(bond->dev->priv_flags & IFF_IN_NETPOLL)) { |
@@ -1197,11 +1172,13 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
1197 | bond_do_fail_over_mac(bond, new_active, | 1172 | bond_do_fail_over_mac(bond, new_active, |
1198 | old_active); | 1173 | old_active); |
1199 | 1174 | ||
1200 | bond->send_grat_arp = bond->params.num_grat_arp; | 1175 | if (netif_running(bond->dev)) { |
1201 | bond_send_gratuitous_arp(bond); | 1176 | bond->send_grat_arp = bond->params.num_grat_arp; |
1177 | bond_send_gratuitous_arp(bond); | ||
1202 | 1178 | ||
1203 | bond->send_unsol_na = bond->params.num_unsol_na; | 1179 | bond->send_unsol_na = bond->params.num_unsol_na; |
1204 | bond_send_unsolicited_na(bond); | 1180 | bond_send_unsolicited_na(bond); |
1181 | } | ||
1205 | 1182 | ||
1206 | write_unlock_bh(&bond->curr_slave_lock); | 1183 | write_unlock_bh(&bond->curr_slave_lock); |
1207 | read_unlock(&bond->lock); | 1184 | read_unlock(&bond->lock); |
@@ -1215,8 +1192,9 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
1215 | 1192 | ||
1216 | /* resend IGMP joins since active slave has changed or | 1193 | /* resend IGMP joins since active slave has changed or |
1217 | * all were sent on curr_active_slave */ | 1194 | * all were sent on curr_active_slave */ |
1218 | if ((USES_PRIMARY(bond->params.mode) && new_active) || | 1195 | if (((USES_PRIMARY(bond->params.mode) && new_active) || |
1219 | bond->params.mode == BOND_MODE_ROUNDROBIN) { | 1196 | bond->params.mode == BOND_MODE_ROUNDROBIN) && |
1197 | netif_running(bond->dev)) { | ||
1220 | bond->igmp_retrans = bond->params.resend_igmp; | 1198 | bond->igmp_retrans = bond->params.resend_igmp; |
1221 | queue_delayed_work(bond->wq, &bond->mcast_work, 0); | 1199 | queue_delayed_work(bond->wq, &bond->mcast_work, 0); |
1222 | } | 1200 | } |
@@ -5299,13 +5277,6 @@ static int __init bonding_init(void) | |||
5299 | if (res) | 5277 | if (res) |
5300 | goto out; | 5278 | goto out; |
5301 | 5279 | ||
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); | 5280 | res = register_pernet_subsys(&bond_net_ops); |
5310 | if (res) | 5281 | if (res) |
5311 | goto out; | 5282 | goto out; |
@@ -5335,9 +5306,6 @@ err: | |||
5335 | rtnl_link_unregister(&bond_link_ops); | 5306 | rtnl_link_unregister(&bond_link_ops); |
5336 | err_link: | 5307 | err_link: |
5337 | unregister_pernet_subsys(&bond_net_ops); | 5308 | unregister_pernet_subsys(&bond_net_ops); |
5338 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
5339 | free_cpumask_var(netpoll_block_tx); | ||
5340 | #endif | ||
5341 | goto out; | 5309 | goto out; |
5342 | 5310 | ||
5343 | } | 5311 | } |
@@ -5355,7 +5323,10 @@ static void __exit bonding_exit(void) | |||
5355 | unregister_pernet_subsys(&bond_net_ops); | 5323 | unregister_pernet_subsys(&bond_net_ops); |
5356 | 5324 | ||
5357 | #ifdef CONFIG_NET_POLL_CONTROLLER | 5325 | #ifdef CONFIG_NET_POLL_CONTROLLER |
5358 | free_cpumask_var(netpoll_block_tx); | 5326 | /* |
5327 | * Make sure we don't have an imbalance on our netpoll blocking | ||
5328 | */ | ||
5329 | WARN_ON(atomic_read(&netpoll_block_tx)); | ||
5359 | #endif | 5330 | #endif |
5360 | } | 5331 | } |
5361 | 5332 | ||
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 03710f8f5c49..4da384cc7603 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 |
@@ -277,11 +273,11 @@ static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct n | |||
277 | 273 | ||
278 | bond_for_each_slave(bond, slave, i) { | 274 | bond_for_each_slave(bond, slave, i) { |
279 | if (slave->dev == slave_dev) { | 275 | if (slave->dev == slave_dev) { |
280 | break; | 276 | return slave; |
281 | } | 277 | } |
282 | } | 278 | } |
283 | 279 | ||
284 | return slave; | 280 | return 0; |
285 | } | 281 | } |
286 | 282 | ||
287 | static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) | 283 | static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) |
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c index f54af48edb93..3c403f895750 100644 --- a/drivers/net/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/cxgb4vf/cxgb4vf_main.c | |||
@@ -2278,6 +2278,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2278 | { | 2278 | { |
2279 | struct sge *s = &adapter->sge; | 2279 | struct sge *s = &adapter->sge; |
2280 | int q10g, n10g, qidx, pidx, qs; | 2280 | int q10g, n10g, qidx, pidx, qs; |
2281 | size_t iqe_size; | ||
2281 | 2282 | ||
2282 | /* | 2283 | /* |
2283 | * We should not be called till we know how many Queue Sets we can | 2284 | * We should not be called till we know how many Queue Sets we can |
@@ -2322,6 +2323,13 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2322 | s->ethqsets = qidx; | 2323 | s->ethqsets = qidx; |
2323 | 2324 | ||
2324 | /* | 2325 | /* |
2326 | * The Ingress Queue Entry Size for our various Response Queues needs | ||
2327 | * to be big enough to accommodate the largest message we can receive | ||
2328 | * from the chip/firmware; which is 64 bytes ... | ||
2329 | */ | ||
2330 | iqe_size = 64; | ||
2331 | |||
2332 | /* | ||
2325 | * Set up default Queue Set parameters ... Start off with the | 2333 | * Set up default Queue Set parameters ... Start off with the |
2326 | * shortest interrupt holdoff timer. | 2334 | * shortest interrupt holdoff timer. |
2327 | */ | 2335 | */ |
@@ -2329,7 +2337,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2329 | struct sge_eth_rxq *rxq = &s->ethrxq[qs]; | 2337 | struct sge_eth_rxq *rxq = &s->ethrxq[qs]; |
2330 | struct sge_eth_txq *txq = &s->ethtxq[qs]; | 2338 | struct sge_eth_txq *txq = &s->ethtxq[qs]; |
2331 | 2339 | ||
2332 | init_rspq(&rxq->rspq, 0, 0, 1024, L1_CACHE_BYTES); | 2340 | init_rspq(&rxq->rspq, 0, 0, 1024, iqe_size); |
2333 | rxq->fl.size = 72; | 2341 | rxq->fl.size = 72; |
2334 | txq->q.size = 1024; | 2342 | txq->q.size = 1024; |
2335 | } | 2343 | } |
@@ -2338,8 +2346,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2338 | * The firmware event queue is used for link state changes and | 2346 | * The firmware event queue is used for link state changes and |
2339 | * notifications of TX DMA completions. | 2347 | * notifications of TX DMA completions. |
2340 | */ | 2348 | */ |
2341 | init_rspq(&s->fw_evtq, SGE_TIMER_RSTRT_CNTR, 0, 512, | 2349 | init_rspq(&s->fw_evtq, SGE_TIMER_RSTRT_CNTR, 0, 512, iqe_size); |
2342 | L1_CACHE_BYTES); | ||
2343 | 2350 | ||
2344 | /* | 2351 | /* |
2345 | * The forwarded interrupt queue is used when we're in MSI interrupt | 2352 | * The forwarded interrupt queue is used when we're in MSI interrupt |
@@ -2355,7 +2362,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2355 | * any time ... | 2362 | * any time ... |
2356 | */ | 2363 | */ |
2357 | init_rspq(&s->intrq, SGE_TIMER_RSTRT_CNTR, 0, MSIX_ENTRIES + 1, | 2364 | init_rspq(&s->intrq, SGE_TIMER_RSTRT_CNTR, 0, MSIX_ENTRIES + 1, |
2358 | L1_CACHE_BYTES); | 2365 | iqe_size); |
2359 | } | 2366 | } |
2360 | 2367 | ||
2361 | /* | 2368 | /* |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 9710047c12a4..a0af48c51fb3 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -2098,7 +2098,8 @@ static void enic_poll_controller(struct net_device *netdev) | |||
2098 | case VNIC_DEV_INTR_MODE_MSIX: | 2098 | case VNIC_DEV_INTR_MODE_MSIX: |
2099 | for (i = 0; i < enic->rq_count; i++) { | 2099 | for (i = 0; i < enic->rq_count; i++) { |
2100 | intr = enic_msix_rq_intr(enic, i); | 2100 | intr = enic_msix_rq_intr(enic, i); |
2101 | enic_isr_msix_rq(enic->msix_entry[intr].vector, enic); | 2101 | enic_isr_msix_rq(enic->msix_entry[intr].vector, |
2102 | &enic->napi[i]); | ||
2102 | } | 2103 | } |
2103 | intr = enic_msix_wq_intr(enic, i); | 2104 | intr = enic_msix_wq_intr(enic, i); |
2104 | enic_isr_msix_wq(enic->msix_entry[intr].vector, enic); | 2105 | enic_isr_msix_wq(enic->msix_entry[intr].vector, enic); |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 1a0eb128e607..1f42f6ac8551 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -690,6 +690,7 @@ static void block_output(struct net_device *dev, int count, | |||
690 | static struct pcmcia_device_id axnet_ids[] = { | 690 | static struct pcmcia_device_id axnet_ids[] = { |
691 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x016c, 0x0081), | 691 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x016c, 0x0081), |
692 | PCMCIA_DEVICE_MANF_CARD(0x018a, 0x0301), | 692 | PCMCIA_DEVICE_MANF_CARD(0x018a, 0x0301), |
693 | PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x2328), | ||
693 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0301), | 694 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0301), |
694 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0303), | 695 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0303), |
695 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309), | 696 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309), |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index d05c44692f08..2c158910f7ea 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -1493,7 +1493,6 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
1493 | PCMCIA_DEVICE_MANF_CARD(0x0149, 0x4530), | 1493 | PCMCIA_DEVICE_MANF_CARD(0x0149, 0x4530), |
1494 | PCMCIA_DEVICE_MANF_CARD(0x0149, 0xc1ab), | 1494 | PCMCIA_DEVICE_MANF_CARD(0x0149, 0xc1ab), |
1495 | PCMCIA_DEVICE_MANF_CARD(0x0186, 0x0110), | 1495 | PCMCIA_DEVICE_MANF_CARD(0x0186, 0x0110), |
1496 | PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x2328), | ||
1497 | PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x8041), | 1496 | PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x8041), |
1498 | PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452), | 1497 | PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452), |
1499 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0300), | 1498 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0300), |
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/pppoe.c b/drivers/net/pppoe.c index d72fb0519a2a..78c0e3c9b2b5 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -948,7 +948,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) | |||
948 | 948 | ||
949 | abort: | 949 | abort: |
950 | kfree_skb(skb); | 950 | kfree_skb(skb); |
951 | return 0; | 951 | return 1; |
952 | } | 952 | } |
953 | 953 | ||
954 | /************************************************************************ | 954 | /************************************************************************ |
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index bdb8fe868539..4757c59a07a2 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -2083,6 +2083,7 @@ struct ql_adapter { | |||
2083 | u32 mailbox_in; | 2083 | u32 mailbox_in; |
2084 | u32 mailbox_out; | 2084 | u32 mailbox_out; |
2085 | struct mbox_params idc_mbc; | 2085 | struct mbox_params idc_mbc; |
2086 | struct mutex mpi_mutex; | ||
2086 | 2087 | ||
2087 | int tx_ring_size; | 2088 | int tx_ring_size; |
2088 | int rx_ring_size; | 2089 | int rx_ring_size; |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index e4dbbbfec723..3af30c452b88 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -4629,6 +4629,7 @@ static int __devinit ql_init_device(struct pci_dev *pdev, | |||
4629 | INIT_DELAYED_WORK(&qdev->mpi_idc_work, ql_mpi_idc_work); | 4629 | INIT_DELAYED_WORK(&qdev->mpi_idc_work, ql_mpi_idc_work); |
4630 | INIT_DELAYED_WORK(&qdev->mpi_core_to_log, ql_mpi_core_to_log); | 4630 | INIT_DELAYED_WORK(&qdev->mpi_core_to_log, ql_mpi_core_to_log); |
4631 | init_completion(&qdev->ide_completion); | 4631 | init_completion(&qdev->ide_completion); |
4632 | mutex_init(&qdev->mpi_mutex); | ||
4632 | 4633 | ||
4633 | if (!cards_found) { | 4634 | if (!cards_found) { |
4634 | dev_info(&pdev->dev, "%s\n", DRV_STRING); | 4635 | dev_info(&pdev->dev, "%s\n", DRV_STRING); |
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index 100a462cc916..ff2bf8a4e247 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -534,6 +534,7 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp) | |||
534 | int status; | 534 | int status; |
535 | unsigned long count; | 535 | unsigned long count; |
536 | 536 | ||
537 | mutex_lock(&qdev->mpi_mutex); | ||
537 | 538 | ||
538 | /* Begin polled mode for MPI */ | 539 | /* Begin polled mode for MPI */ |
539 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); | 540 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); |
@@ -603,6 +604,7 @@ done: | |||
603 | end: | 604 | end: |
604 | /* End polled mode for MPI */ | 605 | /* End polled mode for MPI */ |
605 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); | 606 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); |
607 | mutex_unlock(&qdev->mpi_mutex); | ||
606 | return status; | 608 | return status; |
607 | } | 609 | } |
608 | 610 | ||
@@ -1099,9 +1101,7 @@ int ql_wait_fifo_empty(struct ql_adapter *qdev) | |||
1099 | static int ql_set_port_cfg(struct ql_adapter *qdev) | 1101 | static int ql_set_port_cfg(struct ql_adapter *qdev) |
1100 | { | 1102 | { |
1101 | int status; | 1103 | int status; |
1102 | rtnl_lock(); | ||
1103 | status = ql_mb_set_port_cfg(qdev); | 1104 | status = ql_mb_set_port_cfg(qdev); |
1104 | rtnl_unlock(); | ||
1105 | if (status) | 1105 | if (status) |
1106 | return status; | 1106 | return status; |
1107 | status = ql_idc_wait(qdev); | 1107 | status = ql_idc_wait(qdev); |
@@ -1122,9 +1122,7 @@ void ql_mpi_port_cfg_work(struct work_struct *work) | |||
1122 | container_of(work, struct ql_adapter, mpi_port_cfg_work.work); | 1122 | container_of(work, struct ql_adapter, mpi_port_cfg_work.work); |
1123 | int status; | 1123 | int status; |
1124 | 1124 | ||
1125 | rtnl_lock(); | ||
1126 | status = ql_mb_get_port_cfg(qdev); | 1125 | status = ql_mb_get_port_cfg(qdev); |
1127 | rtnl_unlock(); | ||
1128 | if (status) { | 1126 | if (status) { |
1129 | netif_err(qdev, drv, qdev->ndev, | 1127 | netif_err(qdev, drv, qdev->ndev, |
1130 | "Bug: Failed to get port config data.\n"); | 1128 | "Bug: Failed to get port config data.\n"); |
@@ -1167,7 +1165,6 @@ void ql_mpi_idc_work(struct work_struct *work) | |||
1167 | u32 aen; | 1165 | u32 aen; |
1168 | int timeout; | 1166 | int timeout; |
1169 | 1167 | ||
1170 | rtnl_lock(); | ||
1171 | aen = mbcp->mbox_out[1] >> 16; | 1168 | aen = mbcp->mbox_out[1] >> 16; |
1172 | timeout = (mbcp->mbox_out[1] >> 8) & 0xf; | 1169 | timeout = (mbcp->mbox_out[1] >> 8) & 0xf; |
1173 | 1170 | ||
@@ -1231,7 +1228,6 @@ void ql_mpi_idc_work(struct work_struct *work) | |||
1231 | } | 1228 | } |
1232 | break; | 1229 | break; |
1233 | } | 1230 | } |
1234 | rtnl_unlock(); | ||
1235 | } | 1231 | } |
1236 | 1232 | ||
1237 | void ql_mpi_work(struct work_struct *work) | 1233 | void ql_mpi_work(struct work_struct *work) |
@@ -1242,7 +1238,7 @@ void ql_mpi_work(struct work_struct *work) | |||
1242 | struct mbox_params *mbcp = &mbc; | 1238 | struct mbox_params *mbcp = &mbc; |
1243 | int err = 0; | 1239 | int err = 0; |
1244 | 1240 | ||
1245 | rtnl_lock(); | 1241 | mutex_lock(&qdev->mpi_mutex); |
1246 | /* Begin polled mode for MPI */ | 1242 | /* Begin polled mode for MPI */ |
1247 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); | 1243 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); |
1248 | 1244 | ||
@@ -1259,7 +1255,7 @@ void ql_mpi_work(struct work_struct *work) | |||
1259 | 1255 | ||
1260 | /* End polled mode for MPI */ | 1256 | /* End polled mode for MPI */ |
1261 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); | 1257 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); |
1262 | rtnl_unlock(); | 1258 | mutex_unlock(&qdev->mpi_mutex); |
1263 | ql_enable_completion_interrupt(qdev, 0); | 1259 | ql_enable_completion_interrupt(qdev, 0); |
1264 | } | 1260 | } |
1265 | 1261 | ||
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 98d792c33877..4e745af96cf1 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/tehuti.c b/drivers/net/tehuti.c index 8b3dc1eb4015..296000bf5a25 100644 --- a/drivers/net/tehuti.c +++ b/drivers/net/tehuti.c | |||
@@ -324,7 +324,7 @@ static int bdx_fw_load(struct bdx_priv *priv) | |||
324 | ENTER; | 324 | ENTER; |
325 | master = READ_REG(priv, regINIT_SEMAPHORE); | 325 | master = READ_REG(priv, regINIT_SEMAPHORE); |
326 | if (!READ_REG(priv, regINIT_STATUS) && master) { | 326 | if (!READ_REG(priv, regINIT_STATUS) && master) { |
327 | rc = request_firmware(&fw, "tehuti/firmware.bin", &priv->pdev->dev); | 327 | rc = request_firmware(&fw, "tehuti/bdx.bin", &priv->pdev->dev); |
328 | if (rc) | 328 | if (rc) |
329 | goto out; | 329 | goto out; |
330 | bdx_tx_push_desc_safe(priv, (char *)fw->data, fw->size); | 330 | bdx_tx_push_desc_safe(priv, (char *)fw->data, fw->size); |
@@ -2510,4 +2510,4 @@ module_exit(bdx_module_exit); | |||
2510 | MODULE_LICENSE("GPL"); | 2510 | MODULE_LICENSE("GPL"); |
2511 | MODULE_AUTHOR(DRIVER_AUTHOR); | 2511 | MODULE_AUTHOR(DRIVER_AUTHOR); |
2512 | MODULE_DESCRIPTION(BDX_DRV_DESC); | 2512 | MODULE_DESCRIPTION(BDX_DRV_DESC); |
2513 | MODULE_FIRMWARE("tehuti/firmware.bin"); | 2513 | MODULE_FIRMWARE("tehuti/bdx.bin"); |
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index aea4645be7f6..6140b56cce53 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -1508,6 +1508,10 @@ static const struct usb_device_id products [] = { | |||
1508 | USB_DEVICE (0x0b95, 0x1780), | 1508 | USB_DEVICE (0x0b95, 0x1780), |
1509 | .driver_info = (unsigned long) &ax88178_info, | 1509 | .driver_info = (unsigned long) &ax88178_info, |
1510 | }, { | 1510 | }, { |
1511 | // Logitec LAN-GTJ/U2A | ||
1512 | USB_DEVICE (0x0789, 0x0160), | ||
1513 | .driver_info = (unsigned long) &ax88178_info, | ||
1514 | }, { | ||
1511 | // Linksys USB200M Rev 2 | 1515 | // Linksys USB200M Rev 2 |
1512 | USB_DEVICE (0x13b1, 0x0018), | 1516 | USB_DEVICE (0x13b1, 0x0018), |
1513 | .driver_info = (unsigned long) &ax88772_info, | 1517 | .driver_info = (unsigned long) &ax88772_info, |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 93c6b5f62ac4..ebcaaebf6b41 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 */ |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 0bbc0c323135..cc83fa71c3ff 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -166,7 +166,9 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) | |||
166 | if (!(rcv->flags & IFF_UP)) | 166 | if (!(rcv->flags & IFF_UP)) |
167 | goto tx_drop; | 167 | goto tx_drop; |
168 | 168 | ||
169 | if (dev->features & NETIF_F_NO_CSUM) | 169 | /* don't change ip_summed == CHECKSUM_PARTIAL, as that |
170 | will cause bad checksum on forwarded packets */ | ||
171 | if (skb->ip_summed == CHECKSUM_NONE) | ||
170 | skb->ip_summed = rcv_priv->ip_summed; | 172 | skb->ip_summed = rcv_priv->ip_summed; |
171 | 173 | ||
172 | length = skb->len + ETH_HLEN; | 174 | length = skb->len + ETH_HLEN; |
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index ea476cbd38b5..e305274f83fb 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c | |||
@@ -293,6 +293,7 @@ static inline void sca_tx_done(port_t *port) | |||
293 | struct net_device *dev = port->netdev; | 293 | struct net_device *dev = port->netdev; |
294 | card_t* card = port->card; | 294 | card_t* card = port->card; |
295 | u8 stat; | 295 | u8 stat; |
296 | unsigned count = 0; | ||
296 | 297 | ||
297 | spin_lock(&port->lock); | 298 | spin_lock(&port->lock); |
298 | 299 | ||
@@ -316,10 +317,12 @@ static inline void sca_tx_done(port_t *port) | |||
316 | dev->stats.tx_bytes += readw(&desc->len); | 317 | dev->stats.tx_bytes += readw(&desc->len); |
317 | } | 318 | } |
318 | writeb(0, &desc->stat); /* Free descriptor */ | 319 | writeb(0, &desc->stat); /* Free descriptor */ |
320 | count++; | ||
319 | port->txlast = (port->txlast + 1) % card->tx_ring_buffers; | 321 | port->txlast = (port->txlast + 1) % card->tx_ring_buffers; |
320 | } | 322 | } |
321 | 323 | ||
322 | netif_wake_queue(dev); | 324 | if (count) |
325 | netif_wake_queue(dev); | ||
323 | spin_unlock(&port->lock); | 326 | spin_unlock(&port->lock); |
324 | } | 327 | } |
325 | 328 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 3c983e426f25..af85458401a4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -311,6 +311,7 @@ struct iwl_cfg iwl100_bgn_cfg = { | |||
311 | .base_params = &iwl1000_base_params, | 311 | .base_params = &iwl1000_base_params, |
312 | .ht_params = &iwl1000_ht_params, | 312 | .ht_params = &iwl1000_ht_params, |
313 | .led_mode = IWL_LED_RF_STATE, | 313 | .led_mode = IWL_LED_RF_STATE, |
314 | .use_new_eeprom_reading = true, | ||
314 | }; | 315 | }; |
315 | 316 | ||
316 | struct iwl_cfg iwl100_bg_cfg = { | 317 | struct iwl_cfg iwl100_bg_cfg = { |
@@ -324,6 +325,7 @@ struct iwl_cfg iwl100_bg_cfg = { | |||
324 | .mod_params = &iwlagn_mod_params, | 325 | .mod_params = &iwlagn_mod_params, |
325 | .base_params = &iwl1000_base_params, | 326 | .base_params = &iwl1000_base_params, |
326 | .led_mode = IWL_LED_RF_STATE, | 327 | .led_mode = IWL_LED_RF_STATE, |
328 | .use_new_eeprom_reading = true, | ||
327 | }; | 329 | }; |
328 | 330 | ||
329 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); | 331 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 808942cc2991..a848ca06dc6f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -564,6 +564,7 @@ struct iwl_cfg iwl6005_2agn_cfg = { | |||
564 | .need_dc_calib = true, | 564 | .need_dc_calib = true, |
565 | .need_temp_offset_calib = true, | 565 | .need_temp_offset_calib = true, |
566 | .led_mode = IWL_LED_RF_STATE, | 566 | .led_mode = IWL_LED_RF_STATE, |
567 | .use_new_eeprom_reading = true, | ||
567 | }; | 568 | }; |
568 | 569 | ||
569 | struct iwl_cfg iwl6005_2abg_cfg = { | 570 | struct iwl_cfg iwl6005_2abg_cfg = { |
@@ -579,6 +580,7 @@ struct iwl_cfg iwl6005_2abg_cfg = { | |||
579 | .need_dc_calib = true, | 580 | .need_dc_calib = true, |
580 | .need_temp_offset_calib = true, | 581 | .need_temp_offset_calib = true, |
581 | .led_mode = IWL_LED_RF_STATE, | 582 | .led_mode = IWL_LED_RF_STATE, |
583 | .use_new_eeprom_reading = true, | ||
582 | }; | 584 | }; |
583 | 585 | ||
584 | struct iwl_cfg iwl6005_2bg_cfg = { | 586 | struct iwl_cfg iwl6005_2bg_cfg = { |
@@ -594,6 +596,7 @@ struct iwl_cfg iwl6005_2bg_cfg = { | |||
594 | .need_dc_calib = true, | 596 | .need_dc_calib = true, |
595 | .need_temp_offset_calib = true, | 597 | .need_temp_offset_calib = true, |
596 | .led_mode = IWL_LED_RF_STATE, | 598 | .led_mode = IWL_LED_RF_STATE, |
599 | .use_new_eeprom_reading = true, | ||
597 | }; | 600 | }; |
598 | 601 | ||
599 | struct iwl_cfg iwl6030_2agn_cfg = { | 602 | struct iwl_cfg iwl6030_2agn_cfg = { |
@@ -614,6 +617,7 @@ struct iwl_cfg iwl6030_2agn_cfg = { | |||
614 | .adv_pm = true, | 617 | .adv_pm = true, |
615 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 618 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
616 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 619 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
620 | .use_new_eeprom_reading = true, | ||
617 | }; | 621 | }; |
618 | 622 | ||
619 | struct iwl_cfg iwl6030_2abg_cfg = { | 623 | struct iwl_cfg iwl6030_2abg_cfg = { |
@@ -633,6 +637,7 @@ struct iwl_cfg iwl6030_2abg_cfg = { | |||
633 | .adv_pm = true, | 637 | .adv_pm = true, |
634 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 638 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
635 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 639 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
640 | .use_new_eeprom_reading = true, | ||
636 | }; | 641 | }; |
637 | 642 | ||
638 | struct iwl_cfg iwl6030_2bgn_cfg = { | 643 | struct iwl_cfg iwl6030_2bgn_cfg = { |
@@ -653,6 +658,7 @@ struct iwl_cfg iwl6030_2bgn_cfg = { | |||
653 | .adv_pm = true, | 658 | .adv_pm = true, |
654 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 659 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
655 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 660 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
661 | .use_new_eeprom_reading = true, | ||
656 | }; | 662 | }; |
657 | 663 | ||
658 | struct iwl_cfg iwl6030_2bg_cfg = { | 664 | struct iwl_cfg iwl6030_2bg_cfg = { |
@@ -672,6 +678,7 @@ struct iwl_cfg iwl6030_2bg_cfg = { | |||
672 | .adv_pm = true, | 678 | .adv_pm = true, |
673 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 679 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
674 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 680 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
681 | .use_new_eeprom_reading = true, | ||
675 | }; | 682 | }; |
676 | 683 | ||
677 | struct iwl_cfg iwl1030_bgn_cfg = { | 684 | struct iwl_cfg iwl1030_bgn_cfg = { |
@@ -692,6 +699,7 @@ struct iwl_cfg iwl1030_bgn_cfg = { | |||
692 | .adv_pm = true, | 699 | .adv_pm = true, |
693 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 700 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
694 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 701 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
702 | .use_new_eeprom_reading = true, | ||
695 | }; | 703 | }; |
696 | 704 | ||
697 | struct iwl_cfg iwl1030_bg_cfg = { | 705 | struct iwl_cfg iwl1030_bg_cfg = { |
@@ -711,6 +719,7 @@ struct iwl_cfg iwl1030_bg_cfg = { | |||
711 | .adv_pm = true, | 719 | .adv_pm = true, |
712 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 720 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
713 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 721 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
722 | .use_new_eeprom_reading = true, | ||
714 | }; | 723 | }; |
715 | 724 | ||
716 | /* | 725 | /* |
@@ -793,6 +802,7 @@ struct iwl_cfg iwl6150_bgn_cfg = { | |||
793 | .ht_params = &iwl6000_ht_params, | 802 | .ht_params = &iwl6000_ht_params, |
794 | .need_dc_calib = true, | 803 | .need_dc_calib = true, |
795 | .led_mode = IWL_LED_RF_STATE, | 804 | .led_mode = IWL_LED_RF_STATE, |
805 | .use_new_eeprom_reading = true, | ||
796 | }; | 806 | }; |
797 | 807 | ||
798 | struct iwl_cfg iwl6050_2abg_cfg = { | 808 | struct iwl_cfg iwl6050_2abg_cfg = { |
@@ -841,6 +851,7 @@ struct iwl_cfg iwl130_bgn_cfg = { | |||
841 | .adv_pm = true, | 851 | .adv_pm = true, |
842 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 852 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
843 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 853 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
854 | .use_new_eeprom_reading = true, | ||
844 | }; | 855 | }; |
845 | 856 | ||
846 | struct iwl_cfg iwl130_bg_cfg = { | 857 | struct iwl_cfg iwl130_bg_cfg = { |
@@ -859,6 +870,7 @@ struct iwl_cfg iwl130_bg_cfg = { | |||
859 | .adv_pm = true, | 870 | .adv_pm = true, |
860 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 871 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
861 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 872 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
873 | .use_new_eeprom_reading = true, | ||
862 | }; | 874 | }; |
863 | 875 | ||
864 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); | 876 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c index dbada761624d..cf9194baadac 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c | |||
@@ -433,7 +433,7 @@ static s8 iwl_update_channel_txpower(struct iwl_priv *priv, | |||
433 | /** | 433 | /** |
434 | * iwlcore_eeprom_enhanced_txpower: process enhanced tx power info | 434 | * iwlcore_eeprom_enhanced_txpower: process enhanced tx power info |
435 | */ | 435 | */ |
436 | void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | 436 | static void iwlcore_eeprom_enhanced_txpower_old(struct iwl_priv *priv) |
437 | { | 437 | { |
438 | int eeprom_section_count = 0; | 438 | int eeprom_section_count = 0; |
439 | int section, element; | 439 | int section, element; |
@@ -460,7 +460,8 @@ void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | |||
460 | * always check for valid entry before process | 460 | * always check for valid entry before process |
461 | * the information | 461 | * the information |
462 | */ | 462 | */ |
463 | if (!enhanced_txpower->common || enhanced_txpower->reserved) | 463 | if (!(enhanced_txpower->flags || enhanced_txpower->channel) || |
464 | enhanced_txpower->delta_20_in_40) | ||
464 | continue; | 465 | continue; |
465 | 466 | ||
466 | for (element = 0; element < eeprom_section_count; element++) { | 467 | for (element = 0; element < eeprom_section_count; element++) { |
@@ -493,3 +494,86 @@ void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | |||
493 | } | 494 | } |
494 | } | 495 | } |
495 | } | 496 | } |
497 | |||
498 | static void | ||
499 | iwlcore_eeprom_enh_txp_read_element(struct iwl_priv *priv, | ||
500 | struct iwl_eeprom_enhanced_txpwr *txp, | ||
501 | s8 max_txpower_avg) | ||
502 | { | ||
503 | int ch_idx; | ||
504 | bool is_ht40 = txp->flags & IWL_EEPROM_ENH_TXP_FL_40MHZ; | ||
505 | enum ieee80211_band band; | ||
506 | |||
507 | band = txp->flags & IWL_EEPROM_ENH_TXP_FL_BAND_52G ? | ||
508 | IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ; | ||
509 | |||
510 | for (ch_idx = 0; ch_idx < priv->channel_count; ch_idx++) { | ||
511 | struct iwl_channel_info *ch_info = &priv->channel_info[ch_idx]; | ||
512 | |||
513 | /* update matching channel or from common data only */ | ||
514 | if (txp->channel != 0 && ch_info->channel != txp->channel) | ||
515 | continue; | ||
516 | |||
517 | /* update matching band only */ | ||
518 | if (band != ch_info->band) | ||
519 | continue; | ||
520 | |||
521 | if (ch_info->max_power_avg < max_txpower_avg && !is_ht40) { | ||
522 | ch_info->max_power_avg = max_txpower_avg; | ||
523 | ch_info->curr_txpow = max_txpower_avg; | ||
524 | ch_info->scan_power = max_txpower_avg; | ||
525 | } | ||
526 | |||
527 | if (is_ht40 && ch_info->ht40_max_power_avg < max_txpower_avg) | ||
528 | ch_info->ht40_max_power_avg = max_txpower_avg; | ||
529 | } | ||
530 | } | ||
531 | |||
532 | #define EEPROM_TXP_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT) | ||
533 | #define EEPROM_TXP_ENTRY_LEN sizeof(struct iwl_eeprom_enhanced_txpwr) | ||
534 | #define EEPROM_TXP_SZ_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT_SIZE) | ||
535 | |||
536 | static void iwlcore_eeprom_enhanced_txpower_new(struct iwl_priv *priv) | ||
537 | { | ||
538 | struct iwl_eeprom_enhanced_txpwr *txp_array, *txp; | ||
539 | int idx, entries; | ||
540 | __le16 *txp_len; | ||
541 | s8 max_txp_avg, max_txp_avg_halfdbm; | ||
542 | |||
543 | BUILD_BUG_ON(sizeof(struct iwl_eeprom_enhanced_txpwr) != 8); | ||
544 | |||
545 | /* the length is in 16-bit words, but we want entries */ | ||
546 | txp_len = (__le16 *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_SZ_OFFS); | ||
547 | entries = le16_to_cpup(txp_len) * 2 / EEPROM_TXP_ENTRY_LEN; | ||
548 | |||
549 | txp_array = (void *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_OFFS); | ||
550 | for (idx = 0; idx < entries; idx++) { | ||
551 | txp = &txp_array[idx]; | ||
552 | |||
553 | /* skip invalid entries */ | ||
554 | if (!(txp->flags & IWL_EEPROM_ENH_TXP_FL_VALID)) | ||
555 | continue; | ||
556 | |||
557 | max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx, | ||
558 | &max_txp_avg_halfdbm); | ||
559 | |||
560 | /* | ||
561 | * Update the user limit values values to the highest | ||
562 | * power supported by any channel | ||
563 | */ | ||
564 | if (max_txp_avg > priv->tx_power_user_lmt) | ||
565 | priv->tx_power_user_lmt = max_txp_avg; | ||
566 | if (max_txp_avg_halfdbm > priv->tx_power_lmt_in_half_dbm) | ||
567 | priv->tx_power_lmt_in_half_dbm = max_txp_avg_halfdbm; | ||
568 | |||
569 | iwlcore_eeprom_enh_txp_read_element(priv, txp, max_txp_avg); | ||
570 | } | ||
571 | } | ||
572 | |||
573 | void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | ||
574 | { | ||
575 | if (priv->cfg->use_new_eeprom_reading) | ||
576 | iwlcore_eeprom_enhanced_txpower_new(priv); | ||
577 | else | ||
578 | iwlcore_eeprom_enhanced_txpower_old(priv); | ||
579 | } | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index d941910e7ef4..7c8010f7ce56 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -568,6 +568,12 @@ static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address) | |||
568 | case INDIRECT_REGULATORY: | 568 | case INDIRECT_REGULATORY: |
569 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_REGULATORY); | 569 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_REGULATORY); |
570 | break; | 570 | break; |
571 | case INDIRECT_TXP_LIMIT: | ||
572 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_TXP_LIMIT); | ||
573 | break; | ||
574 | case INDIRECT_TXP_LIMIT_SIZE: | ||
575 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_TXP_LIMIT_SIZE); | ||
576 | break; | ||
571 | case INDIRECT_CALIBRATION: | 577 | case INDIRECT_CALIBRATION: |
572 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_CALIBRATION); | 578 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_CALIBRATION); |
573 | break; | 579 | break; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 568920ac982d..9df33d6af8bb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -412,6 +412,7 @@ struct iwl_cfg { | |||
412 | u8 scan_tx_antennas[IEEE80211_NUM_BANDS]; | 412 | u8 scan_tx_antennas[IEEE80211_NUM_BANDS]; |
413 | enum iwl_led_mode led_mode; | 413 | enum iwl_led_mode led_mode; |
414 | const bool adv_pm; | 414 | const bool adv_pm; |
415 | const bool use_new_eeprom_reading; /* temporary, remove later */ | ||
415 | }; | 416 | }; |
416 | 417 | ||
417 | /*************************** | 418 | /*************************** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h index 583916db46e4..8994b5b23593 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h | |||
@@ -129,6 +129,17 @@ struct iwl_eeprom_channel { | |||
129 | s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */ | 129 | s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */ |
130 | } __packed; | 130 | } __packed; |
131 | 131 | ||
132 | enum iwl_eeprom_enhanced_txpwr_flags { | ||
133 | IWL_EEPROM_ENH_TXP_FL_VALID = BIT(0), | ||
134 | IWL_EEPROM_ENH_TXP_FL_BAND_52G = BIT(1), | ||
135 | IWL_EEPROM_ENH_TXP_FL_OFDM = BIT(2), | ||
136 | IWL_EEPROM_ENH_TXP_FL_40MHZ = BIT(3), | ||
137 | IWL_EEPROM_ENH_TXP_FL_HT_AP = BIT(4), | ||
138 | IWL_EEPROM_ENH_TXP_FL_RES1 = BIT(5), | ||
139 | IWL_EEPROM_ENH_TXP_FL_RES2 = BIT(6), | ||
140 | IWL_EEPROM_ENH_TXP_FL_COMMON_TYPE = BIT(7), | ||
141 | }; | ||
142 | |||
132 | /** | 143 | /** |
133 | * iwl_eeprom_enhanced_txpwr structure | 144 | * iwl_eeprom_enhanced_txpwr structure |
134 | * This structure presents the enhanced regulatory tx power limit layout | 145 | * This structure presents the enhanced regulatory tx power limit layout |
@@ -136,21 +147,23 @@ struct iwl_eeprom_channel { | |||
136 | * Enhanced regulatory tx power portion of eeprom image can be broken down | 147 | * Enhanced regulatory tx power portion of eeprom image can be broken down |
137 | * into individual structures; each one is 8 bytes in size and contain the | 148 | * into individual structures; each one is 8 bytes in size and contain the |
138 | * following information | 149 | * following information |
139 | * @common: (desc + channel) not used by driver, should _NOT_ be "zero" | 150 | * @flags: entry flags |
151 | * @channel: channel number | ||
140 | * @chain_a_max_pwr: chain a max power in 1/2 dBm | 152 | * @chain_a_max_pwr: chain a max power in 1/2 dBm |
141 | * @chain_b_max_pwr: chain b max power in 1/2 dBm | 153 | * @chain_b_max_pwr: chain b max power in 1/2 dBm |
142 | * @chain_c_max_pwr: chain c max power in 1/2 dBm | 154 | * @chain_c_max_pwr: chain c max power in 1/2 dBm |
143 | * @reserved: not used, should be "zero" | 155 | * @delta_20_in_40: 20-in-40 deltas (hi/lo) |
144 | * @mimo2_max_pwr: mimo2 max power in 1/2 dBm | 156 | * @mimo2_max_pwr: mimo2 max power in 1/2 dBm |
145 | * @mimo3_max_pwr: mimo3 max power in 1/2 dBm | 157 | * @mimo3_max_pwr: mimo3 max power in 1/2 dBm |
146 | * | 158 | * |
147 | */ | 159 | */ |
148 | struct iwl_eeprom_enhanced_txpwr { | 160 | struct iwl_eeprom_enhanced_txpwr { |
149 | __le16 common; | 161 | u8 flags; |
162 | u8 channel; | ||
150 | s8 chain_a_max; | 163 | s8 chain_a_max; |
151 | s8 chain_b_max; | 164 | s8 chain_b_max; |
152 | s8 chain_c_max; | 165 | s8 chain_c_max; |
153 | s8 reserved; | 166 | u8 delta_20_in_40; |
154 | s8 mimo2_max; | 167 | s8 mimo2_max; |
155 | s8 mimo3_max; | 168 | s8 mimo3_max; |
156 | } __packed; | 169 | } __packed; |
@@ -195,6 +208,8 @@ struct iwl_eeprom_enhanced_txpwr { | |||
195 | #define EEPROM_LINK_CALIBRATION (2*0x67) | 208 | #define EEPROM_LINK_CALIBRATION (2*0x67) |
196 | #define EEPROM_LINK_PROCESS_ADJST (2*0x68) | 209 | #define EEPROM_LINK_PROCESS_ADJST (2*0x68) |
197 | #define EEPROM_LINK_OTHERS (2*0x69) | 210 | #define EEPROM_LINK_OTHERS (2*0x69) |
211 | #define EEPROM_LINK_TXP_LIMIT (2*0x6a) | ||
212 | #define EEPROM_LINK_TXP_LIMIT_SIZE (2*0x6b) | ||
198 | 213 | ||
199 | /* agn regulatory - indirect access */ | 214 | /* agn regulatory - indirect access */ |
200 | #define EEPROM_REG_BAND_1_CHANNELS ((0x08)\ | 215 | #define EEPROM_REG_BAND_1_CHANNELS ((0x08)\ |
@@ -398,6 +413,8 @@ struct iwl_eeprom_calib_info { | |||
398 | #define INDIRECT_CALIBRATION 0x00040000 | 413 | #define INDIRECT_CALIBRATION 0x00040000 |
399 | #define INDIRECT_PROCESS_ADJST 0x00050000 | 414 | #define INDIRECT_PROCESS_ADJST 0x00050000 |
400 | #define INDIRECT_OTHERS 0x00060000 | 415 | #define INDIRECT_OTHERS 0x00060000 |
416 | #define INDIRECT_TXP_LIMIT 0x00070000 | ||
417 | #define INDIRECT_TXP_LIMIT_SIZE 0x00080000 | ||
401 | #define INDIRECT_ADDRESS 0x00100000 | 418 | #define INDIRECT_ADDRESS 0x00100000 |
402 | 419 | ||
403 | /* General */ | 420 | /* General */ |
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index dee32d3681a5..632c9211e634 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -617,7 +617,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, | |||
617 | print_ssid(ssid_buf, ssid, ssid_len), | 617 | print_ssid(ssid_buf, ssid, ssid_len), |
618 | LBS_SCAN_RSSI_TO_MBM(rssi)/100); | 618 | LBS_SCAN_RSSI_TO_MBM(rssi)/100); |
619 | 619 | ||
620 | if (channel || | 620 | if (channel && |
621 | !(channel->flags & IEEE80211_CHAN_DISABLED)) | 621 | !(channel->flags & IEEE80211_CHAN_DISABLED)) |
622 | cfg80211_inform_bss(wiphy, channel, | 622 | cfg80211_inform_bss(wiphy, channel, |
623 | bssid, le64_to_cpu(*(__le64 *)tsfdesc), | 623 | bssid, le64_to_cpu(*(__le64 *)tsfdesc), |
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index dd4d8fc9ad7a..21713a7638c4 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -43,6 +43,7 @@ MODULE_FIRMWARE("isl3887usb"); | |||
43 | 43 | ||
44 | static struct usb_device_id p54u_table[] __devinitdata = { | 44 | static struct usb_device_id p54u_table[] __devinitdata = { |
45 | /* Version 1 devices (pci chip + net2280) */ | 45 | /* Version 1 devices (pci chip + net2280) */ |
46 | {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */ | ||
46 | {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ | 47 | {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ |
47 | {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ | 48 | {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ |
48 | {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */ | 49 | {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */ |
@@ -56,9 +57,13 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
56 | {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ | 57 | {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ |
57 | {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ | 58 | {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ |
58 | {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */ | 59 | {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */ |
60 | {USB_DEVICE(0x0db0, 0x6826)}, /* MSI UB54G (MS-6826) */ | ||
59 | {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */ | 61 | {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */ |
60 | {USB_DEVICE(0x124a, 0x4023)}, /* Shuttle PN15, Airvast WM168g, IOGear GWU513 */ | 62 | {USB_DEVICE(0x124a, 0x4023)}, /* Shuttle PN15, Airvast WM168g, IOGear GWU513 */ |
63 | {USB_DEVICE(0x1435, 0x0210)}, /* Inventel UR054G */ | ||
64 | {USB_DEVICE(0x15a9, 0x0002)}, /* Gemtek WUBI-100GW 802.11g */ | ||
61 | {USB_DEVICE(0x1630, 0x0005)}, /* 2Wire 802.11g USB (v1) / Z-Com */ | 65 | {USB_DEVICE(0x1630, 0x0005)}, /* 2Wire 802.11g USB (v1) / Z-Com */ |
66 | {USB_DEVICE(0x182d, 0x096b)}, /* Sitecom WL-107 */ | ||
62 | {USB_DEVICE(0x1915, 0x2234)}, /* Linksys WUSB54G OEM */ | 67 | {USB_DEVICE(0x1915, 0x2234)}, /* Linksys WUSB54G OEM */ |
63 | {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */ | 68 | {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */ |
64 | {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */ | 69 | {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */ |
@@ -94,6 +99,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
94 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ | 99 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ |
95 | {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ | 100 | {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ |
96 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ | 101 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ |
102 | {USB_DEVICE(0x2001, 0x3705)}, /* D-Link DWL-G120 rev C1 */ | ||
97 | {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */ | 103 | {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */ |
98 | {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ | 104 | {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ |
99 | {USB_DEVICE(0x413c, 0x8104)}, /* Cohiba Proto board */ | 105 | {USB_DEVICE(0x413c, 0x8104)}, /* Cohiba Proto board */ |
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/netlink.h b/include/linux/netlink.h index 123566912d73..e2b9e63afa68 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -70,7 +70,7 @@ struct nlmsghdr { | |||
70 | Check NLM_F_EXCL | 70 | Check NLM_F_EXCL |
71 | */ | 71 | */ |
72 | 72 | ||
73 | #define NLMSG_ALIGNTO 4 | 73 | #define NLMSG_ALIGNTO 4U |
74 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) | 74 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) |
75 | #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) | 75 | #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) |
76 | #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN)) | 76 | #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN)) |
diff --git a/include/net/sock.h b/include/net/sock.h index 82e86034702f..21a02f7e4f45 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -769,6 +769,7 @@ struct proto { | |||
769 | void (*unhash)(struct sock *sk); | 769 | void (*unhash)(struct sock *sk); |
770 | void (*rehash)(struct sock *sk); | 770 | void (*rehash)(struct sock *sk); |
771 | int (*get_port)(struct sock *sk, unsigned short snum); | 771 | int (*get_port)(struct sock *sk, unsigned short snum); |
772 | void (*clear_sk)(struct sock *sk, int size); | ||
772 | 773 | ||
773 | /* Keeping track of sockets in use */ | 774 | /* Keeping track of sockets in use */ |
774 | #ifdef CONFIG_PROC_FS | 775 | #ifdef CONFIG_PROC_FS |
@@ -867,6 +868,8 @@ static inline void __sk_prot_rehash(struct sock *sk) | |||
867 | sk->sk_prot->hash(sk); | 868 | sk->sk_prot->hash(sk); |
868 | } | 869 | } |
869 | 870 | ||
871 | void sk_prot_clear_portaddr_nulls(struct sock *sk, int size); | ||
872 | |||
870 | /* About 10 seconds */ | 873 | /* About 10 seconds */ |
871 | #define SOCK_DESTROY_TIME (10*HZ) | 874 | #define SOCK_DESTROY_TIME (10*HZ) |
872 | 875 | ||
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/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index c1e2bbafb549..ff8aaa736650 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -311,6 +311,7 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d) | |||
311 | d->state = BT_OPEN; | 311 | d->state = BT_OPEN; |
312 | d->flags = 0; | 312 | d->flags = 0; |
313 | d->mscex = 0; | 313 | d->mscex = 0; |
314 | d->sec_level = BT_SECURITY_LOW; | ||
314 | d->mtu = RFCOMM_DEFAULT_MTU; | 315 | d->mtu = RFCOMM_DEFAULT_MTU; |
315 | d->v24_sig = RFCOMM_V24_RTC | RFCOMM_V24_RTR | RFCOMM_V24_DV; | 316 | d->v24_sig = RFCOMM_V24_RTC | RFCOMM_V24_RTR | RFCOMM_V24_DV; |
316 | 317 | ||
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 85a0398b221e..f03e2e98cd44 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -445,7 +445,7 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br, | |||
445 | ip6h = ipv6_hdr(skb); | 445 | ip6h = ipv6_hdr(skb); |
446 | 446 | ||
447 | *(__force __be32 *)ip6h = htonl(0x60000000); | 447 | *(__force __be32 *)ip6h = htonl(0x60000000); |
448 | ip6h->payload_len = 8 + sizeof(*mldq); | 448 | ip6h->payload_len = htons(8 + sizeof(*mldq)); |
449 | ip6h->nexthdr = IPPROTO_HOPOPTS; | 449 | ip6h->nexthdr = IPPROTO_HOPOPTS; |
450 | ip6h->hop_limit = 1; | 450 | ip6h->hop_limit = 1; |
451 | ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0); | 451 | ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0); |
diff --git a/net/core/sock.c b/net/core/sock.c index bcdb6ff6e621..a6b9e8061f34 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1010,6 +1010,36 @@ static void sock_copy(struct sock *nsk, const struct sock *osk) | |||
1010 | #endif | 1010 | #endif |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | /* | ||
1014 | * caches using SLAB_DESTROY_BY_RCU should let .next pointer from nulls nodes | ||
1015 | * un-modified. Special care is taken when initializing object to zero. | ||
1016 | */ | ||
1017 | static inline void sk_prot_clear_nulls(struct sock *sk, int size) | ||
1018 | { | ||
1019 | if (offsetof(struct sock, sk_node.next) != 0) | ||
1020 | memset(sk, 0, offsetof(struct sock, sk_node.next)); | ||
1021 | memset(&sk->sk_node.pprev, 0, | ||
1022 | size - offsetof(struct sock, sk_node.pprev)); | ||
1023 | } | ||
1024 | |||
1025 | void sk_prot_clear_portaddr_nulls(struct sock *sk, int size) | ||
1026 | { | ||
1027 | unsigned long nulls1, nulls2; | ||
1028 | |||
1029 | nulls1 = offsetof(struct sock, __sk_common.skc_node.next); | ||
1030 | nulls2 = offsetof(struct sock, __sk_common.skc_portaddr_node.next); | ||
1031 | if (nulls1 > nulls2) | ||
1032 | swap(nulls1, nulls2); | ||
1033 | |||
1034 | if (nulls1 != 0) | ||
1035 | memset((char *)sk, 0, nulls1); | ||
1036 | memset((char *)sk + nulls1 + sizeof(void *), 0, | ||
1037 | nulls2 - nulls1 - sizeof(void *)); | ||
1038 | memset((char *)sk + nulls2 + sizeof(void *), 0, | ||
1039 | size - nulls2 - sizeof(void *)); | ||
1040 | } | ||
1041 | EXPORT_SYMBOL(sk_prot_clear_portaddr_nulls); | ||
1042 | |||
1013 | static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, | 1043 | static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, |
1014 | int family) | 1044 | int family) |
1015 | { | 1045 | { |
@@ -1022,19 +1052,12 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, | |||
1022 | if (!sk) | 1052 | if (!sk) |
1023 | return sk; | 1053 | return sk; |
1024 | if (priority & __GFP_ZERO) { | 1054 | if (priority & __GFP_ZERO) { |
1025 | /* | 1055 | if (prot->clear_sk) |
1026 | * caches using SLAB_DESTROY_BY_RCU should let | 1056 | prot->clear_sk(sk, prot->obj_size); |
1027 | * sk_node.next un-modified. Special care is taken | 1057 | else |
1028 | * when initializing object to zero. | 1058 | sk_prot_clear_nulls(sk, prot->obj_size); |
1029 | */ | ||
1030 | if (offsetof(struct sock, sk_node.next) != 0) | ||
1031 | memset(sk, 0, offsetof(struct sock, sk_node.next)); | ||
1032 | memset(&sk->sk_node.pprev, 0, | ||
1033 | prot->obj_size - offsetof(struct sock, | ||
1034 | sk_node.pprev)); | ||
1035 | } | 1059 | } |
1036 | } | 1060 | } else |
1037 | else | ||
1038 | sk = kmalloc(prot->obj_size, priority); | 1061 | sk = kmalloc(prot->obj_size, priority); |
1039 | 1062 | ||
1040 | if (sk != NULL) { | 1063 | if (sk != NULL) { |
diff --git a/net/core/timestamping.c b/net/core/timestamping.c index b124d28ff1c8..7e7ca375d431 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/econet/af_econet.c b/net/econet/af_econet.c index f180371fa415..15dcc1a586b4 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
@@ -851,9 +851,13 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len) | |||
851 | { | 851 | { |
852 | struct iphdr *ip = ip_hdr(skb); | 852 | struct iphdr *ip = ip_hdr(skb); |
853 | 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; | ||
854 | struct sock *sk = NULL; | 856 | struct sock *sk = NULL; |
855 | struct sk_buff *newskb; | 857 | struct sk_buff *newskb; |
856 | struct ec_device *edev = skb->dev->ec_ptr; | 858 | |
859 | if (dst) | ||
860 | edev = dst->dev->ec_ptr; | ||
857 | 861 | ||
858 | if (! edev) | 862 | if (! edev) |
859 | goto bad; | 863 | goto bad; |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 1198adf45102..8157b17959ee 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1897,6 +1897,7 @@ struct proto udp_prot = { | |||
1897 | .compat_setsockopt = compat_udp_setsockopt, | 1897 | .compat_setsockopt = compat_udp_setsockopt, |
1898 | .compat_getsockopt = compat_udp_getsockopt, | 1898 | .compat_getsockopt = compat_udp_getsockopt, |
1899 | #endif | 1899 | #endif |
1900 | .clear_sk = sk_prot_clear_portaddr_nulls, | ||
1900 | }; | 1901 | }; |
1901 | EXPORT_SYMBOL(udp_prot); | 1902 | EXPORT_SYMBOL(udp_prot); |
1902 | 1903 | ||
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index ab76aa928fa9..aee9963f7f5a 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c | |||
@@ -57,6 +57,7 @@ struct proto udplite_prot = { | |||
57 | .compat_setsockopt = compat_udp_setsockopt, | 57 | .compat_setsockopt = compat_udp_setsockopt, |
58 | .compat_getsockopt = compat_udp_getsockopt, | 58 | .compat_getsockopt = compat_udp_getsockopt, |
59 | #endif | 59 | #endif |
60 | .clear_sk = sk_prot_clear_portaddr_nulls, | ||
60 | }; | 61 | }; |
61 | EXPORT_SYMBOL(udplite_prot); | 62 | EXPORT_SYMBOL(udplite_prot); |
62 | 63 | ||
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 1023ad0d2b15..99d1888af363 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2669,7 +2669,9 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2669 | 2669 | ||
2670 | ASSERT_RTNL(); | 2670 | ASSERT_RTNL(); |
2671 | 2671 | ||
2672 | rt6_ifdown(net, dev); | 2672 | /* Flush routes if device is being removed or it is not loopback */ |
2673 | if (how || !(dev->flags & IFF_LOOPBACK)) | ||
2674 | rt6_ifdown(net, dev); | ||
2673 | neigh_ifdown(&nd_tbl, dev); | 2675 | neigh_ifdown(&nd_tbl, dev); |
2674 | 2676 | ||
2675 | idev = __in6_dev_get(dev); | 2677 | idev = __in6_dev_get(dev); |
@@ -4057,11 +4059,11 @@ void inet6_ifinfo_notify(int event, struct inet6_dev *idev) | |||
4057 | kfree_skb(skb); | 4059 | kfree_skb(skb); |
4058 | goto errout; | 4060 | goto errout; |
4059 | } | 4061 | } |
4060 | rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); | 4062 | rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFINFO, NULL, GFP_ATOMIC); |
4061 | return; | 4063 | return; |
4062 | errout: | 4064 | errout: |
4063 | if (err < 0) | 4065 | if (err < 0) |
4064 | rtnl_set_sk_err(net, RTNLGRP_IPV6_IFADDR, err); | 4066 | rtnl_set_sk_err(net, RTNLGRP_IPV6_IFINFO, err); |
4065 | } | 4067 | } |
4066 | 4068 | ||
4067 | static inline size_t inet6_prefix_nlmsg_size(void) | 4069 | static inline size_t inet6_prefix_nlmsg_size(void) |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e7efb269a6e9..d5c3b45d829e 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1566,11 +1566,16 @@ static void rt6_do_pmtu_disc(struct in6_addr *daddr, struct in6_addr *saddr, | |||
1566 | { | 1566 | { |
1567 | struct rt6_info *rt, *nrt; | 1567 | struct rt6_info *rt, *nrt; |
1568 | int allfrag = 0; | 1568 | int allfrag = 0; |
1569 | 1569 | again: | |
1570 | rt = rt6_lookup(net, daddr, saddr, ifindex, 0); | 1570 | rt = rt6_lookup(net, daddr, saddr, ifindex, 0); |
1571 | if (rt == NULL) | 1571 | if (rt == NULL) |
1572 | return; | 1572 | return; |
1573 | 1573 | ||
1574 | if (rt6_check_expired(rt)) { | ||
1575 | ip6_del_rt(rt); | ||
1576 | goto again; | ||
1577 | } | ||
1578 | |||
1574 | if (pmtu >= dst_mtu(&rt->dst)) | 1579 | if (pmtu >= dst_mtu(&rt->dst)) |
1575 | goto out; | 1580 | goto out; |
1576 | 1581 | ||
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 26a8da3f2044..9a009c66c8a3 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1477,6 +1477,7 @@ struct proto udpv6_prot = { | |||
1477 | .compat_setsockopt = compat_udpv6_setsockopt, | 1477 | .compat_setsockopt = compat_udpv6_setsockopt, |
1478 | .compat_getsockopt = compat_udpv6_getsockopt, | 1478 | .compat_getsockopt = compat_udpv6_getsockopt, |
1479 | #endif | 1479 | #endif |
1480 | .clear_sk = sk_prot_clear_portaddr_nulls, | ||
1480 | }; | 1481 | }; |
1481 | 1482 | ||
1482 | static struct inet_protosw udpv6_protosw = { | 1483 | static struct inet_protosw udpv6_protosw = { |
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c index 5f48fadc27f7..986c4de5292e 100644 --- a/net/ipv6/udplite.c +++ b/net/ipv6/udplite.c | |||
@@ -55,6 +55,7 @@ struct proto udplitev6_prot = { | |||
55 | .compat_setsockopt = compat_udpv6_setsockopt, | 55 | .compat_setsockopt = compat_udpv6_setsockopt, |
56 | .compat_getsockopt = compat_udpv6_getsockopt, | 56 | .compat_getsockopt = compat_udpv6_getsockopt, |
57 | #endif | 57 | #endif |
58 | .clear_sk = sk_prot_clear_portaddr_nulls, | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | static struct inet_protosw udplite6_protosw = { | 61 | static struct inet_protosw udplite6_protosw = { |
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 410d104b1347..53c7077ffd4f 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -780,6 +780,9 @@ void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
780 | 780 | ||
781 | mutex_lock(&sdata->u.ibss.mtx); | 781 | mutex_lock(&sdata->u.ibss.mtx); |
782 | 782 | ||
783 | if (!sdata->u.ibss.ssid_len) | ||
784 | goto mgmt_out; /* not ready to merge yet */ | ||
785 | |||
783 | switch (fc & IEEE80211_FCTL_STYPE) { | 786 | switch (fc & IEEE80211_FCTL_STYPE) { |
784 | case IEEE80211_STYPE_PROBE_REQ: | 787 | case IEEE80211_STYPE_PROBE_REQ: |
785 | ieee80211_rx_mgmt_probe_req(sdata, mgmt, skb->len); | 788 | ieee80211_rx_mgmt_probe_req(sdata, mgmt, skb->len); |
@@ -797,6 +800,7 @@ void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
797 | break; | 800 | break; |
798 | } | 801 | } |
799 | 802 | ||
803 | mgmt_out: | ||
800 | mutex_unlock(&sdata->u.ibss.mtx); | 804 | mutex_unlock(&sdata->u.ibss.mtx); |
801 | } | 805 | } |
802 | 806 | ||
diff --git a/net/mac80211/work.c b/net/mac80211/work.c index de43753076d2..36305e0d06ef 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c | |||
@@ -1074,11 +1074,13 @@ void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata) | |||
1074 | { | 1074 | { |
1075 | struct ieee80211_local *local = sdata->local; | 1075 | struct ieee80211_local *local = sdata->local; |
1076 | struct ieee80211_work *wk; | 1076 | struct ieee80211_work *wk; |
1077 | bool cleanup = false; | ||
1077 | 1078 | ||
1078 | mutex_lock(&local->mtx); | 1079 | mutex_lock(&local->mtx); |
1079 | list_for_each_entry(wk, &local->work_list, list) { | 1080 | list_for_each_entry(wk, &local->work_list, list) { |
1080 | if (wk->sdata != sdata) | 1081 | if (wk->sdata != sdata) |
1081 | continue; | 1082 | continue; |
1083 | cleanup = true; | ||
1082 | wk->type = IEEE80211_WORK_ABORT; | 1084 | wk->type = IEEE80211_WORK_ABORT; |
1083 | wk->started = true; | 1085 | wk->started = true; |
1084 | wk->timeout = jiffies; | 1086 | wk->timeout = jiffies; |
@@ -1086,7 +1088,8 @@ void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata) | |||
1086 | mutex_unlock(&local->mtx); | 1088 | mutex_unlock(&local->mtx); |
1087 | 1089 | ||
1088 | /* run cleanups etc. */ | 1090 | /* run cleanups etc. */ |
1089 | ieee80211_work_work(&local->work_work); | 1091 | if (cleanup) |
1092 | ieee80211_work_work(&local->work_work); | ||
1090 | 1093 | ||
1091 | mutex_lock(&local->mtx); | 1094 | mutex_lock(&local->mtx); |
1092 | list_for_each_entry(wk, &local->work_list, list) { | 1095 | list_for_each_entry(wk, &local->work_list, list) { |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 842c7f3650b9..a09b0dd25f50 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 | ||
@@ -5045,7 +5053,7 @@ static int sctp_getsockopt_partial_delivery_point(struct sock *sk, int len, | |||
5045 | if (copy_to_user(optval, &val, len)) | 5053 | if (copy_to_user(optval, &val, len)) |
5046 | return -EFAULT; | 5054 | return -EFAULT; |
5047 | 5055 | ||
5048 | return -ENOTSUPP; | 5056 | return 0; |
5049 | } | 5057 | } |
5050 | 5058 | ||
5051 | /* | 5059 | /* |
diff --git a/net/socket.c b/net/socket.c index c898df76e924..c1663c0ff3d3 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/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); |