Skip to content

Commit 28f3d71

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull more networking updates from David Miller: "Ok, everything from here on out will be bug fixes." 1) One final sync of wireless and bluetooth stuff from John Linville. These changes have all been in his tree for more than a week, and therefore have had the necessary -next exposure. John was just away on a trip and didn't have a change to send the pull request until a day or two ago. 2) Put back some defines in user exposed header file areas that were removed during the tokenring purge. From Stephen Hemminger and Paul Gortmaker. 3) A bug fix for UDP hash table allocation got lost in the pile due to one of those "you got it.. no I've got it.." situations. :-) From Tim Bird. 4) SKB coalescing in TCP needs to have stricter checks, otherwise we'll try to coalesce overlapping frags and crash. Fix from Eric Dumazet. 5) RCU routing table lookups can race with free_fib_info(), causing crashes when we deref the device pointers in the route. Fix by releasing the net device in the RCU callback. From Yanmin Zhang. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (293 commits) tcp: take care of overlaps in tcp_try_coalesce() ipv4: fix the rcu race between free_fib_info and ip_route_output_slow mm: add a low limit to alloc_large_system_hash ipx: restore token ring define to include/linux/ipx.h if: restore token ring ARP type to header xen: do not disable netfront in dom0 phy/micrel: Fix ID of KSZ9021 mISDN: Add X-Tensions USB ISDN TA XC-525 gianfar:don't add FCB length to hard_header_len Bluetooth: Report proper error number in disconnection Bluetooth: Create flags for bt_sk() Bluetooth: report the right security level in getsockopt Bluetooth: Lock the L2CAP channel when sending Bluetooth: Restore locking semantics when looking up L2CAP channels Bluetooth: Fix a redundant and problematic incoming MTU check Bluetooth: Add support for Foxconn/Hon Hai AR5BBU22 0489:E03C Bluetooth: Fix EIR data generation for mgmt_device_found Bluetooth: Fix Inquiry with RSSI event mask Bluetooth: improve readability of l2cap_seq_list code Bluetooth: Fix skb length calculation ...
2 parents 654443e + 1ca7ee3 commit 28f3d71

189 files changed

Lines changed: 6665 additions & 5539 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.

‎Documentation/feature-removal-schedule.txt‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,18 @@ Who: Kees Cook <keescook@chromium.org>
541541

542542
----------------------------
543543

544+
What: Removing the pn544 raw driver.
545+
When: 3.6
546+
Why: With the introduction of the NFC HCI and SHDL kernel layers, pn544.c
547+
is being replaced by pn544_hci.c which is accessible through the netlink
548+
and socket NFC APIs. Moreover, pn544.c is outdated and does not seem to
549+
work properly with the latest Android stacks.
550+
Having 2 drivers for the same hardware is confusing and as such we
551+
should only keep the one following the kernel NFC APIs.
552+
Who: Samuel Ortiz <sameo@linux.intel.com>
553+
554+
----------------------------
555+
544556
What: setitimer accepts user NULL pointer (value)
545557
When: 3.6
546558
Why: setitimer is not returning -EFAULT if user pointer is NULL. This

‎Documentation/nfc/nfc-hci.txt‎

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ response to arrive.
2222
HCI events can also be received from the host controller. They will be handled
2323
and a translation will be forwarded to NFC Core as needed.
2424
HCI uses 2 execution contexts:
25-
- one if for executing commands : nfc_hci_msg_tx_work(). Only one command
25+
- one for executing commands : nfc_hci_msg_tx_work(). Only one command
2626
can be executing at any given moment.
27-
- one if for dispatching received events and responses : nfc_hci_msg_rx_work()
27+
- one for dispatching received events and commands : nfc_hci_msg_rx_work().
2828

2929
HCI Session initialization:
3030
---------------------------
@@ -52,18 +52,42 @@ entry points:
5252
struct nfc_hci_ops {
5353
int (*open)(struct nfc_hci_dev *hdev);
5454
void (*close)(struct nfc_hci_dev *hdev);
55+
int (*hci_ready) (struct nfc_hci_dev *hdev);
5556
int (*xmit)(struct nfc_hci_dev *hdev, struct sk_buff *skb);
5657
int (*start_poll)(struct nfc_hci_dev *hdev, u32 protocols);
5758
int (*target_from_gate)(struct nfc_hci_dev *hdev, u8 gate,
5859
struct nfc_target *target);
60+
int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate,
61+
struct nfc_target *target);
62+
int (*data_exchange) (struct nfc_hci_dev *hdev,
63+
struct nfc_target *target,
64+
struct sk_buff *skb, struct sk_buff **res_skb);
65+
int (*check_presence)(struct nfc_hci_dev *hdev,
66+
struct nfc_target *target);
5967
};
6068

61-
open() and close() shall turn the hardware on and off. xmit() shall simply
62-
write a frame to the chip. start_poll() is an optional entrypoint that shall
63-
set the hardware in polling mode. This must be implemented only if the hardware
64-
uses proprietary gates or a mechanism slightly different from the HCI standard.
65-
target_from_gate() is another optional entrypoint to return the protocols
69+
- open() and close() shall turn the hardware on and off.
70+
- hci_ready() is an optional entry point that is called right after the hci
71+
session has been set up. The driver can use it to do additional initialization
72+
that must be performed using HCI commands.
73+
- xmit() shall simply write a frame to the chip.
74+
- start_poll() is an optional entrypoint that shall set the hardware in polling
75+
mode. This must be implemented only if the hardware uses proprietary gates or a
76+
mechanism slightly different from the HCI standard.
77+
- target_from_gate() is an optional entrypoint to return the nfc protocols
6678
corresponding to a proprietary gate.
79+
- complete_target_discovered() is an optional entry point to let the driver
80+
perform additional proprietary processing necessary to auto activate the
81+
discovered target.
82+
- data_exchange() must be implemented by the driver if proprietary HCI commands
83+
are required to send data to the tag. Some tag types will require custom
84+
commands, others can be written to using the standard HCI commands. The driver
85+
can check the tag type and either do proprietary processing, or return 1 to ask
86+
for standard processing.
87+
- check_presence() is an optional entry point that will be called regularly
88+
by the core to check that an activated tag is still in the field. If this is
89+
not implemented, the core will not be able to push tag_lost events to the user
90+
space
6791

6892
On the rx path, the driver is responsible to push incoming HCP frames to HCI
6993
using nfc_hci_recv_frame(). HCI will take care of re-aggregation and handling
@@ -99,7 +123,8 @@ fast, cannot sleep. stores incoming frames into an shdlc rx queue
99123
handles shdlc rx & tx queues. Dispatches HCI cmd responses.
100124

101125
- HCI Tx Cmd worker (MSGTXWQ)
102-
Serialize execution of HCI commands. Complete execution in case of resp timeout.
126+
Serializes execution of HCI commands. Completes execution in case of response
127+
timeout.
103128

104129
- HCI Rx worker (MSGRXWQ)
105130
Dispatches incoming HCI commands or events.
@@ -133,11 +158,11 @@ able to complete the command with a timeout error if no response arrive.
133158
SMW context gets scheduled and invokes nfc_shdlc_sm_work(). This function
134159
handles shdlc framing in and out. It uses the driver xmit to send frames and
135160
receives incoming frames in an skb queue filled from the driver IRQ handler.
136-
SHDLC I(nformation) frames payload are HCP fragments. They are agregated to
161+
SHDLC I(nformation) frames payload are HCP fragments. They are aggregated to
137162
form complete HCI frames, which can be a response, command, or event.
138163

139164
HCI Responses are dispatched immediately from this context to unblock
140-
waiting command execution. Reponse processing involves invoking the completion
165+
waiting command execution. Response processing involves invoking the completion
141166
callback that was provided by nfc_hci_msg_tx_work() when it sent the command.
142167
The completion callback will then wake the syscall context.
143168

‎arch/mips/bcm47xx/setup.c‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ static int bcm47xx_get_sprom_ssb(struct ssb_bus *bus, struct ssb_sprom *out)
9090
char prefix[10];
9191

9292
if (bus->bustype == SSB_BUSTYPE_PCI) {
93+
memset(out, 0, sizeof(struct ssb_sprom));
9394
snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
9495
bus->host_pci->bus->number + 1,
9596
PCI_SLOT(bus->host_pci->devfn));
@@ -109,15 +110,9 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
109110
/* Fill boardinfo structure */
110111
memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
111112

112-
if (nvram_getenv("boardvendor", buf, sizeof(buf)) >= 0)
113-
iv->boardinfo.vendor = (u16)simple_strtoul(buf, NULL, 0);
114-
else
115-
iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
116-
if (nvram_getenv("boardtype", buf, sizeof(buf)) >= 0)
117-
iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
118-
if (nvram_getenv("boardrev", buf, sizeof(buf)) >= 0)
119-
iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
113+
bcm47xx_fill_ssb_boardinfo(&iv->boardinfo, NULL);
120114

115+
memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
121116
bcm47xx_fill_sprom(&iv->sprom, NULL);
122117

123118
if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0)
@@ -166,12 +161,14 @@ static int bcm47xx_get_sprom_bcma(struct bcma_bus *bus, struct ssb_sprom *out)
166161

167162
switch (bus->hosttype) {
168163
case BCMA_HOSTTYPE_PCI:
164+
memset(out, 0, sizeof(struct ssb_sprom));
169165
snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
170166
bus->host_pci->bus->number + 1,
171167
PCI_SLOT(bus->host_pci->devfn));
172168
bcm47xx_fill_sprom(out, prefix);
173169
return 0;
174170
case BCMA_HOSTTYPE_SOC:
171+
memset(out, 0, sizeof(struct ssb_sprom));
175172
bcm47xx_fill_sprom_ethernet(out, NULL);
176173
core = bcma_find_core(bus, BCMA_CORE_80211);
177174
if (core) {
@@ -197,6 +194,8 @@ static void __init bcm47xx_register_bcma(void)
197194
err = bcma_host_soc_register(&bcm47xx_bus.bcma);
198195
if (err)
199196
panic("Failed to initialize BCMA bus (err %d)", err);
197+
198+
bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
200199
}
201200
#endif
202201

‎arch/mips/bcm47xx/sprom.c‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ static void bcm47xx_fill_sprom_r1234589(struct ssb_sprom *sprom,
165165
const char *prefix)
166166
{
167167
nvram_read_u16(prefix, NULL, "boardrev", &sprom->board_rev, 0);
168+
if (!sprom->board_rev)
169+
nvram_read_u16(NULL, NULL, "boardrev", &sprom->board_rev, 0);
168170
nvram_read_u16(prefix, NULL, "boardnum", &sprom->board_num, 0);
169171
nvram_read_u8(prefix, NULL, "ledbh0", &sprom->gpio0, 0xff);
170172
nvram_read_u8(prefix, NULL, "ledbh1", &sprom->gpio1, 0xff);
@@ -555,8 +557,6 @@ void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom, const char *prefix)
555557

556558
void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix)
557559
{
558-
memset(sprom, 0, sizeof(struct ssb_sprom));
559-
560560
bcm47xx_fill_sprom_ethernet(sprom, prefix);
561561

562562
nvram_read_u8(prefix, NULL, "sromrev", &sprom->revision, 0);
@@ -618,3 +618,27 @@ void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix)
618618
bcm47xx_fill_sprom_r1(sprom, prefix);
619619
}
620620
}
621+
622+
#ifdef CONFIG_BCM47XX_SSB
623+
void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
624+
const char *prefix)
625+
{
626+
nvram_read_u16(prefix, NULL, "boardvendor", &boardinfo->vendor, 0);
627+
if (!boardinfo->vendor)
628+
boardinfo->vendor = SSB_BOARDVENDOR_BCM;
629+
630+
nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
631+
}
632+
#endif
633+
634+
#ifdef CONFIG_BCM47XX_BCMA
635+
void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo,
636+
const char *prefix)
637+
{
638+
nvram_read_u16(prefix, NULL, "boardvendor", &boardinfo->vendor, 0);
639+
if (!boardinfo->vendor)
640+
boardinfo->vendor = SSB_BOARDVENDOR_BCM;
641+
642+
nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
643+
}
644+
#endif

‎arch/mips/include/asm/mach-bcm47xx/bcm47xx.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,13 @@ extern enum bcm47xx_bus_type bcm47xx_bus_type;
4747
void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix);
4848
void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom, const char *prefix);
4949

50+
#ifdef CONFIG_BCM47XX_SSB
51+
void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
52+
const char *prefix);
53+
#endif
54+
#ifdef CONFIG_BCM47XX_BCMA
55+
void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo,
56+
const char *prefix);
57+
#endif
58+
5059
#endif /* __ASM_BCM47XX_H */

‎drivers/bcma/core.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ void bcma_core_disable(struct bcma_device *core, u32 flags)
3030
udelay(10);
3131

3232
bcma_awrite32(core, BCMA_RESET_CTL, BCMA_RESET_CTL_RESET);
33+
bcma_aread32(core, BCMA_RESET_CTL);
3334
udelay(1);
3435
}
3536
EXPORT_SYMBOL_GPL(bcma_core_disable);
@@ -77,7 +78,7 @@ void bcma_core_set_clockmode(struct bcma_device *core,
7778
pr_err("HT force timeout\n");
7879
break;
7980
case BCMA_CLKMODE_DYNAMIC:
80-
pr_warn("Dynamic clockmode not supported yet!\n");
81+
bcma_set32(core, BCMA_CLKCTLST, ~BCMA_CLKCTLST_FORCEHT);
8182
break;
8283
}
8384
}

‎drivers/bcma/driver_pci.c‎

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address)
2424
return pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_DATA);
2525
}
2626

27-
#if 0
2827
static void bcma_pcie_write(struct bcma_drv_pci *pc, u32 address, u32 data)
2928
{
3029
pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_ADDR, address);
3130
pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_ADDR);
3231
pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_DATA, data);
3332
}
34-
#endif
3533

3634
static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy)
3735
{
@@ -170,13 +168,50 @@ static void bcma_pcicore_serdes_workaround(struct bcma_drv_pci *pc)
170168
tmp & ~BCMA_CORE_PCI_PLL_CTRL_FREQDET_EN);
171169
}
172170

171+
static void bcma_core_pci_fixcfg(struct bcma_drv_pci *pc)
172+
{
173+
struct bcma_device *core = pc->core;
174+
u16 val16, core_index;
175+
uint regoff;
176+
177+
regoff = BCMA_CORE_PCI_SPROM(BCMA_CORE_PCI_SPROM_PI_OFFSET);
178+
core_index = (u16)core->core_index;
179+
180+
val16 = pcicore_read16(pc, regoff);
181+
if (((val16 & BCMA_CORE_PCI_SPROM_PI_MASK) >> BCMA_CORE_PCI_SPROM_PI_SHIFT)
182+
!= core_index) {
183+
val16 = (core_index << BCMA_CORE_PCI_SPROM_PI_SHIFT) |
184+
(val16 & ~BCMA_CORE_PCI_SPROM_PI_MASK);
185+
pcicore_write16(pc, regoff, val16);
186+
}
187+
}
188+
189+
/* Fix MISC config to allow coming out of L2/L3-Ready state w/o PRST */
190+
/* Needs to happen when coming out of 'standby'/'hibernate' */
191+
static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc)
192+
{
193+
u16 val16;
194+
uint regoff;
195+
196+
regoff = BCMA_CORE_PCI_SPROM(BCMA_CORE_PCI_SPROM_MISC_CONFIG);
197+
198+
val16 = pcicore_read16(pc, regoff);
199+
200+
if (!(val16 & BCMA_CORE_PCI_SPROM_L23READY_EXIT_NOPERST)) {
201+
val16 |= BCMA_CORE_PCI_SPROM_L23READY_EXIT_NOPERST;
202+
pcicore_write16(pc, regoff, val16);
203+
}
204+
}
205+
173206
/**************************************************
174207
* Init.
175208
**************************************************/
176209

177210
static void __devinit bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc)
178211
{
212+
bcma_core_pci_fixcfg(pc);
179213
bcma_pcicore_serdes_workaround(pc);
214+
bcma_core_pci_config_fixup(pc);
180215
}
181216

182217
void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc)
@@ -224,3 +259,17 @@ int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
224259
return err;
225260
}
226261
EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl);
262+
263+
void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
264+
{
265+
u32 w;
266+
267+
w = bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
268+
if (extend)
269+
w |= BCMA_CORE_PCI_ASPMTIMER_EXTEND;
270+
else
271+
w &= ~BCMA_CORE_PCI_ASPMTIMER_EXTEND;
272+
bcma_pcie_write(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG, w);
273+
bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
274+
}
275+
EXPORT_SYMBOL_GPL(bcma_core_pci_extend_L1timer);

‎drivers/bcma/driver_pci_host.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int bcma_extpci_read_config(struct bcma_drv_pci *pc, unsigned int dev,
119119
if (unlikely(!addr))
120120
goto out;
121121
err = -ENOMEM;
122-
mmio = ioremap_nocache(addr, len);
122+
mmio = ioremap_nocache(addr, sizeof(val));
123123
if (!mmio)
124124
goto out;
125125

@@ -171,7 +171,7 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
171171
addr = pc->core->addr + BCMA_CORE_PCI_PCICFG0;
172172
addr |= (func << 8);
173173
addr |= (off & 0xfc);
174-
mmio = ioremap_nocache(addr, len);
174+
mmio = ioremap_nocache(addr, sizeof(val));
175175
if (!mmio)
176176
goto out;
177177
}
@@ -180,7 +180,7 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
180180
if (unlikely(!addr))
181181
goto out;
182182
err = -ENOMEM;
183-
mmio = ioremap_nocache(addr, len);
183+
mmio = ioremap_nocache(addr, sizeof(val));
184184
if (!mmio)
185185
goto out;
186186

@@ -491,8 +491,8 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
491491
/* Ok, ready to run, register it to the system.
492492
* The following needs change, if we want to port hostmode
493493
* to non-MIPS platform. */
494-
io_map_base = (unsigned long)ioremap_nocache(BCMA_SOC_PCI_MEM,
495-
0x04000000);
494+
io_map_base = (unsigned long)ioremap_nocache(pc_host->mem_resource.start,
495+
resource_size(&pc_host->mem_resource));
496496
pc_host->pci_controller.io_map_base = io_map_base;
497497
set_io_port_base(pc_host->pci_controller.io_map_base);
498498
/* Give some time to the PCI controller to configure itself with the new

‎drivers/bcma/host_pci.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ static int __devinit bcma_host_pci_probe(struct pci_dev *dev,
201201
bus->hosttype = BCMA_HOSTTYPE_PCI;
202202
bus->ops = &bcma_host_pci_ops;
203203

204+
bus->boardinfo.vendor = bus->host_pci->subsystem_vendor;
205+
bus->boardinfo.type = bus->host_pci->subsystem_device;
206+
204207
/* Register */
205208
err = bcma_bus_register(bus);
206209
if (err)
@@ -222,7 +225,7 @@ static int __devinit bcma_host_pci_probe(struct pci_dev *dev,
222225
return err;
223226
}
224227

225-
static void bcma_host_pci_remove(struct pci_dev *dev)
228+
static void __devexit bcma_host_pci_remove(struct pci_dev *dev)
226229
{
227230
struct bcma_bus *bus = pci_get_drvdata(dev);
228231

@@ -277,7 +280,7 @@ static struct pci_driver bcma_pci_bridge_driver = {
277280
.name = "bcma-pci-bridge",
278281
.id_table = bcma_pci_bridge_tbl,
279282
.probe = bcma_host_pci_probe,
280-
.remove = bcma_host_pci_remove,
283+
.remove = __devexit_p(bcma_host_pci_remove),
281284
.driver.pm = BCMA_PM_OPS,
282285
};
283286

0 commit comments

Comments
 (0)