Skip to content

Commit 8024dc1

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
2 parents fd3065b + 9e2ff36 commit 8024dc1

147 files changed

Lines changed: 2860 additions & 1428 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎MAINTAINERS‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,10 +1674,9 @@ F: drivers/net/ethernet/broadcom/tg3.*
16741674

16751675
BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
16761676
M: Brett Rudley <brudley@broadcom.com>
1677-
M: Roland Vossen <rvossen@broadcom.com>
16781677
M: Arend van Spriel <arend@broadcom.com>
16791678
M: Franky (Zhenhui) Lin <frankyl@broadcom.com>
1680-
M: Kan Yan <kanyan@broadcom.com>
1679+
M: Hante Meuleman <meuleman@broadcom.com>
16811680
L: linux-wireless@vger.kernel.org
16821681
L: brcm80211-dev-list@broadcom.com
16831682
S: Supported

‎drivers/bcma/bcma_private.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ extern void __exit bcma_host_pci_exit(void);
8484
/* driver_pci.c */
8585
u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
8686

87+
extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
88+
8789
#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
8890
bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc);
8991
void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);

‎drivers/bcma/driver_chipcommon.c‎

Lines changed: 109 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
*
55
* Copyright 2005, Broadcom Corporation
66
* Copyright 2006, 2007, Michael Buesch <m@bues.ch>
7+
* Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de>
78
*
89
* Licensed under the GNU/GPL. See COPYING for details.
910
*/
1011

1112
#include "bcma_private.h"
13+
#include <linux/bcm47xx_wdt.h>
1214
#include <linux/export.h>
15+
#include <linux/platform_device.h>
1316
#include <linux/bcma/bcma.h>
1417

1518
static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
@@ -22,6 +25,90 @@ static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
2225
return value;
2326
}
2427

28+
static u32 bcma_chipco_alp_clock(struct bcma_drv_cc *cc)
29+
{
30+
if (cc->capabilities & BCMA_CC_CAP_PMU)
31+
return bcma_pmu_alp_clock(cc);
32+
33+
return 20000000;
34+
}
35+
36+
static u32 bcma_chipco_watchdog_get_max_timer(struct bcma_drv_cc *cc)
37+
{
38+
struct bcma_bus *bus = cc->core->bus;
39+
u32 nb;
40+
41+
if (cc->capabilities & BCMA_CC_CAP_PMU) {
42+
if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
43+
nb = 32;
44+
else if (cc->core->id.rev < 26)
45+
nb = 16;
46+
else
47+
nb = (cc->core->id.rev >= 37) ? 32 : 24;
48+
} else {
49+
nb = 28;
50+
}
51+
if (nb == 32)
52+
return 0xffffffff;
53+
else
54+
return (1 << nb) - 1;
55+
}
56+
57+
static u32 bcma_chipco_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt,
58+
u32 ticks)
59+
{
60+
struct bcma_drv_cc *cc = bcm47xx_wdt_get_drvdata(wdt);
61+
62+
return bcma_chipco_watchdog_timer_set(cc, ticks);
63+
}
64+
65+
static u32 bcma_chipco_watchdog_timer_set_ms_wdt(struct bcm47xx_wdt *wdt,
66+
u32 ms)
67+
{
68+
struct bcma_drv_cc *cc = bcm47xx_wdt_get_drvdata(wdt);
69+
u32 ticks;
70+
71+
ticks = bcma_chipco_watchdog_timer_set(cc, cc->ticks_per_ms * ms);
72+
return ticks / cc->ticks_per_ms;
73+
}
74+
75+
static int bcma_chipco_watchdog_ticks_per_ms(struct bcma_drv_cc *cc)
76+
{
77+
struct bcma_bus *bus = cc->core->bus;
78+
79+
if (cc->capabilities & BCMA_CC_CAP_PMU) {
80+
if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
81+
/* 4706 CC and PMU watchdogs are clocked at 1/4 of ALP clock */
82+
return bcma_chipco_alp_clock(cc) / 4000;
83+
else
84+
/* based on 32KHz ILP clock */
85+
return 32;
86+
} else {
87+
return bcma_chipco_alp_clock(cc) / 1000;
88+
}
89+
}
90+
91+
int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc)
92+
{
93+
struct bcm47xx_wdt wdt = {};
94+
struct platform_device *pdev;
95+
96+
wdt.driver_data = cc;
97+
wdt.timer_set = bcma_chipco_watchdog_timer_set_wdt;
98+
wdt.timer_set_ms = bcma_chipco_watchdog_timer_set_ms_wdt;
99+
wdt.max_timer_ms = bcma_chipco_watchdog_get_max_timer(cc) / cc->ticks_per_ms;
100+
101+
pdev = platform_device_register_data(NULL, "bcm47xx-wdt",
102+
cc->core->bus->num, &wdt,
103+
sizeof(wdt));
104+
if (IS_ERR(pdev))
105+
return PTR_ERR(pdev);
106+
107+
cc->watchdog = pdev;
108+
109+
return 0;
110+
}
111+
25112
void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
26113
{
27114
if (cc->early_setup_done)
@@ -69,15 +156,33 @@ void bcma_core_chipcommon_init(struct bcma_drv_cc *cc)
69156
((leddc_on << BCMA_CC_GPIOTIMER_ONTIME_SHIFT) |
70157
(leddc_off << BCMA_CC_GPIOTIMER_OFFTIME_SHIFT)));
71158
}
159+
cc->ticks_per_ms = bcma_chipco_watchdog_ticks_per_ms(cc);
72160

73161
cc->setup_done = true;
74162
}
75163

76164
/* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */
77-
void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks)
165+
u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks)
78166
{
79-
/* instant NMI */
80-
bcma_cc_write32(cc, BCMA_CC_WATCHDOG, ticks);
167+
u32 maxt;
168+
enum bcma_clkmode clkmode;
169+
170+
maxt = bcma_chipco_watchdog_get_max_timer(cc);
171+
if (cc->capabilities & BCMA_CC_CAP_PMU) {
172+
if (ticks == 1)
173+
ticks = 2;
174+
else if (ticks > maxt)
175+
ticks = maxt;
176+
bcma_cc_write32(cc, BCMA_CC_PMU_WATCHDOG, ticks);
177+
} else {
178+
clkmode = ticks ? BCMA_CLKMODE_FAST : BCMA_CLKMODE_DYNAMIC;
179+
bcma_core_set_clockmode(cc->core, clkmode);
180+
if (ticks > maxt)
181+
ticks = maxt;
182+
/* instant NMI */
183+
bcma_cc_write32(cc, BCMA_CC_WATCHDOG, ticks);
184+
}
185+
return ticks;
81186
}
82187

83188
void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value)
@@ -131,8 +236,7 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
131236
struct bcma_serial_port *ports = cc->serial_ports;
132237

133238
if (ccrev >= 11 && ccrev != 15) {
134-
/* Fixed ALP clock */
135-
baud_base = bcma_pmu_alp_clock(cc);
239+
baud_base = bcma_chipco_alp_clock(cc);
136240
if (ccrev >= 21) {
137241
/* Turn off UART clock before switching clocksource. */
138242
bcma_cc_write32(cc, BCMA_CC_CORECTL,

‎drivers/bcma/driver_pci_host.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, bcma_core_pci_fixup_pcibridge);
538538
static void bcma_core_pci_fixup_addresses(struct pci_dev *dev)
539539
{
540540
struct resource *res;
541-
int pos;
541+
int pos, err;
542542

543543
if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {
544544
/* This is not a device on the PCI-core bridge. */
@@ -551,8 +551,12 @@ static void bcma_core_pci_fixup_addresses(struct pci_dev *dev)
551551

552552
for (pos = 0; pos < 6; pos++) {
553553
res = &dev->resource[pos];
554-
if (res->flags & (IORESOURCE_IO | IORESOURCE_MEM))
555-
pci_assign_resource(dev, pos);
554+
if (res->flags & (IORESOURCE_IO | IORESOURCE_MEM)) {
555+
err = pci_assign_resource(dev, pos);
556+
if (err)
557+
pr_err("PCI: Problem fixing up the addresses on %s\n",
558+
pci_name(dev));
559+
}
556560
}
557561
}
558562
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, bcma_core_pci_fixup_addresses);

‎drivers/bcma/main.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ static int bcma_register_cores(struct bcma_bus *bus)
165165
}
166166
#endif
167167

168+
if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
169+
err = bcma_chipco_watchdog_register(&bus->drv_cc);
170+
if (err)
171+
bcma_err(bus, "Error registering watchdog driver\n");
172+
}
173+
168174
return 0;
169175
}
170176

@@ -177,6 +183,8 @@ static void bcma_unregister_cores(struct bcma_bus *bus)
177183
if (core->dev_registered)
178184
device_unregister(&core->dev);
179185
}
186+
if (bus->hosttype == BCMA_HOSTTYPE_SOC)
187+
platform_device_unregister(bus->drv_cc.watchdog);
180188
}
181189

182190
int __devinit bcma_bus_register(struct bcma_bus *bus)

‎drivers/net/wireless/adm8211.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ static const struct ieee80211_ops adm8211_ops = {
17611761
.get_tsf = adm8211_get_tsft
17621762
};
17631763

1764-
static int __devinit adm8211_probe(struct pci_dev *pdev,
1764+
static int adm8211_probe(struct pci_dev *pdev,
17651765
const struct pci_device_id *id)
17661766
{
17671767
struct ieee80211_hw *dev;
@@ -1935,7 +1935,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
19351935
}
19361936

19371937

1938-
static void __devexit adm8211_remove(struct pci_dev *pdev)
1938+
static void adm8211_remove(struct pci_dev *pdev)
19391939
{
19401940
struct ieee80211_hw *dev = pci_get_drvdata(pdev);
19411941
struct adm8211_priv *priv;
@@ -1985,7 +1985,7 @@ static struct pci_driver adm8211_driver = {
19851985
.name = "adm8211",
19861986
.id_table = adm8211_pci_id_table,
19871987
.probe = adm8211_probe,
1988-
.remove = __devexit_p(adm8211_remove),
1988+
.remove = adm8211_remove,
19891989
#ifdef CONFIG_PM
19901990
.suspend = adm8211_suspend,
19911991
.resume = adm8211_resume,

‎drivers/net/wireless/airo.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static struct pci_driver airo_driver = {
7878
.name = DRV_NAME,
7979
.id_table = card_ids,
8080
.probe = airo_pci_probe,
81-
.remove = __devexit_p(airo_pci_remove),
81+
.remove = airo_pci_remove,
8282
.suspend = airo_pci_suspend,
8383
.resume = airo_pci_resume,
8484
};
@@ -5584,7 +5584,7 @@ static void timer_func( struct net_device *dev ) {
55845584
}
55855585

55865586
#ifdef CONFIG_PCI
5587-
static int __devinit airo_pci_probe(struct pci_dev *pdev,
5587+
static int airo_pci_probe(struct pci_dev *pdev,
55885588
const struct pci_device_id *pent)
55895589
{
55905590
struct net_device *dev;
@@ -5606,7 +5606,7 @@ static int __devinit airo_pci_probe(struct pci_dev *pdev,
56065606
return 0;
56075607
}
56085608

5609-
static void __devexit airo_pci_remove(struct pci_dev *pdev)
5609+
static void airo_pci_remove(struct pci_dev *pdev)
56105610
{
56115611
struct net_device *dev = pci_get_drvdata(pdev);
56125612

‎drivers/net/wireless/ath/Kconfig‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
menuconfig ATH_COMMON
1+
config ATH_COMMON
2+
tristate
3+
4+
menuconfig ATH_CARDS
25
tristate "Atheros Wireless Cards"
36
depends on CFG80211 && (!UML || BROKEN)
47
---help---
@@ -14,7 +17,7 @@ menuconfig ATH_COMMON
1417

1518
http://wireless.kernel.org/en/users/Drivers/Atheros
1619

17-
if ATH_COMMON
20+
if ATH_CARDS
1821

1922
config ATH_DEBUG
2023
bool "Atheros wireless debugging"

‎drivers/net/wireless/ath/ar5523/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config AR5523
22
tristate "Atheros AR5523 wireless driver support"
33
depends on MAC80211 && USB
4+
select ATH_COMMON
45
select FW_LOADER
56
---help---
67
This module add support for AR5523 based USB dongles such as D-Link

‎drivers/net/wireless/ath/ath5k/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config ATH5K
22
tristate "Atheros 5xxx wireless cards support"
33
depends on (PCI || ATHEROS_AR231X) && MAC80211
4+
select ATH_COMMON
45
select MAC80211_LEDS
56
select LEDS_CLASS
67
select NEW_LEDS

0 commit comments

Comments
 (0)