diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-24 11:40:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-24 11:40:34 -0400 |
commit | d02aacff4467806ee56f147ac8eff6911d95811a (patch) | |
tree | 3bc6197f735f18dd4c3cd7c77f2a45bb9b8fac16 /drivers/net/wireless/b43 | |
parent | e270b51df657011983241ec61a1fc7de186e16cd (diff) | |
parent | 9edb74cc6ccb3a893c3d40727b7003c3c16f85a0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (22 commits)
tun: Multicast handling in tun_chr_ioctl() needs proper locking.
[NET]: Fix heavy stack usage in seq_file output routines.
[AF_UNIX] Initialise UNIX sockets before general device initcalls
[RTNETLINK]: Fix bogus ASSERT_RTNL warning
iwlwifi: Fix built-in compilation of iwlcore (part 2)
tun: Fix minor race in TUNSETLINK ioctl handling.
ppp_generic: use stats from net_device structure
iwlwifi: Don't unlock priv->mutex if it isn't locked
wireless: rndis_wlan: modparam_workaround_interval is never below 0.
prism54: prism54_get_encode() test below 0 on unsigned index
mac80211: update mesh EID values
b43: Workaround DMA quirks
mac80211: fix use before check of Qdisc length
net/mac80211/rx.c: fix off-by-one
mac80211: Fix race between ieee80211_rx_bss_put and lookup routines.
ath5k: Fix radio identification on AR5424/2424
ssb: Fix all-ones boardflags
b43: Add more btcoexist workarounds
b43: Fix HostFlags data types
b43: Workaround invalid bluetooth settings
...
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/dma.c | 47 | ||||
-rw-r--r-- | drivers/net/wireless/b43/main.c | 32 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy.c | 2 |
3 files changed, 68 insertions, 13 deletions
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 21c886a9a1d9..6dcbb3c87e72 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
@@ -980,6 +980,42 @@ void b43_dma_free(struct b43_wldev *dev) | |||
980 | destroy_ring(dma, tx_ring_mcast); | 980 | destroy_ring(dma, tx_ring_mcast); |
981 | } | 981 | } |
982 | 982 | ||
983 | static int b43_dma_set_mask(struct b43_wldev *dev, u64 mask) | ||
984 | { | ||
985 | u64 orig_mask = mask; | ||
986 | bool fallback = 0; | ||
987 | int err; | ||
988 | |||
989 | /* Try to set the DMA mask. If it fails, try falling back to a | ||
990 | * lower mask, as we can always also support a lower one. */ | ||
991 | while (1) { | ||
992 | err = ssb_dma_set_mask(dev->dev, mask); | ||
993 | if (!err) | ||
994 | break; | ||
995 | if (mask == DMA_64BIT_MASK) { | ||
996 | mask = DMA_32BIT_MASK; | ||
997 | fallback = 1; | ||
998 | continue; | ||
999 | } | ||
1000 | if (mask == DMA_32BIT_MASK) { | ||
1001 | mask = DMA_30BIT_MASK; | ||
1002 | fallback = 1; | ||
1003 | continue; | ||
1004 | } | ||
1005 | b43err(dev->wl, "The machine/kernel does not support " | ||
1006 | "the required %u-bit DMA mask\n", | ||
1007 | (unsigned int)dma_mask_to_engine_type(orig_mask)); | ||
1008 | return -EOPNOTSUPP; | ||
1009 | } | ||
1010 | if (fallback) { | ||
1011 | b43info(dev->wl, "DMA mask fallback from %u-bit to %u-bit\n", | ||
1012 | (unsigned int)dma_mask_to_engine_type(orig_mask), | ||
1013 | (unsigned int)dma_mask_to_engine_type(mask)); | ||
1014 | } | ||
1015 | |||
1016 | return 0; | ||
1017 | } | ||
1018 | |||
983 | int b43_dma_init(struct b43_wldev *dev) | 1019 | int b43_dma_init(struct b43_wldev *dev) |
984 | { | 1020 | { |
985 | struct b43_dma *dma = &dev->dma; | 1021 | struct b43_dma *dma = &dev->dma; |
@@ -989,14 +1025,9 @@ int b43_dma_init(struct b43_wldev *dev) | |||
989 | 1025 | ||
990 | dmamask = supported_dma_mask(dev); | 1026 | dmamask = supported_dma_mask(dev); |
991 | type = dma_mask_to_engine_type(dmamask); | 1027 | type = dma_mask_to_engine_type(dmamask); |
992 | err = ssb_dma_set_mask(dev->dev, dmamask); | 1028 | err = b43_dma_set_mask(dev, dmamask); |
993 | if (err) { | 1029 | if (err) |
994 | b43err(dev->wl, "The machine/kernel does not support " | 1030 | return err; |
995 | "the required DMA mask (0x%08X%08X)\n", | ||
996 | (unsigned int)((dmamask & 0xFFFFFFFF00000000ULL) >> 32), | ||
997 | (unsigned int)(dmamask & 0x00000000FFFFFFFFULL)); | ||
998 | return -EOPNOTSUPP; | ||
999 | } | ||
1000 | 1031 | ||
1001 | err = -ENOMEM; | 1032 | err = -ENOMEM; |
1002 | /* setup TX DMA channels. */ | 1033 | /* setup TX DMA channels. */ |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 943cc851c504..4bf8a99099fe 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -84,6 +84,10 @@ int b43_modparam_qos = 1; | |||
84 | module_param_named(qos, b43_modparam_qos, int, 0444); | 84 | module_param_named(qos, b43_modparam_qos, int, 0444); |
85 | MODULE_PARM_DESC(qos, "Enable QOS support (default on)"); | 85 | MODULE_PARM_DESC(qos, "Enable QOS support (default on)"); |
86 | 86 | ||
87 | static int modparam_btcoex = 1; | ||
88 | module_param_named(btcoex, modparam_btcoex, int, 0444); | ||
89 | MODULE_PARM_DESC(btcoex, "Enable Bluetooth coexistance (default on)"); | ||
90 | |||
87 | 91 | ||
88 | static const struct ssb_device_id b43_ssb_tbl[] = { | 92 | static const struct ssb_device_id b43_ssb_tbl[] = { |
89 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5), | 93 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5), |
@@ -3706,8 +3710,10 @@ static void setup_struct_wldev_for_init(struct b43_wldev *dev) | |||
3706 | static void b43_bluetooth_coext_enable(struct b43_wldev *dev) | 3710 | static void b43_bluetooth_coext_enable(struct b43_wldev *dev) |
3707 | { | 3711 | { |
3708 | struct ssb_sprom *sprom = &dev->dev->bus->sprom; | 3712 | struct ssb_sprom *sprom = &dev->dev->bus->sprom; |
3709 | u32 hf; | 3713 | u64 hf; |
3710 | 3714 | ||
3715 | if (!modparam_btcoex) | ||
3716 | return; | ||
3711 | if (!(sprom->boardflags_lo & B43_BFL_BTCOEXIST)) | 3717 | if (!(sprom->boardflags_lo & B43_BFL_BTCOEXIST)) |
3712 | return; | 3718 | return; |
3713 | if (dev->phy.type != B43_PHYTYPE_B && !dev->phy.gmode) | 3719 | if (dev->phy.type != B43_PHYTYPE_B && !dev->phy.gmode) |
@@ -3719,11 +3725,13 @@ static void b43_bluetooth_coext_enable(struct b43_wldev *dev) | |||
3719 | else | 3725 | else |
3720 | hf |= B43_HF_BTCOEX; | 3726 | hf |= B43_HF_BTCOEX; |
3721 | b43_hf_write(dev, hf); | 3727 | b43_hf_write(dev, hf); |
3722 | //TODO | ||
3723 | } | 3728 | } |
3724 | 3729 | ||
3725 | static void b43_bluetooth_coext_disable(struct b43_wldev *dev) | 3730 | static void b43_bluetooth_coext_disable(struct b43_wldev *dev) |
3726 | { //TODO | 3731 | { |
3732 | if (!modparam_btcoex) | ||
3733 | return; | ||
3734 | //TODO | ||
3727 | } | 3735 | } |
3728 | 3736 | ||
3729 | static void b43_imcfglo_timeouts_workaround(struct b43_wldev *dev) | 3737 | static void b43_imcfglo_timeouts_workaround(struct b43_wldev *dev) |
@@ -3852,7 +3860,8 @@ static int b43_wireless_core_init(struct b43_wldev *dev) | |||
3852 | struct ssb_sprom *sprom = &bus->sprom; | 3860 | struct ssb_sprom *sprom = &bus->sprom; |
3853 | struct b43_phy *phy = &dev->phy; | 3861 | struct b43_phy *phy = &dev->phy; |
3854 | int err; | 3862 | int err; |
3855 | u32 hf, tmp; | 3863 | u64 hf; |
3864 | u32 tmp; | ||
3856 | 3865 | ||
3857 | B43_WARN_ON(b43_status(dev) != B43_STAT_UNINIT); | 3866 | B43_WARN_ON(b43_status(dev) != B43_STAT_UNINIT); |
3858 | 3867 | ||
@@ -4414,8 +4423,16 @@ static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl) | |||
4414 | return err; | 4423 | return err; |
4415 | } | 4424 | } |
4416 | 4425 | ||
4426 | #define IS_PDEV(pdev, _vendor, _device, _subvendor, _subdevice) ( \ | ||
4427 | (pdev->vendor == PCI_VENDOR_ID_##_vendor) && \ | ||
4428 | (pdev->device == _device) && \ | ||
4429 | (pdev->subsystem_vendor == PCI_VENDOR_ID_##_subvendor) && \ | ||
4430 | (pdev->subsystem_device == _subdevice) ) | ||
4431 | |||
4417 | static void b43_sprom_fixup(struct ssb_bus *bus) | 4432 | static void b43_sprom_fixup(struct ssb_bus *bus) |
4418 | { | 4433 | { |
4434 | struct pci_dev *pdev; | ||
4435 | |||
4419 | /* boardflags workarounds */ | 4436 | /* boardflags workarounds */ |
4420 | if (bus->boardinfo.vendor == SSB_BOARDVENDOR_DELL && | 4437 | if (bus->boardinfo.vendor == SSB_BOARDVENDOR_DELL && |
4421 | bus->chip_id == 0x4301 && bus->boardinfo.rev == 0x74) | 4438 | bus->chip_id == 0x4301 && bus->boardinfo.rev == 0x74) |
@@ -4423,6 +4440,13 @@ static void b43_sprom_fixup(struct ssb_bus *bus) | |||
4423 | if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && | 4440 | if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && |
4424 | bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40) | 4441 | bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40) |
4425 | bus->sprom.boardflags_lo |= B43_BFL_PACTRL; | 4442 | bus->sprom.boardflags_lo |= B43_BFL_PACTRL; |
4443 | if (bus->bustype == SSB_BUSTYPE_PCI) { | ||
4444 | pdev = bus->host_pci; | ||
4445 | if (IS_PDEV(pdev, BROADCOM, 0x4318, ASUSTEK, 0x100F) || | ||
4446 | IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0015) || | ||
4447 | IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0013)) | ||
4448 | bus->sprom.boardflags_lo &= ~B43_BFL_BTCOEXIST; | ||
4449 | } | ||
4426 | } | 4450 | } |
4427 | 4451 | ||
4428 | static void b43_wireless_exit(struct ssb_device *dev, struct b43_wl *wl) | 4452 | static void b43_wireless_exit(struct ssb_device *dev, struct b43_wl *wl) |
diff --git a/drivers/net/wireless/b43/phy.c b/drivers/net/wireless/b43/phy.c index 575c5436ebdf..de024dc03718 100644 --- a/drivers/net/wireless/b43/phy.c +++ b/drivers/net/wireless/b43/phy.c | |||
@@ -2043,7 +2043,7 @@ int b43_phy_init(struct b43_wldev *dev) | |||
2043 | void b43_set_rx_antenna(struct b43_wldev *dev, int antenna) | 2043 | void b43_set_rx_antenna(struct b43_wldev *dev, int antenna) |
2044 | { | 2044 | { |
2045 | struct b43_phy *phy = &dev->phy; | 2045 | struct b43_phy *phy = &dev->phy; |
2046 | u32 hf; | 2046 | u64 hf; |
2047 | u16 tmp; | 2047 | u16 tmp; |
2048 | int autodiv = 0; | 2048 | int autodiv = 0; |
2049 | 2049 | ||