diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-10 17:23:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-10 17:23:56 -0500 |
commit | 1da63a2131b0185f64a4c623a0e0b030479185fe (patch) | |
tree | e859fc05e2904400bf8b0b23f419532c874e43a9 | |
parent | 3902beb48d369d5e19f66acc2f857865ddc9b3bf (diff) | |
parent | a6baf3af89a266a3d745117de570788b956396e7 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (40 commits)
r8169: prevent bit sign expansion error in mdio_write
r8169: revert 7da97ec96a0934319c7fbedd3d38baf533e20640 (bis repetita)
sky2: new pci id's
ax88796: add superh to kconfig dependencies
qla3xxx: bugfix: Fix bad logical operation in link state machine.
qla3xxx: bugfix: Move link state machine into a worker thread
pasemi_mac: Fix CRC checks
pasemi_mac: Don't set replace-source-address descriptor bits
bonding: don't validate address at device open
bonding: fix rtnl locking merge error
sky2: netpoll on port 0 only
b43: Fix kconfig dependencies for rfkill and leds
b43legacy: Fix sparse warning
b43: properly request pcmcia IRQ
b43legacy: fix shared IRQ race condition
b43: fix shared IRQ race condition
b43legacy: add me as maintainer and fix URLs
b43legacy: fix possible buffer overrun in debugfs
b43: Rewrite and fix rfkill init
b43: debugfs SHM read buffer overrun fix
...
26 files changed, 285 insertions, 229 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 1c7c229a0926..6a9702726239 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -787,23 +787,25 @@ B43 WIRELESS DRIVER | |||
787 | P: Michael Buesch | 787 | P: Michael Buesch |
788 | M: mb@bu3sch.de | 788 | M: mb@bu3sch.de |
789 | P: Stefano Brivio | 789 | P: Stefano Brivio |
790 | M: st3@riseup.net | 790 | M: stefano.brivio@polimi.it |
791 | L: linux-wireless@vger.kernel.org | 791 | L: linux-wireless@vger.kernel.org |
792 | W: http://bcm43xx.berlios.de/ | 792 | W: http://linuxwireless.org/en/users/Drivers/b43 |
793 | S: Maintained | 793 | S: Maintained |
794 | 794 | ||
795 | B43LEGACY WIRELESS DRIVER | 795 | B43LEGACY WIRELESS DRIVER |
796 | P: Larry Finger | 796 | P: Larry Finger |
797 | M: Larry.Finger@lwfinger.net | 797 | M: Larry.Finger@lwfinger.net |
798 | P: Stefano Brivio | ||
799 | M: stefano.brivio@polimi.it | ||
798 | L: linux-wireless@vger.kernel.org | 800 | L: linux-wireless@vger.kernel.org |
799 | W: http://bcm43xx.berlios.de/ | 801 | W: http://linuxwireless.org/en/users/Drivers/b43 |
800 | S: Maintained | 802 | S: Maintained |
801 | 803 | ||
802 | BCM43XX WIRELESS DRIVER (SOFTMAC BASED VERSION) | 804 | BCM43XX WIRELESS DRIVER (SOFTMAC BASED VERSION) |
803 | P: Larry Finger | 805 | P: Larry Finger |
804 | M: Larry.Finger@lwfinger.net | 806 | M: Larry.Finger@lwfinger.net |
805 | P: Stefano Brivio | 807 | P: Stefano Brivio |
806 | M: st3@riseup.net | 808 | M: stefano.brivio@polimi.it |
807 | L: linux-wireless@vger.kernel.org | 809 | L: linux-wireless@vger.kernel.org |
808 | W: http://bcm43xx.berlios.de/ | 810 | W: http://bcm43xx.berlios.de/ |
809 | S: Maintained | 811 | S: Maintained |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index cb581ebbe3c5..bf8890ebbc4c 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -235,7 +235,7 @@ source "drivers/net/arm/Kconfig" | |||
235 | 235 | ||
236 | config AX88796 | 236 | config AX88796 |
237 | tristate "ASIX AX88796 NE2000 clone support" | 237 | tristate "ASIX AX88796 NE2000 clone support" |
238 | depends on ARM || MIPS | 238 | depends on ARM || MIPS || SUPERH |
239 | select CRC32 | 239 | select CRC32 |
240 | select MII | 240 | select MII |
241 | help | 241 | help |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6937ef0e7275..a198404a3e36 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4405,6 +4405,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) | |||
4405 | bond_dev->set_multicast_list = bond_set_multicast_list; | 4405 | bond_dev->set_multicast_list = bond_set_multicast_list; |
4406 | bond_dev->change_mtu = bond_change_mtu; | 4406 | bond_dev->change_mtu = bond_change_mtu; |
4407 | bond_dev->set_mac_address = bond_set_mac_address; | 4407 | bond_dev->set_mac_address = bond_set_mac_address; |
4408 | bond_dev->validate_addr = NULL; | ||
4408 | 4409 | ||
4409 | bond_set_mode_ops(bond, bond->params.mode); | 4410 | bond_set_mode_ops(bond, bond->params.mode); |
4410 | 4411 | ||
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 7a06ade85b02..b29330d8e309 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1193,8 +1193,6 @@ static ssize_t bonding_show_active_slave(struct device *d, | |||
1193 | struct bonding *bond = to_bond(d); | 1193 | struct bonding *bond = to_bond(d); |
1194 | int count; | 1194 | int count; |
1195 | 1195 | ||
1196 | rtnl_lock(); | ||
1197 | |||
1198 | read_lock(&bond->curr_slave_lock); | 1196 | read_lock(&bond->curr_slave_lock); |
1199 | curr = bond->curr_active_slave; | 1197 | curr = bond->curr_active_slave; |
1200 | read_unlock(&bond->curr_slave_lock); | 1198 | read_unlock(&bond->curr_slave_lock); |
@@ -1216,7 +1214,9 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1216 | struct slave *new_active = NULL; | 1214 | struct slave *new_active = NULL; |
1217 | struct bonding *bond = to_bond(d); | 1215 | struct bonding *bond = to_bond(d); |
1218 | 1216 | ||
1217 | rtnl_lock(); | ||
1219 | write_lock_bh(&bond->lock); | 1218 | write_lock_bh(&bond->lock); |
1219 | |||
1220 | if (!USES_PRIMARY(bond->params.mode)) { | 1220 | if (!USES_PRIMARY(bond->params.mode)) { |
1221 | printk(KERN_INFO DRV_NAME | 1221 | printk(KERN_INFO DRV_NAME |
1222 | ": %s: Unable to change active slave; %s is in mode %d\n", | 1222 | ": %s: Unable to change active slave; %s is in mode %d\n", |
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index ab4d309a858f..09b4fde8d924 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -580,6 +580,16 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
580 | 580 | ||
581 | len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S; | 581 | len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S; |
582 | 582 | ||
583 | pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE); | ||
584 | |||
585 | if (macrx & XCT_MACRX_CRC) { | ||
586 | /* CRC error flagged */ | ||
587 | mac->netdev->stats.rx_errors++; | ||
588 | mac->netdev->stats.rx_crc_errors++; | ||
589 | dev_kfree_skb_irq(skb); | ||
590 | goto next; | ||
591 | } | ||
592 | |||
583 | if (len < 256) { | 593 | if (len < 256) { |
584 | struct sk_buff *new_skb; | 594 | struct sk_buff *new_skb; |
585 | 595 | ||
@@ -595,11 +605,10 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
595 | } else | 605 | } else |
596 | info->skb = NULL; | 606 | info->skb = NULL; |
597 | 607 | ||
598 | pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE); | ||
599 | |||
600 | info->dma = 0; | 608 | info->dma = 0; |
601 | 609 | ||
602 | skb_put(skb, len); | 610 | /* Don't include CRC */ |
611 | skb_put(skb, len-4); | ||
603 | 612 | ||
604 | if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) { | 613 | if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) { |
605 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 614 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
@@ -614,6 +623,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
614 | skb->protocol = eth_type_trans(skb, mac->netdev); | 623 | skb->protocol = eth_type_trans(skb, mac->netdev); |
615 | netif_receive_skb(skb); | 624 | netif_receive_skb(skb); |
616 | 625 | ||
626 | next: | ||
617 | RX_RING(mac, n) = 0; | 627 | RX_RING(mac, n) = 0; |
618 | RX_RING(mac, n+1) = 0; | 628 | RX_RING(mac, n+1) = 0; |
619 | 629 | ||
@@ -1126,7 +1136,7 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
1126 | unsigned long flags; | 1136 | unsigned long flags; |
1127 | int i, nfrags; | 1137 | int i, nfrags; |
1128 | 1138 | ||
1129 | dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_SS | XCT_MACTX_CRC_PAD; | 1139 | dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_CRC_PAD; |
1130 | 1140 | ||
1131 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1141 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1132 | const unsigned char *nh = skb_network_header(skb); | 1142 | const unsigned char *nh = skb_network_header(skb); |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 30adf726743c..a5791114b7bd 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -1456,16 +1456,11 @@ static void ql_phy_start_neg_ex(struct ql3_adapter *qdev) | |||
1456 | PHYAddr[qdev->mac_index]); | 1456 | PHYAddr[qdev->mac_index]); |
1457 | reg &= ~PHY_GIG_ALL_PARAMS; | 1457 | reg &= ~PHY_GIG_ALL_PARAMS; |
1458 | 1458 | ||
1459 | if(portConfiguration & | 1459 | if(portConfiguration & PORT_CONFIG_1000MB_SPEED) { |
1460 | PORT_CONFIG_FULL_DUPLEX_ENABLED & | 1460 | if(portConfiguration & PORT_CONFIG_FULL_DUPLEX_ENABLED) |
1461 | PORT_CONFIG_1000MB_SPEED) { | 1461 | reg |= PHY_GIG_ADV_1000F; |
1462 | reg |= PHY_GIG_ADV_1000F; | 1462 | else |
1463 | } | 1463 | reg |= PHY_GIG_ADV_1000H; |
1464 | |||
1465 | if(portConfiguration & | ||
1466 | PORT_CONFIG_HALF_DUPLEX_ENABLED & | ||
1467 | PORT_CONFIG_1000MB_SPEED) { | ||
1468 | reg |= PHY_GIG_ADV_1000H; | ||
1469 | } | 1464 | } |
1470 | 1465 | ||
1471 | ql_mii_write_reg_ex(qdev, PHY_GIG_CONTROL, reg, | 1466 | ql_mii_write_reg_ex(qdev, PHY_GIG_CONTROL, reg, |
@@ -1645,8 +1640,11 @@ static int ql_finish_auto_neg(struct ql3_adapter *qdev) | |||
1645 | return 0; | 1640 | return 0; |
1646 | } | 1641 | } |
1647 | 1642 | ||
1648 | static void ql_link_state_machine(struct ql3_adapter *qdev) | 1643 | static void ql_link_state_machine_work(struct work_struct *work) |
1649 | { | 1644 | { |
1645 | struct ql3_adapter *qdev = | ||
1646 | container_of(work, struct ql3_adapter, link_state_work.work); | ||
1647 | |||
1650 | u32 curr_link_state; | 1648 | u32 curr_link_state; |
1651 | unsigned long hw_flags; | 1649 | unsigned long hw_flags; |
1652 | 1650 | ||
@@ -1661,6 +1659,10 @@ static void ql_link_state_machine(struct ql3_adapter *qdev) | |||
1661 | "state.\n", qdev->ndev->name); | 1659 | "state.\n", qdev->ndev->name); |
1662 | 1660 | ||
1663 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1661 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
1662 | |||
1663 | /* Restart timer on 2 second interval. */ | ||
1664 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1);\ | ||
1665 | |||
1664 | return; | 1666 | return; |
1665 | } | 1667 | } |
1666 | 1668 | ||
@@ -1705,6 +1707,9 @@ static void ql_link_state_machine(struct ql3_adapter *qdev) | |||
1705 | break; | 1707 | break; |
1706 | } | 1708 | } |
1707 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1709 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
1710 | |||
1711 | /* Restart timer on 2 second interval. */ | ||
1712 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1); | ||
1708 | } | 1713 | } |
1709 | 1714 | ||
1710 | /* | 1715 | /* |
@@ -3941,19 +3946,7 @@ static void ql_get_board_info(struct ql3_adapter *qdev) | |||
3941 | static void ql3xxx_timer(unsigned long ptr) | 3946 | static void ql3xxx_timer(unsigned long ptr) |
3942 | { | 3947 | { |
3943 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; | 3948 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; |
3944 | 3949 | queue_delayed_work(qdev->workqueue, &qdev->link_state_work, 0); | |
3945 | if (test_bit(QL_RESET_ACTIVE,&qdev->flags)) { | ||
3946 | printk(KERN_DEBUG PFX | ||
3947 | "%s: Reset in progress.\n", | ||
3948 | qdev->ndev->name); | ||
3949 | goto end; | ||
3950 | } | ||
3951 | |||
3952 | ql_link_state_machine(qdev); | ||
3953 | |||
3954 | /* Restart timer on 2 second interval. */ | ||
3955 | end: | ||
3956 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1); | ||
3957 | } | 3950 | } |
3958 | 3951 | ||
3959 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, | 3952 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, |
@@ -4103,6 +4096,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev, | |||
4103 | qdev->workqueue = create_singlethread_workqueue(ndev->name); | 4096 | qdev->workqueue = create_singlethread_workqueue(ndev->name); |
4104 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); | 4097 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); |
4105 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); | 4098 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); |
4099 | INIT_DELAYED_WORK(&qdev->link_state_work, ql_link_state_machine_work); | ||
4106 | 4100 | ||
4107 | init_timer(&qdev->adapter_timer); | 4101 | init_timer(&qdev->adapter_timer); |
4108 | qdev->adapter_timer.function = ql3xxx_timer; | 4102 | qdev->adapter_timer.function = ql3xxx_timer; |
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h index fbcb0b949639..d0ffb30ef371 100644 --- a/drivers/net/qla3xxx.h +++ b/drivers/net/qla3xxx.h | |||
@@ -1286,6 +1286,7 @@ struct ql3_adapter { | |||
1286 | struct workqueue_struct *workqueue; | 1286 | struct workqueue_struct *workqueue; |
1287 | struct delayed_work reset_work; | 1287 | struct delayed_work reset_work; |
1288 | struct delayed_work tx_timeout_work; | 1288 | struct delayed_work tx_timeout_work; |
1289 | struct delayed_work link_state_work; | ||
1289 | u32 max_frame_size; | 1290 | u32 max_frame_size; |
1290 | u32 device_id; | 1291 | u32 device_id; |
1291 | u16 phyType; | 1292 | u16 phyType; |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index b94fa7ef1955..1f647b9ce352 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -171,6 +171,8 @@ static struct pci_device_id rtl8169_pci_tbl[] = { | |||
171 | { PCI_DEVICE(0x16ec, 0x0116), 0, 0, RTL_CFG_0 }, | 171 | { PCI_DEVICE(0x16ec, 0x0116), 0, 0, RTL_CFG_0 }, |
172 | { PCI_VENDOR_ID_LINKSYS, 0x1032, | 172 | { PCI_VENDOR_ID_LINKSYS, 0x1032, |
173 | PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 }, | 173 | PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 }, |
174 | { 0x0001, 0x8168, | ||
175 | PCI_ANY_ID, 0x2410, 0, 0, RTL_CFG_2 }, | ||
174 | {0,}, | 176 | {0,}, |
175 | }; | 177 | }; |
176 | 178 | ||
@@ -468,7 +470,7 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value) | |||
468 | { | 470 | { |
469 | int i; | 471 | int i; |
470 | 472 | ||
471 | RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0xFF) << 16 | value); | 473 | RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0x1f) << 16 | (value & 0xffff)); |
472 | 474 | ||
473 | for (i = 20; i > 0; i--) { | 475 | for (i = 20; i > 0; i--) { |
474 | /* | 476 | /* |
@@ -485,7 +487,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr) | |||
485 | { | 487 | { |
486 | int i, value = -1; | 488 | int i, value = -1; |
487 | 489 | ||
488 | RTL_W32(PHYAR, 0x0 | (reg_addr & 0xFF) << 16); | 490 | RTL_W32(PHYAR, 0x0 | (reg_addr & 0x1f) << 16); |
489 | 491 | ||
490 | for (i = 20; i > 0; i--) { | 492 | for (i = 20; i > 0; i--) { |
491 | /* | 493 | /* |
@@ -493,7 +495,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr) | |||
493 | * the specified MII register. | 495 | * the specified MII register. |
494 | */ | 496 | */ |
495 | if (RTL_R32(PHYAR) & 0x80000000) { | 497 | if (RTL_R32(PHYAR) & 0x80000000) { |
496 | value = (int) (RTL_R32(PHYAR) & 0xFFFF); | 498 | value = RTL_R32(PHYAR) & 0xffff; |
497 | break; | 499 | break; |
498 | } | 500 | } |
499 | udelay(25); | 501 | udelay(25); |
@@ -1245,16 +1247,6 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr) | |||
1245 | 1247 | ||
1246 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); | 1248 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); |
1247 | } | 1249 | } |
1248 | static void rtl8168b_hw_phy_config(void __iomem *ioaddr) | ||
1249 | { | ||
1250 | struct phy_reg phy_reg_init[] = { | ||
1251 | { 0x1f, 0x0000 }, | ||
1252 | { 0x10, 0xf41b }, | ||
1253 | { 0x1f, 0x0000 } | ||
1254 | }; | ||
1255 | |||
1256 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); | ||
1257 | } | ||
1258 | 1250 | ||
1259 | static void rtl8168cp_hw_phy_config(void __iomem *ioaddr) | 1251 | static void rtl8168cp_hw_phy_config(void __iomem *ioaddr) |
1260 | { | 1252 | { |
@@ -1324,11 +1316,6 @@ static void rtl_hw_phy_config(struct net_device *dev) | |||
1324 | case RTL_GIGA_MAC_VER_04: | 1316 | case RTL_GIGA_MAC_VER_04: |
1325 | rtl8169sb_hw_phy_config(ioaddr); | 1317 | rtl8169sb_hw_phy_config(ioaddr); |
1326 | break; | 1318 | break; |
1327 | case RTL_GIGA_MAC_VER_11: | ||
1328 | case RTL_GIGA_MAC_VER_12: | ||
1329 | case RTL_GIGA_MAC_VER_17: | ||
1330 | rtl8168b_hw_phy_config(ioaddr); | ||
1331 | break; | ||
1332 | case RTL_GIGA_MAC_VER_18: | 1319 | case RTL_GIGA_MAC_VER_18: |
1333 | rtl8168cp_hw_phy_config(ioaddr); | 1320 | rtl8168cp_hw_phy_config(ioaddr); |
1334 | break; | 1321 | break; |
@@ -1739,7 +1726,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1739 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); | 1726 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); |
1740 | RTL_W8(Cfg9346, Cfg9346_Lock); | 1727 | RTL_W8(Cfg9346, Cfg9346_Lock); |
1741 | 1728 | ||
1742 | if (RTL_R8(PHYstatus) & TBI_Enable) { | 1729 | if ((tp->mac_version <= RTL_GIGA_MAC_VER_06) && |
1730 | (RTL_R8(PHYstatus) & TBI_Enable)) { | ||
1743 | tp->set_speed = rtl8169_set_speed_tbi; | 1731 | tp->set_speed = rtl8169_set_speed_tbi; |
1744 | tp->get_settings = rtl8169_gset_tbi; | 1732 | tp->get_settings = rtl8169_gset_tbi; |
1745 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; | 1733 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index c27c7d63b6a5..a2070db725c9 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -52,7 +52,7 @@ | |||
52 | #include "sky2.h" | 52 | #include "sky2.h" |
53 | 53 | ||
54 | #define DRV_NAME "sky2" | 54 | #define DRV_NAME "sky2" |
55 | #define DRV_VERSION "1.19" | 55 | #define DRV_VERSION "1.20" |
56 | #define PFX DRV_NAME " " | 56 | #define PFX DRV_NAME " " |
57 | 57 | ||
58 | /* | 58 | /* |
@@ -121,6 +121,7 @@ static const struct pci_device_id sky2_id_table[] = { | |||
121 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ | 121 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ |
122 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ | 122 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ |
123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ | 123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ |
124 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */ | ||
124 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ | 125 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ |
125 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) }, /* 88E8052 */ | 126 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) }, /* 88E8052 */ |
126 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */ | 127 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */ |
@@ -134,6 +135,7 @@ static const struct pci_device_id sky2_id_table[] = { | |||
134 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4369) }, /* 88EC042 */ | 135 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4369) }, /* 88EC042 */ |
135 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */ | 136 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */ |
136 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */ | 137 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */ |
138 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */ | ||
137 | { 0 } | 139 | { 0 } |
138 | }; | 140 | }; |
139 | 141 | ||
@@ -156,7 +158,7 @@ static const char *yukon2_name[] = { | |||
156 | 158 | ||
157 | static void sky2_set_multicast(struct net_device *dev); | 159 | static void sky2_set_multicast(struct net_device *dev); |
158 | 160 | ||
159 | /* Access to external PHY */ | 161 | /* Access to PHY via serial interconnect */ |
160 | static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) | 162 | static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) |
161 | { | 163 | { |
162 | int i; | 164 | int i; |
@@ -166,13 +168,22 @@ static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) | |||
166 | GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg)); | 168 | GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg)); |
167 | 169 | ||
168 | for (i = 0; i < PHY_RETRIES; i++) { | 170 | for (i = 0; i < PHY_RETRIES; i++) { |
169 | if (!(gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY)) | 171 | u16 ctrl = gma_read16(hw, port, GM_SMI_CTRL); |
172 | if (ctrl == 0xffff) | ||
173 | goto io_error; | ||
174 | |||
175 | if (!(ctrl & GM_SMI_CT_BUSY)) | ||
170 | return 0; | 176 | return 0; |
171 | udelay(1); | 177 | |
178 | udelay(10); | ||
172 | } | 179 | } |
173 | 180 | ||
174 | printk(KERN_WARNING PFX "%s: phy write timeout\n", hw->dev[port]->name); | 181 | dev_warn(&hw->pdev->dev,"%s: phy write timeout\n", hw->dev[port]->name); |
175 | return -ETIMEDOUT; | 182 | return -ETIMEDOUT; |
183 | |||
184 | io_error: | ||
185 | dev_err(&hw->pdev->dev, "%s: phy I/O error\n", hw->dev[port]->name); | ||
186 | return -EIO; | ||
176 | } | 187 | } |
177 | 188 | ||
178 | static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) | 189 | static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) |
@@ -183,23 +194,29 @@ static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) | |||
183 | | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); | 194 | | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); |
184 | 195 | ||
185 | for (i = 0; i < PHY_RETRIES; i++) { | 196 | for (i = 0; i < PHY_RETRIES; i++) { |
186 | if (gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) { | 197 | u16 ctrl = gma_read16(hw, port, GM_SMI_CTRL); |
198 | if (ctrl == 0xffff) | ||
199 | goto io_error; | ||
200 | |||
201 | if (ctrl & GM_SMI_CT_RD_VAL) { | ||
187 | *val = gma_read16(hw, port, GM_SMI_DATA); | 202 | *val = gma_read16(hw, port, GM_SMI_DATA); |
188 | return 0; | 203 | return 0; |
189 | } | 204 | } |
190 | 205 | ||
191 | udelay(1); | 206 | udelay(10); |
192 | } | 207 | } |
193 | 208 | ||
209 | dev_warn(&hw->pdev->dev, "%s: phy read timeout\n", hw->dev[port]->name); | ||
194 | return -ETIMEDOUT; | 210 | return -ETIMEDOUT; |
211 | io_error: | ||
212 | dev_err(&hw->pdev->dev, "%s: phy I/O error\n", hw->dev[port]->name); | ||
213 | return -EIO; | ||
195 | } | 214 | } |
196 | 215 | ||
197 | static u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg) | 216 | static inline u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg) |
198 | { | 217 | { |
199 | u16 v; | 218 | u16 v; |
200 | 219 | __gm_phy_read(hw, port, reg, &v); | |
201 | if (__gm_phy_read(hw, port, reg, &v) != 0) | ||
202 | printk(KERN_WARNING PFX "%s: phy read timeout\n", hw->dev[port]->name); | ||
203 | return v; | 220 | return v; |
204 | } | 221 | } |
205 | 222 | ||
@@ -273,8 +290,6 @@ static void sky2_gmac_reset(struct sky2_hw *hw, unsigned port) | |||
273 | 290 | ||
274 | /* disable all GMAC IRQ's */ | 291 | /* disable all GMAC IRQ's */ |
275 | sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); | 292 | sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); |
276 | /* disable PHY IRQs */ | ||
277 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); | ||
278 | 293 | ||
279 | gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ | 294 | gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ |
280 | gma_write16(hw, port, GM_MC_ADDR_H2, 0); | 295 | gma_write16(hw, port, GM_MC_ADDR_H2, 0); |
@@ -1805,29 +1820,6 @@ static void sky2_link_up(struct sky2_port *sky2) | |||
1805 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), | 1820 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), |
1806 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); | 1821 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); |
1807 | 1822 | ||
1808 | if (hw->flags & SKY2_HW_NEWER_PHY) { | ||
1809 | u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); | ||
1810 | u16 led = PHY_M_LEDC_LOS_CTRL(1); /* link active */ | ||
1811 | |||
1812 | switch(sky2->speed) { | ||
1813 | case SPEED_10: | ||
1814 | led |= PHY_M_LEDC_INIT_CTRL(7); | ||
1815 | break; | ||
1816 | |||
1817 | case SPEED_100: | ||
1818 | led |= PHY_M_LEDC_STA1_CTRL(7); | ||
1819 | break; | ||
1820 | |||
1821 | case SPEED_1000: | ||
1822 | led |= PHY_M_LEDC_STA0_CTRL(7); | ||
1823 | break; | ||
1824 | } | ||
1825 | |||
1826 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); | ||
1827 | gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, led); | ||
1828 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); | ||
1829 | } | ||
1830 | |||
1831 | if (netif_msg_link(sky2)) | 1823 | if (netif_msg_link(sky2)) |
1832 | printk(KERN_INFO PFX | 1824 | printk(KERN_INFO PFX |
1833 | "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", | 1825 | "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", |
@@ -2247,20 +2239,26 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2247 | do { | 2239 | do { |
2248 | struct sky2_port *sky2; | 2240 | struct sky2_port *sky2; |
2249 | struct sky2_status_le *le = hw->st_le + hw->st_idx; | 2241 | struct sky2_status_le *le = hw->st_le + hw->st_idx; |
2250 | unsigned port = le->css & CSS_LINK_BIT; | 2242 | unsigned port; |
2251 | struct net_device *dev; | 2243 | struct net_device *dev; |
2252 | struct sk_buff *skb; | 2244 | struct sk_buff *skb; |
2253 | u32 status; | 2245 | u32 status; |
2254 | u16 length; | 2246 | u16 length; |
2247 | u8 opcode = le->opcode; | ||
2248 | |||
2249 | if (!(opcode & HW_OWNER)) | ||
2250 | break; | ||
2255 | 2251 | ||
2256 | hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); | 2252 | hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); |
2257 | 2253 | ||
2254 | port = le->css & CSS_LINK_BIT; | ||
2258 | dev = hw->dev[port]; | 2255 | dev = hw->dev[port]; |
2259 | sky2 = netdev_priv(dev); | 2256 | sky2 = netdev_priv(dev); |
2260 | length = le16_to_cpu(le->length); | 2257 | length = le16_to_cpu(le->length); |
2261 | status = le32_to_cpu(le->status); | 2258 | status = le32_to_cpu(le->status); |
2262 | 2259 | ||
2263 | switch (le->opcode & ~HW_OWNER) { | 2260 | le->opcode = 0; |
2261 | switch (opcode & ~HW_OWNER) { | ||
2264 | case OP_RXSTAT: | 2262 | case OP_RXSTAT: |
2265 | ++rx[port]; | 2263 | ++rx[port]; |
2266 | skb = sky2_receive(dev, length, status); | 2264 | skb = sky2_receive(dev, length, status); |
@@ -2353,7 +2351,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2353 | default: | 2351 | default: |
2354 | if (net_ratelimit()) | 2352 | if (net_ratelimit()) |
2355 | printk(KERN_WARNING PFX | 2353 | printk(KERN_WARNING PFX |
2356 | "unknown status opcode 0x%x\n", le->opcode); | 2354 | "unknown status opcode 0x%x\n", opcode); |
2357 | } | 2355 | } |
2358 | } while (hw->st_idx != idx); | 2356 | } while (hw->st_idx != idx); |
2359 | 2357 | ||
@@ -2439,13 +2437,26 @@ static void sky2_hw_intr(struct sky2_hw *hw) | |||
2439 | 2437 | ||
2440 | if (status & Y2_IS_PCI_EXP) { | 2438 | if (status & Y2_IS_PCI_EXP) { |
2441 | /* PCI-Express uncorrectable Error occurred */ | 2439 | /* PCI-Express uncorrectable Error occurred */ |
2442 | int pos = pci_find_aer_capability(hw->pdev); | 2440 | int aer = pci_find_aer_capability(hw->pdev); |
2443 | u32 err; | 2441 | u32 err; |
2444 | 2442 | ||
2445 | pci_read_config_dword(pdev, pos + PCI_ERR_UNCOR_STATUS, &err); | 2443 | if (aer) { |
2444 | pci_read_config_dword(pdev, aer + PCI_ERR_UNCOR_STATUS, | ||
2445 | &err); | ||
2446 | pci_cleanup_aer_uncorrect_error_status(pdev); | ||
2447 | } else { | ||
2448 | /* Either AER not configured, or not working | ||
2449 | * because of bad MMCONFIG, so just do recover | ||
2450 | * manually. | ||
2451 | */ | ||
2452 | err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); | ||
2453 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, | ||
2454 | 0xfffffffful); | ||
2455 | } | ||
2456 | |||
2446 | if (net_ratelimit()) | 2457 | if (net_ratelimit()) |
2447 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); | 2458 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); |
2448 | pci_cleanup_aer_uncorrect_error_status(pdev); | 2459 | |
2449 | } | 2460 | } |
2450 | 2461 | ||
2451 | if (status & Y2_HWE_L1_MASK) | 2462 | if (status & Y2_HWE_L1_MASK) |
@@ -2791,6 +2802,9 @@ static void sky2_reset(struct sky2_hw *hw) | |||
2791 | sky2_write8(hw, B0_CTST, CS_RST_SET); | 2802 | sky2_write8(hw, B0_CTST, CS_RST_SET); |
2792 | sky2_write8(hw, B0_CTST, CS_RST_CLR); | 2803 | sky2_write8(hw, B0_CTST, CS_RST_CLR); |
2793 | 2804 | ||
2805 | /* allow writes to PCI config */ | ||
2806 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
2807 | |||
2794 | /* clear PCI errors, if any */ | 2808 | /* clear PCI errors, if any */ |
2795 | pci_read_config_word(pdev, PCI_STATUS, &status); | 2809 | pci_read_config_word(pdev, PCI_STATUS, &status); |
2796 | status |= PCI_STATUS_ERROR_BITS; | 2810 | status |= PCI_STATUS_ERROR_BITS; |
@@ -2800,9 +2814,18 @@ static void sky2_reset(struct sky2_hw *hw) | |||
2800 | 2814 | ||
2801 | cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); | 2815 | cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); |
2802 | if (cap) { | 2816 | if (cap) { |
2803 | /* Check for advanced error reporting */ | 2817 | if (pci_find_aer_capability(pdev)) { |
2804 | pci_cleanup_aer_uncorrect_error_status(pdev); | 2818 | /* Check for advanced error reporting */ |
2805 | pci_cleanup_aer_correct_error_status(pdev); | 2819 | pci_cleanup_aer_uncorrect_error_status(pdev); |
2820 | pci_cleanup_aer_correct_error_status(pdev); | ||
2821 | } else { | ||
2822 | dev_warn(&pdev->dev, | ||
2823 | "PCI Express Advanced Error Reporting" | ||
2824 | " not configured or MMCONFIG problem?\n"); | ||
2825 | |||
2826 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, | ||
2827 | 0xfffffffful); | ||
2828 | } | ||
2806 | 2829 | ||
2807 | /* If error bit is stuck on ignore it */ | 2830 | /* If error bit is stuck on ignore it */ |
2808 | if (sky2_read32(hw, B0_HWE_ISRC) & Y2_IS_PCI_EXP) | 2831 | if (sky2_read32(hw, B0_HWE_ISRC) & Y2_IS_PCI_EXP) |
@@ -3974,7 +3997,8 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, | |||
3974 | dev->tx_timeout = sky2_tx_timeout; | 3997 | dev->tx_timeout = sky2_tx_timeout; |
3975 | dev->watchdog_timeo = TX_WATCHDOG; | 3998 | dev->watchdog_timeo = TX_WATCHDOG; |
3976 | #ifdef CONFIG_NET_POLL_CONTROLLER | 3999 | #ifdef CONFIG_NET_POLL_CONTROLLER |
3977 | dev->poll_controller = sky2_netpoll; | 4000 | if (port == 0) |
4001 | dev->poll_controller = sky2_netpoll; | ||
3978 | #endif | 4002 | #endif |
3979 | 4003 | ||
3980 | sky2 = netdev_priv(dev); | 4004 | sky2 = netdev_priv(dev); |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 49ee264064ab..69525fd7908d 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -247,7 +247,8 @@ enum csr_regs { | |||
247 | B3_PA_CTRL = 0x01f0, | 247 | B3_PA_CTRL = 0x01f0, |
248 | B3_PA_TEST = 0x01f2, | 248 | B3_PA_TEST = 0x01f2, |
249 | 249 | ||
250 | Y2_CFG_SPC = 0x1c00, | 250 | Y2_CFG_SPC = 0x1c00, /* PCI config space region */ |
251 | Y2_CFG_AER = 0x1d00, /* PCI Advanced Error Report region */ | ||
251 | }; | 252 | }; |
252 | 253 | ||
253 | /* B0_CTST 16 bit Control/Status register */ | 254 | /* B0_CTST 16 bit Control/Status register */ |
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 729fd28c08b5..db34e1eb67e9 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h | |||
@@ -224,6 +224,21 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | #elif defined(CONFIG_MACH_ZYLONITE) | ||
228 | |||
229 | #define SMC_CAN_USE_8BIT 1 | ||
230 | #define SMC_CAN_USE_16BIT 1 | ||
231 | #define SMC_CAN_USE_32BIT 0 | ||
232 | #define SMC_IO_SHIFT 0 | ||
233 | #define SMC_NOWAIT 1 | ||
234 | #define SMC_USE_PXA_DMA 1 | ||
235 | #define SMC_inb(a, r) readb((a) + (r)) | ||
236 | #define SMC_inw(a, r) readw((a) + (r)) | ||
237 | #define SMC_insw(a, r, p, l) insw((a) + (r), p, l) | ||
238 | #define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) | ||
239 | #define SMC_outb(v, a, r) writeb(v, (a) + (r)) | ||
240 | #define SMC_outw(v, a, r) writew(v, (a) + (r)) | ||
241 | |||
227 | #elif defined(CONFIG_ARCH_OMAP) | 242 | #elif defined(CONFIG_ARCH_OMAP) |
228 | 243 | ||
229 | /* We can only do 16-bit reads and writes in the static memory space. */ | 244 | /* We can only do 16-bit reads and writes in the static memory space. */ |
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index dae5c8d5a318..2b733c582915 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -325,7 +325,7 @@ config HERMES | |||
325 | Cabletron/EnteraSys Roamabout, ELSA AirLancer, MELCO Buffalo, Avaya, | 325 | Cabletron/EnteraSys Roamabout, ELSA AirLancer, MELCO Buffalo, Avaya, |
326 | IBM High Rate Wireless, Farralon Syyline, Samsung MagicLAN, Netgear | 326 | IBM High Rate Wireless, Farralon Syyline, Samsung MagicLAN, Netgear |
327 | MA401, LinkSys WPC-11, D-Link DWL-650, 3Com AirConnect, Intel | 327 | MA401, LinkSys WPC-11, D-Link DWL-650, 3Com AirConnect, Intel |
328 | PRO/Wireless, and Symbol Spectrum24 High Rate amongst others. | 328 | IPW2011, and Symbol Spectrum24 High Rate amongst others. |
329 | 329 | ||
330 | This option includes the guts of the driver, but in order to | 330 | This option includes the guts of the driver, but in order to |
331 | actually use a card you will also need to enable support for PCMCIA | 331 | actually use a card you will also need to enable support for PCMCIA |
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig index e3c573e56b63..fdbc351ac333 100644 --- a/drivers/net/wireless/b43/Kconfig +++ b/drivers/net/wireless/b43/Kconfig | |||
@@ -61,16 +61,18 @@ config B43_PCMCIA | |||
61 | 61 | ||
62 | If unsure, say N. | 62 | If unsure, say N. |
63 | 63 | ||
64 | # LED support | 64 | # This config option automatically enables b43 LEDS support, |
65 | # if it's possible. | ||
65 | config B43_LEDS | 66 | config B43_LEDS |
66 | bool | 67 | bool |
67 | depends on B43 && MAC80211_LEDS | 68 | depends on B43 && MAC80211_LEDS && (LEDS_CLASS = y || LEDS_CLASS = B43) |
68 | default y | 69 | default y |
69 | 70 | ||
70 | # RFKILL support | 71 | # This config option automatically enables b43 RFKILL support, |
72 | # if it's possible. | ||
71 | config B43_RFKILL | 73 | config B43_RFKILL |
72 | bool | 74 | bool |
73 | depends on B43 && RFKILL && RFKILL_INPUT && INPUT_POLLDEV | 75 | depends on B43 && (RFKILL = y || RFKILL = B43) && RFKILL_INPUT && (INPUT_POLLDEV = y || INPUT_POLLDEV = B43) |
74 | default y | 76 | default y |
75 | 77 | ||
76 | config B43_DEBUG | 78 | config B43_DEBUG |
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c index 734e70e1a06d..ef0075d9f9cb 100644 --- a/drivers/net/wireless/b43/debugfs.c +++ b/drivers/net/wireless/b43/debugfs.c | |||
@@ -128,7 +128,7 @@ static ssize_t shm_read_file(struct b43_wldev *dev, | |||
128 | __le16 *le16buf = (__le16 *)buf; | 128 | __le16 *le16buf = (__le16 *)buf; |
129 | 129 | ||
130 | for (i = 0; i < 0x1000; i++) { | 130 | for (i = 0; i < 0x1000; i++) { |
131 | if (bufsize <= 0) | 131 | if (bufsize < sizeof(tmp)) |
132 | break; | 132 | break; |
133 | tmp = b43_shm_read16(dev, B43_SHM_SHARED, 2 * i); | 133 | tmp = b43_shm_read16(dev, B43_SHM_SHARED, 2 * i); |
134 | le16buf[i] = cpu_to_le16(tmp); | 134 | le16buf[i] = cpu_to_le16(tmp); |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 5058e60e5703..2b17c1dc46f1 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -2985,6 +2985,16 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) | |||
2985 | 2985 | ||
2986 | if (b43_status(dev) < B43_STAT_STARTED) | 2986 | if (b43_status(dev) < B43_STAT_STARTED) |
2987 | return; | 2987 | return; |
2988 | |||
2989 | /* Disable and sync interrupts. We must do this before than | ||
2990 | * setting the status to INITIALIZED, as the interrupt handler | ||
2991 | * won't care about IRQs then. */ | ||
2992 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
2993 | dev->irq_savedstate = b43_interrupt_disable(dev, B43_IRQ_ALL); | ||
2994 | b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* flush */ | ||
2995 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
2996 | b43_synchronize_irq(dev); | ||
2997 | |||
2988 | b43_set_status(dev, B43_STAT_INITIALIZED); | 2998 | b43_set_status(dev, B43_STAT_INITIALIZED); |
2989 | 2999 | ||
2990 | mutex_unlock(&wl->mutex); | 3000 | mutex_unlock(&wl->mutex); |
@@ -2995,13 +3005,6 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) | |||
2995 | 3005 | ||
2996 | ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy. | 3006 | ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy. |
2997 | 3007 | ||
2998 | /* Disable and sync interrupts. */ | ||
2999 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
3000 | dev->irq_savedstate = b43_interrupt_disable(dev, B43_IRQ_ALL); | ||
3001 | b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* flush */ | ||
3002 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
3003 | b43_synchronize_irq(dev); | ||
3004 | |||
3005 | b43_mac_suspend(dev); | 3008 | b43_mac_suspend(dev); |
3006 | free_irq(dev->dev->irq, dev); | 3009 | free_irq(dev->dev->irq, dev); |
3007 | b43dbg(wl, "Wireless interface stopped\n"); | 3010 | b43dbg(wl, "Wireless interface stopped\n"); |
@@ -3661,7 +3664,6 @@ static int b43_setup_modes(struct b43_wldev *dev, | |||
3661 | 3664 | ||
3662 | static void b43_wireless_core_detach(struct b43_wldev *dev) | 3665 | static void b43_wireless_core_detach(struct b43_wldev *dev) |
3663 | { | 3666 | { |
3664 | b43_rfkill_free(dev); | ||
3665 | /* We release firmware that late to not be required to re-request | 3667 | /* We release firmware that late to not be required to re-request |
3666 | * is all the time when we reinit the core. */ | 3668 | * is all the time when we reinit the core. */ |
3667 | b43_release_firmware(dev); | 3669 | b43_release_firmware(dev); |
@@ -3747,7 +3749,6 @@ static int b43_wireless_core_attach(struct b43_wldev *dev) | |||
3747 | if (!wl->current_dev) | 3749 | if (!wl->current_dev) |
3748 | wl->current_dev = dev; | 3750 | wl->current_dev = dev; |
3749 | INIT_WORK(&dev->restart_work, b43_chip_reset); | 3751 | INIT_WORK(&dev->restart_work, b43_chip_reset); |
3750 | b43_rfkill_alloc(dev); | ||
3751 | 3752 | ||
3752 | b43_radio_turn_off(dev, 1); | 3753 | b43_radio_turn_off(dev, 1); |
3753 | b43_switch_analog(dev, 0); | 3754 | b43_switch_analog(dev, 0); |
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index b242a9a90dd2..b79a6bd5396d 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
@@ -65,12 +65,12 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
65 | tuple_t tuple; | 65 | tuple_t tuple; |
66 | cisparse_t parse; | 66 | cisparse_t parse; |
67 | int err = -ENOMEM; | 67 | int err = -ENOMEM; |
68 | int res; | 68 | int res = 0; |
69 | unsigned char buf[64]; | 69 | unsigned char buf[64]; |
70 | 70 | ||
71 | ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); | 71 | ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); |
72 | if (!ssb) | 72 | if (!ssb) |
73 | goto out; | 73 | goto out_error; |
74 | 74 | ||
75 | err = -ENODEV; | 75 | err = -ENODEV; |
76 | tuple.DesiredTuple = CISTPL_CONFIG; | 76 | tuple.DesiredTuple = CISTPL_CONFIG; |
@@ -96,10 +96,12 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
96 | dev->io.NumPorts2 = 0; | 96 | dev->io.NumPorts2 = 0; |
97 | dev->io.Attributes2 = 0; | 97 | dev->io.Attributes2 = 0; |
98 | 98 | ||
99 | win.Attributes = WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; | 99 | win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM | |
100 | WIN_ENABLE | WIN_DATA_WIDTH_16 | | ||
101 | WIN_USE_WAIT; | ||
100 | win.Base = 0; | 102 | win.Base = 0; |
101 | win.Size = SSB_CORE_SIZE; | 103 | win.Size = SSB_CORE_SIZE; |
102 | win.AccessSpeed = 1000; | 104 | win.AccessSpeed = 250; |
103 | res = pcmcia_request_window(&dev, &win, &dev->win); | 105 | res = pcmcia_request_window(&dev, &win, &dev->win); |
104 | if (res != CS_SUCCESS) | 106 | if (res != CS_SUCCESS) |
105 | goto err_kfree_ssb; | 107 | goto err_kfree_ssb; |
@@ -108,21 +110,34 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
108 | mem.Page = 0; | 110 | mem.Page = 0; |
109 | res = pcmcia_map_mem_page(dev->win, &mem); | 111 | res = pcmcia_map_mem_page(dev->win, &mem); |
110 | if (res != CS_SUCCESS) | 112 | if (res != CS_SUCCESS) |
111 | goto err_kfree_ssb; | 113 | goto err_disable; |
114 | |||
115 | dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FIRST_SHARED; | ||
116 | dev->irq.IRQInfo1 = IRQ_LEVEL_ID | IRQ_SHARE_ID; | ||
117 | dev->irq.Handler = NULL; /* The handler is registered later. */ | ||
118 | dev->irq.Instance = NULL; | ||
119 | res = pcmcia_request_irq(dev, &dev->irq); | ||
120 | if (res != CS_SUCCESS) | ||
121 | goto err_disable; | ||
112 | 122 | ||
113 | res = pcmcia_request_configuration(dev, &dev->conf); | 123 | res = pcmcia_request_configuration(dev, &dev->conf); |
114 | if (res != CS_SUCCESS) | 124 | if (res != CS_SUCCESS) |
115 | goto err_disable; | 125 | goto err_disable; |
116 | 126 | ||
117 | err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); | 127 | err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); |
128 | if (err) | ||
129 | goto err_disable; | ||
118 | dev->priv = ssb; | 130 | dev->priv = ssb; |
119 | 131 | ||
120 | out: | 132 | return 0; |
121 | return err; | 133 | |
122 | err_disable: | 134 | err_disable: |
123 | pcmcia_disable_device(dev); | 135 | pcmcia_disable_device(dev); |
124 | err_kfree_ssb: | 136 | err_kfree_ssb: |
125 | kfree(ssb); | 137 | kfree(ssb); |
138 | out_error: | ||
139 | printk(KERN_ERR "b43-pcmcia: Initialization failed (%d, %d)\n", | ||
140 | res, err); | ||
126 | return err; | 141 | return err; |
127 | } | 142 | } |
128 | 143 | ||
@@ -131,22 +146,21 @@ static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev) | |||
131 | struct ssb_bus *ssb = dev->priv; | 146 | struct ssb_bus *ssb = dev->priv; |
132 | 147 | ||
133 | ssb_bus_unregister(ssb); | 148 | ssb_bus_unregister(ssb); |
134 | pcmcia_release_window(dev->win); | ||
135 | pcmcia_disable_device(dev); | 149 | pcmcia_disable_device(dev); |
136 | kfree(ssb); | 150 | kfree(ssb); |
137 | dev->priv = NULL; | 151 | dev->priv = NULL; |
138 | } | 152 | } |
139 | 153 | ||
140 | static struct pcmcia_driver b43_pcmcia_driver = { | 154 | static struct pcmcia_driver b43_pcmcia_driver = { |
141 | .owner = THIS_MODULE, | 155 | .owner = THIS_MODULE, |
142 | .drv = { | 156 | .drv = { |
143 | .name = "b43-pcmcia", | 157 | .name = "b43-pcmcia", |
144 | }, | 158 | }, |
145 | .id_table = b43_pcmcia_tbl, | 159 | .id_table = b43_pcmcia_tbl, |
146 | .probe = b43_pcmcia_probe, | 160 | .probe = b43_pcmcia_probe, |
147 | .remove = b43_pcmcia_remove, | 161 | .remove = __devexit_p(b43_pcmcia_remove), |
148 | .suspend = b43_pcmcia_suspend, | 162 | .suspend = b43_pcmcia_suspend, |
149 | .resume = b43_pcmcia_resume, | 163 | .resume = b43_pcmcia_resume, |
150 | }; | 164 | }; |
151 | 165 | ||
152 | int b43_pcmcia_init(void) | 166 | int b43_pcmcia_init(void) |
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c index 800e0a61a7f5..9b1f905ffbf4 100644 --- a/drivers/net/wireless/b43/rfkill.c +++ b/drivers/net/wireless/b43/rfkill.c | |||
@@ -47,32 +47,35 @@ static void b43_rfkill_poll(struct input_polled_dev *poll_dev) | |||
47 | struct b43_wldev *dev = poll_dev->private; | 47 | struct b43_wldev *dev = poll_dev->private; |
48 | struct b43_wl *wl = dev->wl; | 48 | struct b43_wl *wl = dev->wl; |
49 | bool enabled; | 49 | bool enabled; |
50 | bool report_change = 0; | ||
50 | 51 | ||
51 | mutex_lock(&wl->mutex); | 52 | mutex_lock(&wl->mutex); |
52 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); | 53 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); |
53 | enabled = b43_is_hw_radio_enabled(dev); | 54 | enabled = b43_is_hw_radio_enabled(dev); |
54 | if (unlikely(enabled != dev->radio_hw_enable)) { | 55 | if (unlikely(enabled != dev->radio_hw_enable)) { |
55 | dev->radio_hw_enable = enabled; | 56 | dev->radio_hw_enable = enabled; |
57 | report_change = 1; | ||
56 | b43info(wl, "Radio hardware status changed to %s\n", | 58 | b43info(wl, "Radio hardware status changed to %s\n", |
57 | enabled ? "ENABLED" : "DISABLED"); | 59 | enabled ? "ENABLED" : "DISABLED"); |
58 | mutex_unlock(&wl->mutex); | 60 | } |
61 | mutex_unlock(&wl->mutex); | ||
62 | |||
63 | if (unlikely(report_change)) | ||
59 | input_report_key(poll_dev->input, KEY_WLAN, enabled); | 64 | input_report_key(poll_dev->input, KEY_WLAN, enabled); |
60 | } else | ||
61 | mutex_unlock(&wl->mutex); | ||
62 | } | 65 | } |
63 | 66 | ||
64 | /* Called when the RFKILL toggled in software. | 67 | /* Called when the RFKILL toggled in software. */ |
65 | * This is called without locking. */ | ||
66 | static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) | 68 | static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) |
67 | { | 69 | { |
68 | struct b43_wldev *dev = data; | 70 | struct b43_wldev *dev = data; |
69 | struct b43_wl *wl = dev->wl; | 71 | struct b43_wl *wl = dev->wl; |
70 | int err = 0; | 72 | int err = 0; |
71 | 73 | ||
72 | mutex_lock(&wl->mutex); | 74 | if (!wl->rfkill.registered) |
73 | if (b43_status(dev) < B43_STAT_INITIALIZED) | 75 | return 0; |
74 | goto out_unlock; | ||
75 | 76 | ||
77 | mutex_lock(&wl->mutex); | ||
78 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); | ||
76 | switch (state) { | 79 | switch (state) { |
77 | case RFKILL_STATE_ON: | 80 | case RFKILL_STATE_ON: |
78 | if (!dev->radio_hw_enable) { | 81 | if (!dev->radio_hw_enable) { |
@@ -89,7 +92,6 @@ static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) | |||
89 | b43_radio_turn_off(dev, 0); | 92 | b43_radio_turn_off(dev, 0); |
90 | break; | 93 | break; |
91 | } | 94 | } |
92 | |||
93 | out_unlock: | 95 | out_unlock: |
94 | mutex_unlock(&wl->mutex); | 96 | mutex_unlock(&wl->mutex); |
95 | 97 | ||
@@ -98,11 +100,11 @@ out_unlock: | |||
98 | 100 | ||
99 | char * b43_rfkill_led_name(struct b43_wldev *dev) | 101 | char * b43_rfkill_led_name(struct b43_wldev *dev) |
100 | { | 102 | { |
101 | struct b43_wl *wl = dev->wl; | 103 | struct b43_rfkill *rfk = &(dev->wl->rfkill); |
102 | 104 | ||
103 | if (!wl->rfkill.rfkill) | 105 | if (!rfk->registered) |
104 | return NULL; | 106 | return NULL; |
105 | return rfkill_get_led_name(wl->rfkill.rfkill); | 107 | return rfkill_get_led_name(rfk->rfkill); |
106 | } | 108 | } |
107 | 109 | ||
108 | void b43_rfkill_init(struct b43_wldev *dev) | 110 | void b43_rfkill_init(struct b43_wldev *dev) |
@@ -111,53 +113,13 @@ void b43_rfkill_init(struct b43_wldev *dev) | |||
111 | struct b43_rfkill *rfk = &(wl->rfkill); | 113 | struct b43_rfkill *rfk = &(wl->rfkill); |
112 | int err; | 114 | int err; |
113 | 115 | ||
114 | if (rfk->rfkill) { | 116 | rfk->registered = 0; |
115 | err = rfkill_register(rfk->rfkill); | ||
116 | if (err) { | ||
117 | b43warn(wl, "Failed to register RF-kill button\n"); | ||
118 | goto err_free_rfk; | ||
119 | } | ||
120 | } | ||
121 | if (rfk->poll_dev) { | ||
122 | err = input_register_polled_device(rfk->poll_dev); | ||
123 | if (err) { | ||
124 | b43warn(wl, "Failed to register RF-kill polldev\n"); | ||
125 | goto err_free_polldev; | ||
126 | } | ||
127 | } | ||
128 | |||
129 | return; | ||
130 | err_free_rfk: | ||
131 | rfkill_free(rfk->rfkill); | ||
132 | rfk->rfkill = NULL; | ||
133 | err_free_polldev: | ||
134 | input_free_polled_device(rfk->poll_dev); | ||
135 | rfk->poll_dev = NULL; | ||
136 | } | ||
137 | |||
138 | void b43_rfkill_exit(struct b43_wldev *dev) | ||
139 | { | ||
140 | struct b43_rfkill *rfk = &(dev->wl->rfkill); | ||
141 | |||
142 | if (rfk->poll_dev) | ||
143 | input_unregister_polled_device(rfk->poll_dev); | ||
144 | if (rfk->rfkill) | ||
145 | rfkill_unregister(rfk->rfkill); | ||
146 | } | ||
147 | |||
148 | void b43_rfkill_alloc(struct b43_wldev *dev) | ||
149 | { | ||
150 | struct b43_wl *wl = dev->wl; | ||
151 | struct b43_rfkill *rfk = &(wl->rfkill); | ||
152 | 117 | ||
118 | rfk->rfkill = rfkill_allocate(dev->dev->dev, RFKILL_TYPE_WLAN); | ||
119 | if (!rfk->rfkill) | ||
120 | goto out_error; | ||
153 | snprintf(rfk->name, sizeof(rfk->name), | 121 | snprintf(rfk->name, sizeof(rfk->name), |
154 | "b43-%s", wiphy_name(wl->hw->wiphy)); | 122 | "b43-%s", wiphy_name(wl->hw->wiphy)); |
155 | |||
156 | rfk->rfkill = rfkill_allocate(dev->dev->dev, RFKILL_TYPE_WLAN); | ||
157 | if (!rfk->rfkill) { | ||
158 | b43warn(wl, "Failed to allocate RF-kill button\n"); | ||
159 | return; | ||
160 | } | ||
161 | rfk->rfkill->name = rfk->name; | 123 | rfk->rfkill->name = rfk->name; |
162 | rfk->rfkill->state = RFKILL_STATE_ON; | 124 | rfk->rfkill->state = RFKILL_STATE_ON; |
163 | rfk->rfkill->data = dev; | 125 | rfk->rfkill->data = dev; |
@@ -165,18 +127,45 @@ void b43_rfkill_alloc(struct b43_wldev *dev) | |||
165 | rfk->rfkill->user_claim_unsupported = 1; | 127 | rfk->rfkill->user_claim_unsupported = 1; |
166 | 128 | ||
167 | rfk->poll_dev = input_allocate_polled_device(); | 129 | rfk->poll_dev = input_allocate_polled_device(); |
168 | if (rfk->poll_dev) { | 130 | if (!rfk->poll_dev) |
169 | rfk->poll_dev->private = dev; | 131 | goto err_free_rfk; |
170 | rfk->poll_dev->poll = b43_rfkill_poll; | 132 | rfk->poll_dev->private = dev; |
171 | rfk->poll_dev->poll_interval = 1000; /* msecs */ | 133 | rfk->poll_dev->poll = b43_rfkill_poll; |
172 | } else | 134 | rfk->poll_dev->poll_interval = 1000; /* msecs */ |
173 | b43warn(wl, "Failed to allocate RF-kill polldev\n"); | 135 | |
136 | err = rfkill_register(rfk->rfkill); | ||
137 | if (err) | ||
138 | goto err_free_polldev; | ||
139 | err = input_register_polled_device(rfk->poll_dev); | ||
140 | if (err) | ||
141 | goto err_unreg_rfk; | ||
142 | |||
143 | rfk->registered = 1; | ||
144 | |||
145 | return; | ||
146 | err_unreg_rfk: | ||
147 | rfkill_unregister(rfk->rfkill); | ||
148 | err_free_polldev: | ||
149 | input_free_polled_device(rfk->poll_dev); | ||
150 | rfk->poll_dev = NULL; | ||
151 | err_free_rfk: | ||
152 | rfkill_free(rfk->rfkill); | ||
153 | rfk->rfkill = NULL; | ||
154 | out_error: | ||
155 | rfk->registered = 0; | ||
156 | b43warn(wl, "RF-kill button init failed\n"); | ||
174 | } | 157 | } |
175 | 158 | ||
176 | void b43_rfkill_free(struct b43_wldev *dev) | 159 | void b43_rfkill_exit(struct b43_wldev *dev) |
177 | { | 160 | { |
178 | struct b43_rfkill *rfk = &(dev->wl->rfkill); | 161 | struct b43_rfkill *rfk = &(dev->wl->rfkill); |
179 | 162 | ||
163 | if (!rfk->registered) | ||
164 | return; | ||
165 | rfk->registered = 0; | ||
166 | |||
167 | input_unregister_polled_device(rfk->poll_dev); | ||
168 | rfkill_unregister(rfk->rfkill); | ||
180 | input_free_polled_device(rfk->poll_dev); | 169 | input_free_polled_device(rfk->poll_dev); |
181 | rfk->poll_dev = NULL; | 170 | rfk->poll_dev = NULL; |
182 | rfkill_free(rfk->rfkill); | 171 | rfkill_free(rfk->rfkill); |
diff --git a/drivers/net/wireless/b43/rfkill.h b/drivers/net/wireless/b43/rfkill.h index 29544e8c9e5f..adacf936d815 100644 --- a/drivers/net/wireless/b43/rfkill.h +++ b/drivers/net/wireless/b43/rfkill.h | |||
@@ -15,14 +15,14 @@ struct b43_rfkill { | |||
15 | struct rfkill *rfkill; | 15 | struct rfkill *rfkill; |
16 | /* The poll device for the RFKILL input button */ | 16 | /* The poll device for the RFKILL input button */ |
17 | struct input_polled_dev *poll_dev; | 17 | struct input_polled_dev *poll_dev; |
18 | /* Did initialization succeed? Used for freeing. */ | ||
19 | bool registered; | ||
18 | /* The unique name of this rfkill switch */ | 20 | /* The unique name of this rfkill switch */ |
19 | char name[32]; | 21 | char name[sizeof("b43-phy4294967295")]; |
20 | }; | 22 | }; |
21 | 23 | ||
22 | /* All the init functions return void, because we are not interested | 24 | /* The init function returns void, because we are not interested |
23 | * in failing the b43 init process when rfkill init failed. */ | 25 | * in failing the b43 init process when rfkill init failed. */ |
24 | void b43_rfkill_alloc(struct b43_wldev *dev); | ||
25 | void b43_rfkill_free(struct b43_wldev *dev); | ||
26 | void b43_rfkill_init(struct b43_wldev *dev); | 26 | void b43_rfkill_init(struct b43_wldev *dev); |
27 | void b43_rfkill_exit(struct b43_wldev *dev); | 27 | void b43_rfkill_exit(struct b43_wldev *dev); |
28 | 28 | ||
@@ -36,12 +36,6 @@ struct b43_rfkill { | |||
36 | /* empty */ | 36 | /* empty */ |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static inline void b43_rfkill_alloc(struct b43_wldev *dev) | ||
40 | { | ||
41 | } | ||
42 | static inline void b43_rfkill_free(struct b43_wldev *dev) | ||
43 | { | ||
44 | } | ||
45 | static inline void b43_rfkill_init(struct b43_wldev *dev) | 39 | static inline void b43_rfkill_init(struct b43_wldev *dev) |
46 | { | 40 | { |
47 | } | 41 | } |
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c index eefa6fb79685..619b4534ef09 100644 --- a/drivers/net/wireless/b43legacy/debugfs.c +++ b/drivers/net/wireless/b43legacy/debugfs.c | |||
@@ -124,7 +124,7 @@ static ssize_t shm_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufs | |||
124 | __le16 *le16buf = (__le16 *)buf; | 124 | __le16 *le16buf = (__le16 *)buf; |
125 | 125 | ||
126 | for (i = 0; i < 0x1000; i++) { | 126 | for (i = 0; i < 0x1000; i++) { |
127 | if (bufsize <= 0) | 127 | if (bufsize < sizeof(tmp)) |
128 | break; | 128 | break; |
129 | tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i); | 129 | tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i); |
130 | le16buf[i] = cpu_to_le16(tmp); | 130 | le16buf[i] = cpu_to_le16(tmp); |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index f0e56dfc9ecf..3bde1e9ab428 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -2781,6 +2781,17 @@ static void b43legacy_wireless_core_stop(struct b43legacy_wldev *dev) | |||
2781 | 2781 | ||
2782 | if (b43legacy_status(dev) < B43legacy_STAT_STARTED) | 2782 | if (b43legacy_status(dev) < B43legacy_STAT_STARTED) |
2783 | return; | 2783 | return; |
2784 | |||
2785 | /* Disable and sync interrupts. We must do this before than | ||
2786 | * setting the status to INITIALIZED, as the interrupt handler | ||
2787 | * won't care about IRQs then. */ | ||
2788 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
2789 | dev->irq_savedstate = b43legacy_interrupt_disable(dev, | ||
2790 | B43legacy_IRQ_ALL); | ||
2791 | b43legacy_read32(dev, B43legacy_MMIO_GEN_IRQ_MASK); /* flush */ | ||
2792 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
2793 | b43legacy_synchronize_irq(dev); | ||
2794 | |||
2784 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); | 2795 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); |
2785 | 2796 | ||
2786 | mutex_unlock(&wl->mutex); | 2797 | mutex_unlock(&wl->mutex); |
@@ -2791,14 +2802,6 @@ static void b43legacy_wireless_core_stop(struct b43legacy_wldev *dev) | |||
2791 | 2802 | ||
2792 | ieee80211_stop_queues(wl->hw); /* FIXME this could cause a deadlock */ | 2803 | ieee80211_stop_queues(wl->hw); /* FIXME this could cause a deadlock */ |
2793 | 2804 | ||
2794 | /* Disable and sync interrupts. */ | ||
2795 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
2796 | dev->irq_savedstate = b43legacy_interrupt_disable(dev, | ||
2797 | B43legacy_IRQ_ALL); | ||
2798 | b43legacy_read32(dev, B43legacy_MMIO_GEN_IRQ_MASK); /* flush */ | ||
2799 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
2800 | b43legacy_synchronize_irq(dev); | ||
2801 | |||
2802 | b43legacy_mac_suspend(dev); | 2805 | b43legacy_mac_suspend(dev); |
2803 | free_irq(dev->dev->irq, dev); | 2806 | free_irq(dev->dev->irq, dev); |
2804 | b43legacydbg(wl, "Wireless interface stopped\n"); | 2807 | b43legacydbg(wl, "Wireless interface stopped\n"); |
@@ -3332,7 +3335,7 @@ out_mutex_unlock: | |||
3332 | return err; | 3335 | return err; |
3333 | } | 3336 | } |
3334 | 3337 | ||
3335 | void b43legacy_stop(struct ieee80211_hw *hw) | 3338 | static void b43legacy_stop(struct ieee80211_hw *hw) |
3336 | { | 3339 | { |
3337 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3340 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
3338 | struct b43legacy_wldev *dev = wl->current_dev; | 3341 | struct b43legacy_wldev *dev = wl->current_dev; |
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c index 7da3664b8515..fc876ba18572 100644 --- a/drivers/net/wireless/hostap/hostap_pci.c +++ b/drivers/net/wireless/hostap/hostap_pci.c | |||
@@ -444,7 +444,7 @@ static int prism2_pci_resume(struct pci_dev *pdev) | |||
444 | 444 | ||
445 | MODULE_DEVICE_TABLE(pci, prism2_pci_id_table); | 445 | MODULE_DEVICE_TABLE(pci, prism2_pci_id_table); |
446 | 446 | ||
447 | static struct pci_driver prism2_pci_drv_id = { | 447 | static struct pci_driver prism2_pci_driver = { |
448 | .name = "hostap_pci", | 448 | .name = "hostap_pci", |
449 | .id_table = prism2_pci_id_table, | 449 | .id_table = prism2_pci_id_table, |
450 | .probe = prism2_pci_probe, | 450 | .probe = prism2_pci_probe, |
@@ -458,13 +458,13 @@ static struct pci_driver prism2_pci_drv_id = { | |||
458 | 458 | ||
459 | static int __init init_prism2_pci(void) | 459 | static int __init init_prism2_pci(void) |
460 | { | 460 | { |
461 | return pci_register_driver(&prism2_pci_drv_id); | 461 | return pci_register_driver(&prism2_pci_driver); |
462 | } | 462 | } |
463 | 463 | ||
464 | 464 | ||
465 | static void __exit exit_prism2_pci(void) | 465 | static void __exit exit_prism2_pci(void) |
466 | { | 466 | { |
467 | pci_unregister_driver(&prism2_pci_drv_id); | 467 | pci_unregister_driver(&prism2_pci_driver); |
468 | } | 468 | } |
469 | 469 | ||
470 | 470 | ||
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 8d53d08b9691..fc6cdd8086c1 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -1267,7 +1267,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv) | |||
1267 | IPW2100_INTA_FATAL_ERROR | | 1267 | IPW2100_INTA_FATAL_ERROR | |
1268 | IPW2100_INTA_PARITY_ERROR); | 1268 | IPW2100_INTA_PARITY_ERROR); |
1269 | } | 1269 | } |
1270 | } while (i--); | 1270 | } while (--i); |
1271 | 1271 | ||
1272 | /* Clear out any pending INTAs since we aren't supposed to have | 1272 | /* Clear out any pending INTAs since we aren't supposed to have |
1273 | * interrupts enabled at this point... */ | 1273 | * interrupts enabled at this point... */ |
@@ -1339,7 +1339,7 @@ static int ipw2100_power_cycle_adapter(struct ipw2100_priv *priv) | |||
1339 | 1339 | ||
1340 | if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED) | 1340 | if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED) |
1341 | break; | 1341 | break; |
1342 | } while (i--); | 1342 | } while (--i); |
1343 | 1343 | ||
1344 | priv->status &= ~STATUS_RESET_PENDING; | 1344 | priv->status &= ~STATUS_RESET_PENDING; |
1345 | 1345 | ||
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 1cbbd96fdbde..be5cfd8402c7 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -912,6 +912,10 @@ static int wlan_cmd_set_boot2_ver(wlan_private * priv, | |||
912 | return 0; | 912 | return 0; |
913 | } | 913 | } |
914 | 914 | ||
915 | /* | ||
916 | * Note: NEVER use libertas_queue_cmd() with addtail==0 other than for | ||
917 | * the command timer, because it does not account for queued commands. | ||
918 | */ | ||
915 | void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) | 919 | void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) |
916 | { | 920 | { |
917 | unsigned long flags; | 921 | unsigned long flags; |
@@ -941,10 +945,11 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u | |||
941 | 945 | ||
942 | spin_lock_irqsave(&adapter->driver_lock, flags); | 946 | spin_lock_irqsave(&adapter->driver_lock, flags); |
943 | 947 | ||
944 | if (addtail) | 948 | if (addtail) { |
945 | list_add_tail((struct list_head *)cmdnode, | 949 | list_add_tail((struct list_head *)cmdnode, |
946 | &adapter->cmdpendingq); | 950 | &adapter->cmdpendingq); |
947 | else | 951 | adapter->nr_cmd_pending++; |
952 | } else | ||
948 | list_add((struct list_head *)cmdnode, &adapter->cmdpendingq); | 953 | list_add((struct list_head *)cmdnode, &adapter->cmdpendingq); |
949 | 954 | ||
950 | spin_unlock_irqrestore(&adapter->driver_lock, flags); | 955 | spin_unlock_irqrestore(&adapter->driver_lock, flags); |
@@ -1412,7 +1417,6 @@ int libertas_prepare_and_send_command(wlan_private * priv, | |||
1412 | cmdnode->cmdwaitqwoken = 0; | 1417 | cmdnode->cmdwaitqwoken = 0; |
1413 | 1418 | ||
1414 | libertas_queue_cmd(adapter, cmdnode, 1); | 1419 | libertas_queue_cmd(adapter, cmdnode, 1); |
1415 | adapter->nr_cmd_pending++; | ||
1416 | wake_up_interruptible(&priv->waitq); | 1420 | wake_up_interruptible(&priv->waitq); |
1417 | 1421 | ||
1418 | if (wait_option & CMD_OPTION_WAITFORRSP) { | 1422 | if (wait_option & CMD_OPTION_WAITFORRSP) { |
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 0360cad363a8..ec89dabc412c 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -148,11 +148,11 @@ static int if_cs_poll_while_fw_download(struct if_cs_card *card, uint addr, u8 r | |||
148 | { | 148 | { |
149 | int i; | 149 | int i; |
150 | 150 | ||
151 | for (i = 0; i < 500; i++) { | 151 | for (i = 0; i < 1000; i++) { |
152 | u8 val = if_cs_read8(card, addr); | 152 | u8 val = if_cs_read8(card, addr); |
153 | if (val == reg) | 153 | if (val == reg) |
154 | return i; | 154 | return i; |
155 | udelay(100); | 155 | udelay(500); |
156 | } | 156 | } |
157 | return -ETIME; | 157 | return -ETIME; |
158 | } | 158 | } |
@@ -878,6 +878,9 @@ static int if_cs_probe(struct pcmcia_device *p_dev) | |||
878 | goto out3; | 878 | goto out3; |
879 | } | 879 | } |
880 | 880 | ||
881 | /* Clear any interrupt cause that happend while sending | ||
882 | * firmware/initializing card */ | ||
883 | if_cs_write16(card, IF_CS_C_INT_CAUSE, IF_CS_C_IC_MASK); | ||
881 | if_cs_enable_ints(card); | 884 | if_cs_enable_ints(card); |
882 | 885 | ||
883 | /* And finally bring the card up */ | 886 | /* And finally bring the card up */ |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index a8e17076e7de..b24425f74883 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
@@ -182,12 +182,14 @@ static int if_sdio_handle_data(struct if_sdio_card *card, | |||
182 | goto out; | 182 | goto out; |
183 | } | 183 | } |
184 | 184 | ||
185 | skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE); | 185 | skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + NET_IP_ALIGN); |
186 | if (!skb) { | 186 | if (!skb) { |
187 | ret = -ENOMEM; | 187 | ret = -ENOMEM; |
188 | goto out; | 188 | goto out; |
189 | } | 189 | } |
190 | 190 | ||
191 | skb_reserve(skb, NET_IP_ALIGN); | ||
192 | |||
191 | data = skb_put(skb, size); | 193 | data = skb_put(skb, size); |
192 | 194 | ||
193 | memcpy(data, buffer, size); | 195 | memcpy(data, buffer, size); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 4a6a0bd01ff1..85ea8a8e658e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -196,6 +196,14 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, | |||
196 | struct rt2x00_dev *rt2x00dev = hw->priv; | 196 | struct rt2x00_dev *rt2x00dev = hw->priv; |
197 | struct interface *intf = &rt2x00dev->interface; | 197 | struct interface *intf = &rt2x00dev->interface; |
198 | 198 | ||
199 | /* FIXME: Beaconing is broken in rt2x00. */ | ||
200 | if (conf->type == IEEE80211_IF_TYPE_IBSS || | ||
201 | conf->type == IEEE80211_IF_TYPE_AP) { | ||
202 | ERROR(rt2x00dev, | ||
203 | "rt2x00 does not support Adhoc or Master mode"); | ||
204 | return -EOPNOTSUPP; | ||
205 | } | ||
206 | |||
199 | /* | 207 | /* |
200 | * Don't allow interfaces to be added while | 208 | * Don't allow interfaces to be added while |
201 | * either the device has disappeared or when | 209 | * either the device has disappeared or when |