mirror of
https://github.com/suyu-emu/horinux.git
synced 2026-09-21 14:15:21 -07:00
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 ...
This commit is contained in:
@@ -541,6 +541,18 @@ Who: Kees Cook <keescook@chromium.org>
|
||||
|
||||
----------------------------
|
||||
|
||||
What: Removing the pn544 raw driver.
|
||||
When: 3.6
|
||||
Why: With the introduction of the NFC HCI and SHDL kernel layers, pn544.c
|
||||
is being replaced by pn544_hci.c which is accessible through the netlink
|
||||
and socket NFC APIs. Moreover, pn544.c is outdated and does not seem to
|
||||
work properly with the latest Android stacks.
|
||||
Having 2 drivers for the same hardware is confusing and as such we
|
||||
should only keep the one following the kernel NFC APIs.
|
||||
Who: Samuel Ortiz <sameo@linux.intel.com>
|
||||
|
||||
----------------------------
|
||||
|
||||
What: setitimer accepts user NULL pointer (value)
|
||||
When: 3.6
|
||||
Why: setitimer is not returning -EFAULT if user pointer is NULL. This
|
||||
|
||||
@@ -22,9 +22,9 @@ response to arrive.
|
||||
HCI events can also be received from the host controller. They will be handled
|
||||
and a translation will be forwarded to NFC Core as needed.
|
||||
HCI uses 2 execution contexts:
|
||||
- one if for executing commands : nfc_hci_msg_tx_work(). Only one command
|
||||
- one for executing commands : nfc_hci_msg_tx_work(). Only one command
|
||||
can be executing at any given moment.
|
||||
- one if for dispatching received events and responses : nfc_hci_msg_rx_work()
|
||||
- one for dispatching received events and commands : nfc_hci_msg_rx_work().
|
||||
|
||||
HCI Session initialization:
|
||||
---------------------------
|
||||
@@ -52,18 +52,42 @@ entry points:
|
||||
struct nfc_hci_ops {
|
||||
int (*open)(struct nfc_hci_dev *hdev);
|
||||
void (*close)(struct nfc_hci_dev *hdev);
|
||||
int (*hci_ready) (struct nfc_hci_dev *hdev);
|
||||
int (*xmit)(struct nfc_hci_dev *hdev, struct sk_buff *skb);
|
||||
int (*start_poll)(struct nfc_hci_dev *hdev, u32 protocols);
|
||||
int (*target_from_gate)(struct nfc_hci_dev *hdev, u8 gate,
|
||||
struct nfc_target *target);
|
||||
int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate,
|
||||
struct nfc_target *target);
|
||||
int (*data_exchange) (struct nfc_hci_dev *hdev,
|
||||
struct nfc_target *target,
|
||||
struct sk_buff *skb, struct sk_buff **res_skb);
|
||||
int (*check_presence)(struct nfc_hci_dev *hdev,
|
||||
struct nfc_target *target);
|
||||
};
|
||||
|
||||
open() and close() shall turn the hardware on and off. xmit() shall simply
|
||||
write a frame to the chip. start_poll() is an optional entrypoint that shall
|
||||
set the hardware in polling mode. This must be implemented only if the hardware
|
||||
uses proprietary gates or a mechanism slightly different from the HCI standard.
|
||||
target_from_gate() is another optional entrypoint to return the protocols
|
||||
- open() and close() shall turn the hardware on and off.
|
||||
- hci_ready() is an optional entry point that is called right after the hci
|
||||
session has been set up. The driver can use it to do additional initialization
|
||||
that must be performed using HCI commands.
|
||||
- xmit() shall simply write a frame to the chip.
|
||||
- start_poll() is an optional entrypoint that shall set the hardware in polling
|
||||
mode. This must be implemented only if the hardware uses proprietary gates or a
|
||||
mechanism slightly different from the HCI standard.
|
||||
- target_from_gate() is an optional entrypoint to return the nfc protocols
|
||||
corresponding to a proprietary gate.
|
||||
- complete_target_discovered() is an optional entry point to let the driver
|
||||
perform additional proprietary processing necessary to auto activate the
|
||||
discovered target.
|
||||
- data_exchange() must be implemented by the driver if proprietary HCI commands
|
||||
are required to send data to the tag. Some tag types will require custom
|
||||
commands, others can be written to using the standard HCI commands. The driver
|
||||
can check the tag type and either do proprietary processing, or return 1 to ask
|
||||
for standard processing.
|
||||
- check_presence() is an optional entry point that will be called regularly
|
||||
by the core to check that an activated tag is still in the field. If this is
|
||||
not implemented, the core will not be able to push tag_lost events to the user
|
||||
space
|
||||
|
||||
On the rx path, the driver is responsible to push incoming HCP frames to HCI
|
||||
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
|
||||
handles shdlc rx & tx queues. Dispatches HCI cmd responses.
|
||||
|
||||
- HCI Tx Cmd worker (MSGTXWQ)
|
||||
Serialize execution of HCI commands. Complete execution in case of resp timeout.
|
||||
Serializes execution of HCI commands. Completes execution in case of response
|
||||
timeout.
|
||||
|
||||
- HCI Rx worker (MSGRXWQ)
|
||||
Dispatches incoming HCI commands or events.
|
||||
@@ -133,11 +158,11 @@ able to complete the command with a timeout error if no response arrive.
|
||||
SMW context gets scheduled and invokes nfc_shdlc_sm_work(). This function
|
||||
handles shdlc framing in and out. It uses the driver xmit to send frames and
|
||||
receives incoming frames in an skb queue filled from the driver IRQ handler.
|
||||
SHDLC I(nformation) frames payload are HCP fragments. They are agregated to
|
||||
SHDLC I(nformation) frames payload are HCP fragments. They are aggregated to
|
||||
form complete HCI frames, which can be a response, command, or event.
|
||||
|
||||
HCI Responses are dispatched immediately from this context to unblock
|
||||
waiting command execution. Reponse processing involves invoking the completion
|
||||
waiting command execution. Response processing involves invoking the completion
|
||||
callback that was provided by nfc_hci_msg_tx_work() when it sent the command.
|
||||
The completion callback will then wake the syscall context.
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ static int bcm47xx_get_sprom_ssb(struct ssb_bus *bus, struct ssb_sprom *out)
|
||||
char prefix[10];
|
||||
|
||||
if (bus->bustype == SSB_BUSTYPE_PCI) {
|
||||
memset(out, 0, sizeof(struct ssb_sprom));
|
||||
snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
|
||||
bus->host_pci->bus->number + 1,
|
||||
PCI_SLOT(bus->host_pci->devfn));
|
||||
@@ -109,15 +110,9 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
|
||||
/* Fill boardinfo structure */
|
||||
memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
|
||||
|
||||
if (nvram_getenv("boardvendor", buf, sizeof(buf)) >= 0)
|
||||
iv->boardinfo.vendor = (u16)simple_strtoul(buf, NULL, 0);
|
||||
else
|
||||
iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
|
||||
if (nvram_getenv("boardtype", buf, sizeof(buf)) >= 0)
|
||||
iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
|
||||
if (nvram_getenv("boardrev", buf, sizeof(buf)) >= 0)
|
||||
iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
|
||||
bcm47xx_fill_ssb_boardinfo(&iv->boardinfo, NULL);
|
||||
|
||||
memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
|
||||
bcm47xx_fill_sprom(&iv->sprom, NULL);
|
||||
|
||||
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)
|
||||
|
||||
switch (bus->hosttype) {
|
||||
case BCMA_HOSTTYPE_PCI:
|
||||
memset(out, 0, sizeof(struct ssb_sprom));
|
||||
snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
|
||||
bus->host_pci->bus->number + 1,
|
||||
PCI_SLOT(bus->host_pci->devfn));
|
||||
bcm47xx_fill_sprom(out, prefix);
|
||||
return 0;
|
||||
case BCMA_HOSTTYPE_SOC:
|
||||
memset(out, 0, sizeof(struct ssb_sprom));
|
||||
bcm47xx_fill_sprom_ethernet(out, NULL);
|
||||
core = bcma_find_core(bus, BCMA_CORE_80211);
|
||||
if (core) {
|
||||
@@ -197,6 +194,8 @@ static void __init bcm47xx_register_bcma(void)
|
||||
err = bcma_host_soc_register(&bcm47xx_bus.bcma);
|
||||
if (err)
|
||||
panic("Failed to initialize BCMA bus (err %d)", err);
|
||||
|
||||
bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -165,6 +165,8 @@ static void bcm47xx_fill_sprom_r1234589(struct ssb_sprom *sprom,
|
||||
const char *prefix)
|
||||
{
|
||||
nvram_read_u16(prefix, NULL, "boardrev", &sprom->board_rev, 0);
|
||||
if (!sprom->board_rev)
|
||||
nvram_read_u16(NULL, NULL, "boardrev", &sprom->board_rev, 0);
|
||||
nvram_read_u16(prefix, NULL, "boardnum", &sprom->board_num, 0);
|
||||
nvram_read_u8(prefix, NULL, "ledbh0", &sprom->gpio0, 0xff);
|
||||
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)
|
||||
|
||||
void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix)
|
||||
{
|
||||
memset(sprom, 0, sizeof(struct ssb_sprom));
|
||||
|
||||
bcm47xx_fill_sprom_ethernet(sprom, prefix);
|
||||
|
||||
nvram_read_u8(prefix, NULL, "sromrev", &sprom->revision, 0);
|
||||
@@ -618,3 +618,27 @@ void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix)
|
||||
bcm47xx_fill_sprom_r1(sprom, prefix);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BCM47XX_SSB
|
||||
void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
|
||||
const char *prefix)
|
||||
{
|
||||
nvram_read_u16(prefix, NULL, "boardvendor", &boardinfo->vendor, 0);
|
||||
if (!boardinfo->vendor)
|
||||
boardinfo->vendor = SSB_BOARDVENDOR_BCM;
|
||||
|
||||
nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BCM47XX_BCMA
|
||||
void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo,
|
||||
const char *prefix)
|
||||
{
|
||||
nvram_read_u16(prefix, NULL, "boardvendor", &boardinfo->vendor, 0);
|
||||
if (!boardinfo->vendor)
|
||||
boardinfo->vendor = SSB_BOARDVENDOR_BCM;
|
||||
|
||||
nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -47,4 +47,13 @@ extern enum bcm47xx_bus_type bcm47xx_bus_type;
|
||||
void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix);
|
||||
void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom, const char *prefix);
|
||||
|
||||
#ifdef CONFIG_BCM47XX_SSB
|
||||
void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
|
||||
const char *prefix);
|
||||
#endif
|
||||
#ifdef CONFIG_BCM47XX_BCMA
|
||||
void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo,
|
||||
const char *prefix);
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_BCM47XX_H */
|
||||
|
||||
+2
-1
@@ -30,6 +30,7 @@ void bcma_core_disable(struct bcma_device *core, u32 flags)
|
||||
udelay(10);
|
||||
|
||||
bcma_awrite32(core, BCMA_RESET_CTL, BCMA_RESET_CTL_RESET);
|
||||
bcma_aread32(core, BCMA_RESET_CTL);
|
||||
udelay(1);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bcma_core_disable);
|
||||
@@ -77,7 +78,7 @@ void bcma_core_set_clockmode(struct bcma_device *core,
|
||||
pr_err("HT force timeout\n");
|
||||
break;
|
||||
case BCMA_CLKMODE_DYNAMIC:
|
||||
pr_warn("Dynamic clockmode not supported yet!\n");
|
||||
bcma_set32(core, BCMA_CLKCTLST, ~BCMA_CLKCTLST_FORCEHT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,14 +24,12 @@ u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address)
|
||||
return pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_DATA);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void bcma_pcie_write(struct bcma_drv_pci *pc, u32 address, u32 data)
|
||||
{
|
||||
pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_ADDR, address);
|
||||
pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_ADDR);
|
||||
pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_DATA, data);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy)
|
||||
{
|
||||
@@ -170,13 +168,50 @@ static void bcma_pcicore_serdes_workaround(struct bcma_drv_pci *pc)
|
||||
tmp & ~BCMA_CORE_PCI_PLL_CTRL_FREQDET_EN);
|
||||
}
|
||||
|
||||
static void bcma_core_pci_fixcfg(struct bcma_drv_pci *pc)
|
||||
{
|
||||
struct bcma_device *core = pc->core;
|
||||
u16 val16, core_index;
|
||||
uint regoff;
|
||||
|
||||
regoff = BCMA_CORE_PCI_SPROM(BCMA_CORE_PCI_SPROM_PI_OFFSET);
|
||||
core_index = (u16)core->core_index;
|
||||
|
||||
val16 = pcicore_read16(pc, regoff);
|
||||
if (((val16 & BCMA_CORE_PCI_SPROM_PI_MASK) >> BCMA_CORE_PCI_SPROM_PI_SHIFT)
|
||||
!= core_index) {
|
||||
val16 = (core_index << BCMA_CORE_PCI_SPROM_PI_SHIFT) |
|
||||
(val16 & ~BCMA_CORE_PCI_SPROM_PI_MASK);
|
||||
pcicore_write16(pc, regoff, val16);
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix MISC config to allow coming out of L2/L3-Ready state w/o PRST */
|
||||
/* Needs to happen when coming out of 'standby'/'hibernate' */
|
||||
static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc)
|
||||
{
|
||||
u16 val16;
|
||||
uint regoff;
|
||||
|
||||
regoff = BCMA_CORE_PCI_SPROM(BCMA_CORE_PCI_SPROM_MISC_CONFIG);
|
||||
|
||||
val16 = pcicore_read16(pc, regoff);
|
||||
|
||||
if (!(val16 & BCMA_CORE_PCI_SPROM_L23READY_EXIT_NOPERST)) {
|
||||
val16 |= BCMA_CORE_PCI_SPROM_L23READY_EXIT_NOPERST;
|
||||
pcicore_write16(pc, regoff, val16);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* Init.
|
||||
**************************************************/
|
||||
|
||||
static void __devinit bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc)
|
||||
{
|
||||
bcma_core_pci_fixcfg(pc);
|
||||
bcma_pcicore_serdes_workaround(pc);
|
||||
bcma_core_pci_config_fixup(pc);
|
||||
}
|
||||
|
||||
void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc)
|
||||
@@ -224,3 +259,17 @@ out:
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl);
|
||||
|
||||
void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
|
||||
{
|
||||
u32 w;
|
||||
|
||||
w = bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
|
||||
if (extend)
|
||||
w |= BCMA_CORE_PCI_ASPMTIMER_EXTEND;
|
||||
else
|
||||
w &= ~BCMA_CORE_PCI_ASPMTIMER_EXTEND;
|
||||
bcma_pcie_write(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG, w);
|
||||
bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bcma_core_pci_extend_L1timer);
|
||||
|
||||
@@ -119,7 +119,7 @@ static int bcma_extpci_read_config(struct bcma_drv_pci *pc, unsigned int dev,
|
||||
if (unlikely(!addr))
|
||||
goto out;
|
||||
err = -ENOMEM;
|
||||
mmio = ioremap_nocache(addr, len);
|
||||
mmio = ioremap_nocache(addr, sizeof(val));
|
||||
if (!mmio)
|
||||
goto out;
|
||||
|
||||
@@ -171,7 +171,7 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
|
||||
addr = pc->core->addr + BCMA_CORE_PCI_PCICFG0;
|
||||
addr |= (func << 8);
|
||||
addr |= (off & 0xfc);
|
||||
mmio = ioremap_nocache(addr, len);
|
||||
mmio = ioremap_nocache(addr, sizeof(val));
|
||||
if (!mmio)
|
||||
goto out;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
|
||||
if (unlikely(!addr))
|
||||
goto out;
|
||||
err = -ENOMEM;
|
||||
mmio = ioremap_nocache(addr, len);
|
||||
mmio = ioremap_nocache(addr, sizeof(val));
|
||||
if (!mmio)
|
||||
goto out;
|
||||
|
||||
@@ -491,8 +491,8 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
|
||||
/* Ok, ready to run, register it to the system.
|
||||
* The following needs change, if we want to port hostmode
|
||||
* to non-MIPS platform. */
|
||||
io_map_base = (unsigned long)ioremap_nocache(BCMA_SOC_PCI_MEM,
|
||||
0x04000000);
|
||||
io_map_base = (unsigned long)ioremap_nocache(pc_host->mem_resource.start,
|
||||
resource_size(&pc_host->mem_resource));
|
||||
pc_host->pci_controller.io_map_base = io_map_base;
|
||||
set_io_port_base(pc_host->pci_controller.io_map_base);
|
||||
/* Give some time to the PCI controller to configure itself with the new
|
||||
|
||||
@@ -201,6 +201,9 @@ static int __devinit bcma_host_pci_probe(struct pci_dev *dev,
|
||||
bus->hosttype = BCMA_HOSTTYPE_PCI;
|
||||
bus->ops = &bcma_host_pci_ops;
|
||||
|
||||
bus->boardinfo.vendor = bus->host_pci->subsystem_vendor;
|
||||
bus->boardinfo.type = bus->host_pci->subsystem_device;
|
||||
|
||||
/* Register */
|
||||
err = bcma_bus_register(bus);
|
||||
if (err)
|
||||
@@ -222,7 +225,7 @@ err_kfree_bus:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void bcma_host_pci_remove(struct pci_dev *dev)
|
||||
static void __devexit bcma_host_pci_remove(struct pci_dev *dev)
|
||||
{
|
||||
struct bcma_bus *bus = pci_get_drvdata(dev);
|
||||
|
||||
@@ -277,7 +280,7 @@ static struct pci_driver bcma_pci_bridge_driver = {
|
||||
.name = "bcma-pci-bridge",
|
||||
.id_table = bcma_pci_bridge_tbl,
|
||||
.probe = bcma_host_pci_probe,
|
||||
.remove = bcma_host_pci_remove,
|
||||
.remove = __devexit_p(bcma_host_pci_remove),
|
||||
.driver.pm = BCMA_PM_OPS,
|
||||
};
|
||||
|
||||
|
||||
+41
-15
@@ -19,7 +19,14 @@ struct bcma_device_id_name {
|
||||
u16 id;
|
||||
const char *name;
|
||||
};
|
||||
struct bcma_device_id_name bcma_device_names[] = {
|
||||
|
||||
static const struct bcma_device_id_name bcma_arm_device_names[] = {
|
||||
{ BCMA_CORE_ARM_1176, "ARM 1176" },
|
||||
{ BCMA_CORE_ARM_7TDMI, "ARM 7TDMI" },
|
||||
{ BCMA_CORE_ARM_CM3, "ARM CM3" },
|
||||
};
|
||||
|
||||
static const struct bcma_device_id_name bcma_bcm_device_names[] = {
|
||||
{ BCMA_CORE_OOB_ROUTER, "OOB Router" },
|
||||
{ BCMA_CORE_INVALID, "Invalid" },
|
||||
{ BCMA_CORE_CHIPCOMMON, "ChipCommon" },
|
||||
@@ -27,7 +34,6 @@ struct bcma_device_id_name bcma_device_names[] = {
|
||||
{ BCMA_CORE_SRAM, "SRAM" },
|
||||
{ BCMA_CORE_SDRAM, "SDRAM" },
|
||||
{ BCMA_CORE_PCI, "PCI" },
|
||||
{ BCMA_CORE_MIPS, "MIPS" },
|
||||
{ BCMA_CORE_ETHERNET, "Fast Ethernet" },
|
||||
{ BCMA_CORE_V90, "V90" },
|
||||
{ BCMA_CORE_USB11_HOSTDEV, "USB 1.1 Hostdev" },
|
||||
@@ -44,7 +50,6 @@ struct bcma_device_id_name bcma_device_names[] = {
|
||||
{ BCMA_CORE_PHY_A, "PHY A" },
|
||||
{ BCMA_CORE_PHY_B, "PHY B" },
|
||||
{ BCMA_CORE_PHY_G, "PHY G" },
|
||||
{ BCMA_CORE_MIPS_3302, "MIPS 3302" },
|
||||
{ BCMA_CORE_USB11_HOST, "USB 1.1 Host" },
|
||||
{ BCMA_CORE_USB11_DEV, "USB 1.1 Device" },
|
||||
{ BCMA_CORE_USB20_HOST, "USB 2.0 Host" },
|
||||
@@ -58,15 +63,11 @@ struct bcma_device_id_name bcma_device_names[] = {
|
||||
{ BCMA_CORE_PHY_N, "PHY N" },
|
||||
{ BCMA_CORE_SRAM_CTL, "SRAM Controller" },
|
||||
{ BCMA_CORE_MINI_MACPHY, "Mini MACPHY" },
|
||||
{ BCMA_CORE_ARM_1176, "ARM 1176" },
|
||||
{ BCMA_CORE_ARM_7TDMI, "ARM 7TDMI" },
|
||||
{ BCMA_CORE_PHY_LP, "PHY LP" },
|
||||
{ BCMA_CORE_PMU, "PMU" },
|
||||
{ BCMA_CORE_PHY_SSN, "PHY SSN" },
|
||||
{ BCMA_CORE_SDIO_DEV, "SDIO Device" },
|
||||
{ BCMA_CORE_ARM_CM3, "ARM CM3" },
|
||||
{ BCMA_CORE_PHY_HT, "PHY HT" },
|
||||
{ BCMA_CORE_MIPS_74K, "MIPS 74K" },
|
||||
{ BCMA_CORE_MAC_GBIT, "GBit MAC" },
|
||||
{ BCMA_CORE_DDR12_MEM_CTL, "DDR1/DDR2 Memory Controller" },
|
||||
{ BCMA_CORE_PCIE_RC, "PCIe Root Complex" },
|
||||
@@ -79,16 +80,41 @@ struct bcma_device_id_name bcma_device_names[] = {
|
||||
{ BCMA_CORE_SHIM, "SHIM" },
|
||||
{ BCMA_CORE_DEFAULT, "Default" },
|
||||
};
|
||||
const char *bcma_device_name(struct bcma_device_id *id)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (id->manuf == BCMA_MANUF_BCM) {
|
||||
for (i = 0; i < ARRAY_SIZE(bcma_device_names); i++) {
|
||||
if (bcma_device_names[i].id == id->id)
|
||||
return bcma_device_names[i].name;
|
||||
}
|
||||
static const struct bcma_device_id_name bcma_mips_device_names[] = {
|
||||
{ BCMA_CORE_MIPS, "MIPS" },
|
||||
{ BCMA_CORE_MIPS_3302, "MIPS 3302" },
|
||||
{ BCMA_CORE_MIPS_74K, "MIPS 74K" },
|
||||
};
|
||||
|
||||
static const char *bcma_device_name(const struct bcma_device_id *id)
|
||||
{
|
||||
const struct bcma_device_id_name *names;
|
||||
int size, i;
|
||||
|
||||
/* search manufacturer specific names */
|
||||
switch (id->manuf) {
|
||||
case BCMA_MANUF_ARM:
|
||||
names = bcma_arm_device_names;
|
||||
size = ARRAY_SIZE(bcma_arm_device_names);
|
||||
break;
|
||||
case BCMA_MANUF_BCM:
|
||||
names = bcma_bcm_device_names;
|
||||
size = ARRAY_SIZE(bcma_bcm_device_names);
|
||||
break;
|
||||
case BCMA_MANUF_MIPS:
|
||||
names = bcma_mips_device_names;
|
||||
size = ARRAY_SIZE(bcma_mips_device_names);
|
||||
break;
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
if (names[i].id == id->id)
|
||||
return names[i].name;
|
||||
}
|
||||
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
|
||||
+148
-1
@@ -181,6 +181,22 @@ static int bcma_sprom_valid(const u16 *sprom)
|
||||
#define SPEX(_field, _offset, _mask, _shift) \
|
||||
bus->sprom._field = ((sprom[SPOFF(_offset)] & (_mask)) >> (_shift))
|
||||
|
||||
#define SPEX32(_field, _offset, _mask, _shift) \
|
||||
bus->sprom._field = ((((u32)sprom[SPOFF((_offset)+2)] << 16 | \
|
||||
sprom[SPOFF(_offset)]) & (_mask)) >> (_shift))
|
||||
|
||||
#define SPEX_ARRAY8(_field, _offset, _mask, _shift) \
|
||||
do { \
|
||||
SPEX(_field[0], _offset + 0, _mask, _shift); \
|
||||
SPEX(_field[1], _offset + 2, _mask, _shift); \
|
||||
SPEX(_field[2], _offset + 4, _mask, _shift); \
|
||||
SPEX(_field[3], _offset + 6, _mask, _shift); \
|
||||
SPEX(_field[4], _offset + 8, _mask, _shift); \
|
||||
SPEX(_field[5], _offset + 10, _mask, _shift); \
|
||||
SPEX(_field[6], _offset + 12, _mask, _shift); \
|
||||
SPEX(_field[7], _offset + 14, _mask, _shift); \
|
||||
} while (0)
|
||||
|
||||
static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)
|
||||
{
|
||||
u16 v, o;
|
||||
@@ -243,7 +259,8 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)
|
||||
SPEX(boardflags2_lo, SSB_SPROM8_BFL2LO, ~0, 0);
|
||||
SPEX(boardflags2_hi, SSB_SPROM8_BFL2HI, ~0, 0);
|
||||
|
||||
SPEX(country_code, SSB_SPROM8_CCODE, ~0, 0);
|
||||
SPEX(alpha2[0], SSB_SPROM8_CCODE, 0xff00, 8);
|
||||
SPEX(alpha2[1], SSB_SPROM8_CCODE, 0x00ff, 0);
|
||||
|
||||
/* Extract cores power info info */
|
||||
for (i = 0; i < ARRAY_SIZE(pwr_info_offset); i++) {
|
||||
@@ -298,6 +315,136 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)
|
||||
SSB_SROM8_FEM_TR_ISO_SHIFT);
|
||||
SPEX(fem.ghz5.antswlut, SSB_SPROM8_FEM5G, SSB_SROM8_FEM_ANTSWLUT,
|
||||
SSB_SROM8_FEM_ANTSWLUT_SHIFT);
|
||||
|
||||
SPEX(ant_available_a, SSB_SPROM8_ANTAVAIL, SSB_SPROM8_ANTAVAIL_A,
|
||||
SSB_SPROM8_ANTAVAIL_A_SHIFT);
|
||||
SPEX(ant_available_bg, SSB_SPROM8_ANTAVAIL, SSB_SPROM8_ANTAVAIL_BG,
|
||||
SSB_SPROM8_ANTAVAIL_BG_SHIFT);
|
||||
SPEX(maxpwr_bg, SSB_SPROM8_MAXP_BG, SSB_SPROM8_MAXP_BG_MASK, 0);
|
||||
SPEX(itssi_bg, SSB_SPROM8_MAXP_BG, SSB_SPROM8_ITSSI_BG,
|
||||
SSB_SPROM8_ITSSI_BG_SHIFT);
|
||||
SPEX(maxpwr_a, SSB_SPROM8_MAXP_A, SSB_SPROM8_MAXP_A_MASK, 0);
|
||||
SPEX(itssi_a, SSB_SPROM8_MAXP_A, SSB_SPROM8_ITSSI_A,
|
||||
SSB_SPROM8_ITSSI_A_SHIFT);
|
||||
SPEX(maxpwr_ah, SSB_SPROM8_MAXP_AHL, SSB_SPROM8_MAXP_AH_MASK, 0);
|
||||
SPEX(maxpwr_al, SSB_SPROM8_MAXP_AHL, SSB_SPROM8_MAXP_AL_MASK,
|
||||
SSB_SPROM8_MAXP_AL_SHIFT);
|
||||
SPEX(gpio0, SSB_SPROM8_GPIOA, SSB_SPROM8_GPIOA_P0, 0);
|
||||
SPEX(gpio1, SSB_SPROM8_GPIOA, SSB_SPROM8_GPIOA_P1,
|
||||
SSB_SPROM8_GPIOA_P1_SHIFT);
|
||||
SPEX(gpio2, SSB_SPROM8_GPIOB, SSB_SPROM8_GPIOB_P2, 0);
|
||||
SPEX(gpio3, SSB_SPROM8_GPIOB, SSB_SPROM8_GPIOB_P3,
|
||||
SSB_SPROM8_GPIOB_P3_SHIFT);
|
||||
SPEX(tri2g, SSB_SPROM8_TRI25G, SSB_SPROM8_TRI2G, 0);
|
||||
SPEX(tri5g, SSB_SPROM8_TRI25G, SSB_SPROM8_TRI5G,
|
||||
SSB_SPROM8_TRI5G_SHIFT);
|
||||
SPEX(tri5gl, SSB_SPROM8_TRI5GHL, SSB_SPROM8_TRI5GL, 0);
|
||||
SPEX(tri5gh, SSB_SPROM8_TRI5GHL, SSB_SPROM8_TRI5GH,
|
||||
SSB_SPROM8_TRI5GH_SHIFT);
|
||||
SPEX(rxpo2g, SSB_SPROM8_RXPO, SSB_SPROM8_RXPO2G,
|
||||
SSB_SPROM8_RXPO2G_SHIFT);
|
||||
SPEX(rxpo5g, SSB_SPROM8_RXPO, SSB_SPROM8_RXPO5G,
|
||||
SSB_SPROM8_RXPO5G_SHIFT);
|
||||
SPEX(rssismf2g, SSB_SPROM8_RSSIPARM2G, SSB_SPROM8_RSSISMF2G, 0);
|
||||
SPEX(rssismc2g, SSB_SPROM8_RSSIPARM2G, SSB_SPROM8_RSSISMC2G,
|
||||
SSB_SPROM8_RSSISMC2G_SHIFT);
|
||||
SPEX(rssisav2g, SSB_SPROM8_RSSIPARM2G, SSB_SPROM8_RSSISAV2G,
|
||||
SSB_SPROM8_RSSISAV2G_SHIFT);
|
||||
SPEX(bxa2g, SSB_SPROM8_RSSIPARM2G, SSB_SPROM8_BXA2G,
|
||||
SSB_SPROM8_BXA2G_SHIFT);
|
||||
SPEX(rssismf5g, SSB_SPROM8_RSSIPARM5G, SSB_SPROM8_RSSISMF5G, 0);
|
||||
SPEX(rssismc5g, SSB_SPROM8_RSSIPARM5G, SSB_SPROM8_RSSISMC5G,
|
||||
SSB_SPROM8_RSSISMC5G_SHIFT);
|
||||
SPEX(rssisav5g, SSB_SPROM8_RSSIPARM5G, SSB_SPROM8_RSSISAV5G,
|
||||
SSB_SPROM8_RSSISAV5G_SHIFT);
|
||||
SPEX(bxa5g, SSB_SPROM8_RSSIPARM5G, SSB_SPROM8_BXA5G,
|
||||
SSB_SPROM8_BXA5G_SHIFT);
|
||||
|
||||
SPEX(pa0b0, SSB_SPROM8_PA0B0, ~0, 0);
|
||||
SPEX(pa0b1, SSB_SPROM8_PA0B1, ~0, 0);
|
||||
SPEX(pa0b2, SSB_SPROM8_PA0B2, ~0, 0);
|
||||
SPEX(pa1b0, SSB_SPROM8_PA1B0, ~0, 0);
|
||||
SPEX(pa1b1, SSB_SPROM8_PA1B1, ~0, 0);
|
||||
SPEX(pa1b2, SSB_SPROM8_PA1B2, ~0, 0);
|
||||
SPEX(pa1lob0, SSB_SPROM8_PA1LOB0, ~0, 0);
|
||||
SPEX(pa1lob1, SSB_SPROM8_PA1LOB1, ~0, 0);
|
||||
SPEX(pa1lob2, SSB_SPROM8_PA1LOB2, ~0, 0);
|
||||
SPEX(pa1hib0, SSB_SPROM8_PA1HIB0, ~0, 0);
|
||||
SPEX(pa1hib1, SSB_SPROM8_PA1HIB1, ~0, 0);
|
||||
SPEX(pa1hib2, SSB_SPROM8_PA1HIB2, ~0, 0);
|
||||
SPEX(cck2gpo, SSB_SPROM8_CCK2GPO, ~0, 0);
|
||||
SPEX32(ofdm2gpo, SSB_SPROM8_OFDM2GPO, ~0, 0);
|
||||
SPEX32(ofdm5glpo, SSB_SPROM8_OFDM5GLPO, ~0, 0);
|
||||
SPEX32(ofdm5gpo, SSB_SPROM8_OFDM5GPO, ~0, 0);
|
||||
SPEX32(ofdm5ghpo, SSB_SPROM8_OFDM5GHPO, ~0, 0);
|
||||
|
||||
/* Extract the antenna gain values. */
|
||||
SPEX(antenna_gain.a0, SSB_SPROM8_AGAIN01,
|
||||
SSB_SPROM8_AGAIN0, SSB_SPROM8_AGAIN0_SHIFT);
|
||||
SPEX(antenna_gain.a1, SSB_SPROM8_AGAIN01,
|
||||
SSB_SPROM8_AGAIN1, SSB_SPROM8_AGAIN1_SHIFT);
|
||||
SPEX(antenna_gain.a2, SSB_SPROM8_AGAIN23,
|
||||
SSB_SPROM8_AGAIN2, SSB_SPROM8_AGAIN2_SHIFT);
|
||||
SPEX(antenna_gain.a3, SSB_SPROM8_AGAIN23,
|
||||
SSB_SPROM8_AGAIN3, SSB_SPROM8_AGAIN3_SHIFT);
|
||||
|
||||
SPEX(leddc_on_time, SSB_SPROM8_LEDDC, SSB_SPROM8_LEDDC_ON,
|
||||
SSB_SPROM8_LEDDC_ON_SHIFT);
|
||||
SPEX(leddc_off_time, SSB_SPROM8_LEDDC, SSB_SPROM8_LEDDC_OFF,
|
||||
SSB_SPROM8_LEDDC_OFF_SHIFT);
|
||||
|
||||
SPEX(txchain, SSB_SPROM8_TXRXC, SSB_SPROM8_TXRXC_TXCHAIN,
|
||||
SSB_SPROM8_TXRXC_TXCHAIN_SHIFT);
|
||||
SPEX(rxchain, SSB_SPROM8_TXRXC, SSB_SPROM8_TXRXC_RXCHAIN,
|
||||
SSB_SPROM8_TXRXC_RXCHAIN_SHIFT);
|
||||
SPEX(antswitch, SSB_SPROM8_TXRXC, SSB_SPROM8_TXRXC_SWITCH,
|
||||
SSB_SPROM8_TXRXC_SWITCH_SHIFT);
|
||||
|
||||
SPEX(opo, SSB_SPROM8_OFDM2GPO, 0x00ff, 0);
|
||||
|
||||
SPEX_ARRAY8(mcs2gpo, SSB_SPROM8_2G_MCSPO, ~0, 0);
|
||||
SPEX_ARRAY8(mcs5gpo, SSB_SPROM8_5G_MCSPO, ~0, 0);
|
||||
SPEX_ARRAY8(mcs5glpo, SSB_SPROM8_5GL_MCSPO, ~0, 0);
|
||||
SPEX_ARRAY8(mcs5ghpo, SSB_SPROM8_5GH_MCSPO, ~0, 0);
|
||||
|
||||
SPEX(rawtempsense, SSB_SPROM8_RAWTS, SSB_SPROM8_RAWTS_RAWTEMP,
|
||||
SSB_SPROM8_RAWTS_RAWTEMP_SHIFT);
|
||||
SPEX(measpower, SSB_SPROM8_RAWTS, SSB_SPROM8_RAWTS_MEASPOWER,
|
||||
SSB_SPROM8_RAWTS_MEASPOWER_SHIFT);
|
||||
SPEX(tempsense_slope, SSB_SPROM8_OPT_CORRX,
|
||||
SSB_SPROM8_OPT_CORRX_TEMP_SLOPE,
|
||||
SSB_SPROM8_OPT_CORRX_TEMP_SLOPE_SHIFT);
|
||||
SPEX(tempcorrx, SSB_SPROM8_OPT_CORRX, SSB_SPROM8_OPT_CORRX_TEMPCORRX,
|
||||
SSB_SPROM8_OPT_CORRX_TEMPCORRX_SHIFT);
|
||||
SPEX(tempsense_option, SSB_SPROM8_OPT_CORRX,
|
||||
SSB_SPROM8_OPT_CORRX_TEMP_OPTION,
|
||||
SSB_SPROM8_OPT_CORRX_TEMP_OPTION_SHIFT);
|
||||
SPEX(freqoffset_corr, SSB_SPROM8_HWIQ_IQSWP,
|
||||
SSB_SPROM8_HWIQ_IQSWP_FREQ_CORR,
|
||||
SSB_SPROM8_HWIQ_IQSWP_FREQ_CORR_SHIFT);
|
||||
SPEX(iqcal_swp_dis, SSB_SPROM8_HWIQ_IQSWP,
|
||||
SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP,
|
||||
SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT);
|
||||
SPEX(hw_iqcal_en, SSB_SPROM8_HWIQ_IQSWP, SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL,
|
||||
SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT);
|
||||
|
||||
SPEX(bw40po, SSB_SPROM8_BW40PO, ~0, 0);
|
||||
SPEX(cddpo, SSB_SPROM8_CDDPO, ~0, 0);
|
||||
SPEX(stbcpo, SSB_SPROM8_STBCPO, ~0, 0);
|
||||
SPEX(bwduppo, SSB_SPROM8_BWDUPPO, ~0, 0);
|
||||
|
||||
SPEX(tempthresh, SSB_SPROM8_THERMAL, SSB_SPROM8_THERMAL_TRESH,
|
||||
SSB_SPROM8_THERMAL_TRESH_SHIFT);
|
||||
SPEX(tempoffset, SSB_SPROM8_THERMAL, SSB_SPROM8_THERMAL_OFFSET,
|
||||
SSB_SPROM8_THERMAL_OFFSET_SHIFT);
|
||||
SPEX(phycal_tempdelta, SSB_SPROM8_TEMPDELTA,
|
||||
SSB_SPROM8_TEMPDELTA_PHYCAL,
|
||||
SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT);
|
||||
SPEX(temps_period, SSB_SPROM8_TEMPDELTA, SSB_SPROM8_TEMPDELTA_PERIOD,
|
||||
SSB_SPROM8_TEMPDELTA_PERIOD_SHIFT);
|
||||
SPEX(temps_hysteresis, SSB_SPROM8_TEMPDELTA,
|
||||
SSB_SPROM8_TEMPDELTA_HYSTERESIS,
|
||||
SSB_SPROM8_TEMPDELTA_HYSTERESIS_SHIFT);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -81,6 +81,9 @@ static struct usb_device_id ath3k_table[] = {
|
||||
/* Atheros AR5BBU12 with sflash firmware */
|
||||
{ USB_DEVICE(0x0489, 0xE02C) },
|
||||
|
||||
/* Atheros AR5BBU22 with sflash firmware */
|
||||
{ USB_DEVICE(0x0489, 0xE03C) },
|
||||
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
|
||||
@@ -99,6 +102,9 @@ static struct usb_device_id ath3k_blist_tbl[] = {
|
||||
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
|
||||
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
|
||||
|
||||
/* Atheros AR5BBU22 with sflash firmware */
|
||||
{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
|
||||
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ struct btmrvl_adapter {
|
||||
u8 wakeup_tries;
|
||||
wait_queue_head_t cmd_wait_q;
|
||||
u8 cmd_complete;
|
||||
bool is_suspended;
|
||||
};
|
||||
|
||||
struct btmrvl_private {
|
||||
@@ -139,8 +140,10 @@ void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb);
|
||||
int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb);
|
||||
|
||||
int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd);
|
||||
int btmrvl_send_hscfg_cmd(struct btmrvl_private *priv);
|
||||
int btmrvl_enable_ps(struct btmrvl_private *priv);
|
||||
int btmrvl_prepare_command(struct btmrvl_private *priv);
|
||||
int btmrvl_enable_hs(struct btmrvl_private *priv);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
void btmrvl_debugfs_init(struct hci_dev *hdev);
|
||||
|
||||
@@ -200,6 +200,36 @@ int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(btmrvl_send_module_cfg_cmd);
|
||||
|
||||
int btmrvl_send_hscfg_cmd(struct btmrvl_private *priv)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
struct btmrvl_cmd *cmd;
|
||||
|
||||
skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC);
|
||||
if (!skb) {
|
||||
BT_ERR("No free skb");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd));
|
||||
cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF,
|
||||
BT_CMD_HOST_SLEEP_CONFIG));
|
||||
cmd->length = 2;
|
||||
cmd->data[0] = (priv->btmrvl_dev.gpio_gap & 0xff00) >> 8;
|
||||
cmd->data[1] = (u8) (priv->btmrvl_dev.gpio_gap & 0x00ff);
|
||||
|
||||
bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
|
||||
|
||||
skb->dev = (void *) priv->btmrvl_dev.hcidev;
|
||||
skb_queue_head(&priv->adapter->tx_queue, skb);
|
||||
|
||||
BT_DBG("Queue HSCFG Command, gpio=0x%x, gap=0x%x", cmd->data[0],
|
||||
cmd->data[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(btmrvl_send_hscfg_cmd);
|
||||
|
||||
int btmrvl_enable_ps(struct btmrvl_private *priv)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
@@ -232,7 +262,7 @@ int btmrvl_enable_ps(struct btmrvl_private *priv)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(btmrvl_enable_ps);
|
||||
|
||||
static int btmrvl_enable_hs(struct btmrvl_private *priv)
|
||||
int btmrvl_enable_hs(struct btmrvl_private *priv)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
struct btmrvl_cmd *cmd;
|
||||
@@ -268,35 +298,15 @@ static int btmrvl_enable_hs(struct btmrvl_private *priv)
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(btmrvl_enable_hs);
|
||||
|
||||
int btmrvl_prepare_command(struct btmrvl_private *priv)
|
||||
{
|
||||
struct sk_buff *skb = NULL;
|
||||
struct btmrvl_cmd *cmd;
|
||||
int ret = 0;
|
||||
|
||||
if (priv->btmrvl_dev.hscfgcmd) {
|
||||
priv->btmrvl_dev.hscfgcmd = 0;
|
||||
|
||||
skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC);
|
||||
if (skb == NULL) {
|
||||
BT_ERR("No free skb");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd));
|
||||
cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF, BT_CMD_HOST_SLEEP_CONFIG));
|
||||
cmd->length = 2;
|
||||
cmd->data[0] = (priv->btmrvl_dev.gpio_gap & 0xff00) >> 8;
|
||||
cmd->data[1] = (u8) (priv->btmrvl_dev.gpio_gap & 0x00ff);
|
||||
|
||||
bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
|
||||
|
||||
skb->dev = (void *) priv->btmrvl_dev.hcidev;
|
||||
skb_queue_head(&priv->adapter->tx_queue, skb);
|
||||
|
||||
BT_DBG("Queue HSCFG Command, gpio=0x%x, gap=0x%x",
|
||||
cmd->data[0], cmd->data[1]);
|
||||
btmrvl_send_hscfg_cmd(priv);
|
||||
}
|
||||
|
||||
if (priv->btmrvl_dev.pscmd) {
|
||||
|
||||
@@ -339,9 +339,7 @@ static int btmrvl_sdio_download_helper(struct btmrvl_sdio_card *card)
|
||||
|
||||
done:
|
||||
kfree(tmphlprbuf);
|
||||
if (fw_helper)
|
||||
release_firmware(fw_helper);
|
||||
|
||||
release_firmware(fw_helper);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -484,10 +482,7 @@ static int btmrvl_sdio_download_fw_w_helper(struct btmrvl_sdio_card *card)
|
||||
|
||||
done:
|
||||
kfree(tmpfwbuf);
|
||||
|
||||
if (fw_firmware)
|
||||
release_firmware(fw_firmware);
|
||||
|
||||
release_firmware(fw_firmware);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1013,6 +1008,9 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
|
||||
priv->btmrvl_dev.psmode = 1;
|
||||
btmrvl_enable_ps(priv);
|
||||
|
||||
priv->btmrvl_dev.gpio_gap = 0xffff;
|
||||
btmrvl_send_hscfg_cmd(priv);
|
||||
|
||||
return 0;
|
||||
|
||||
disable_host_int:
|
||||
@@ -1048,11 +1046,111 @@ static void btmrvl_sdio_remove(struct sdio_func *func)
|
||||
}
|
||||
}
|
||||
|
||||
static int btmrvl_sdio_suspend(struct device *dev)
|
||||
{
|
||||
struct sdio_func *func = dev_to_sdio_func(dev);
|
||||
struct btmrvl_sdio_card *card;
|
||||
struct btmrvl_private *priv;
|
||||
mmc_pm_flag_t pm_flags;
|
||||
struct hci_dev *hcidev;
|
||||
|
||||
if (func) {
|
||||
pm_flags = sdio_get_host_pm_caps(func);
|
||||
BT_DBG("%s: suspend: PM flags = 0x%x", sdio_func_id(func),
|
||||
pm_flags);
|
||||
if (!(pm_flags & MMC_PM_KEEP_POWER)) {
|
||||
BT_ERR("%s: cannot remain alive while suspended",
|
||||
sdio_func_id(func));
|
||||
return -ENOSYS;
|
||||
}
|
||||
card = sdio_get_drvdata(func);
|
||||
if (!card || !card->priv) {
|
||||
BT_ERR("card or priv structure is not valid");
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
BT_ERR("sdio_func is not specified");
|
||||
return 0;
|
||||
}
|
||||
|
||||
priv = card->priv;
|
||||
|
||||
if (priv->adapter->hs_state != HS_ACTIVATED) {
|
||||
if (btmrvl_enable_hs(priv)) {
|
||||
BT_ERR("HS not actived, suspend failed!");
|
||||
return -EBUSY;
|
||||
}
|
||||
}
|
||||
hcidev = priv->btmrvl_dev.hcidev;
|
||||
BT_DBG("%s: SDIO suspend", hcidev->name);
|
||||
hci_suspend_dev(hcidev);
|
||||
skb_queue_purge(&priv->adapter->tx_queue);
|
||||
|
||||
priv->adapter->is_suspended = true;
|
||||
|
||||
/* We will keep the power when hs enabled successfully */
|
||||
if (priv->adapter->hs_state == HS_ACTIVATED) {
|
||||
BT_DBG("suspend with MMC_PM_KEEP_POWER");
|
||||
return sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
|
||||
} else {
|
||||
BT_DBG("suspend without MMC_PM_KEEP_POWER");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static int btmrvl_sdio_resume(struct device *dev)
|
||||
{
|
||||
struct sdio_func *func = dev_to_sdio_func(dev);
|
||||
struct btmrvl_sdio_card *card;
|
||||
struct btmrvl_private *priv;
|
||||
mmc_pm_flag_t pm_flags;
|
||||
struct hci_dev *hcidev;
|
||||
|
||||
if (func) {
|
||||
pm_flags = sdio_get_host_pm_caps(func);
|
||||
BT_DBG("%s: resume: PM flags = 0x%x", sdio_func_id(func),
|
||||
pm_flags);
|
||||
card = sdio_get_drvdata(func);
|
||||
if (!card || !card->priv) {
|
||||
BT_ERR("card or priv structure is not valid");
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
BT_ERR("sdio_func is not specified");
|
||||
return 0;
|
||||
}
|
||||
priv = card->priv;
|
||||
|
||||
if (!priv->adapter->is_suspended) {
|
||||
BT_DBG("device already resumed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
priv->adapter->is_suspended = false;
|
||||
hcidev = priv->btmrvl_dev.hcidev;
|
||||
BT_DBG("%s: SDIO resume", hcidev->name);
|
||||
hci_resume_dev(hcidev);
|
||||
priv->hw_wakeup_firmware(priv);
|
||||
priv->adapter->hs_state = HS_DEACTIVATED;
|
||||
BT_DBG("%s: HS DEACTIVATED in resume!", hcidev->name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops btmrvl_sdio_pm_ops = {
|
||||
.suspend = btmrvl_sdio_suspend,
|
||||
.resume = btmrvl_sdio_resume,
|
||||
};
|
||||
|
||||
static struct sdio_driver bt_mrvl_sdio = {
|
||||
.name = "btmrvl_sdio",
|
||||
.id_table = btmrvl_sdio_ids,
|
||||
.probe = btmrvl_sdio_probe,
|
||||
.remove = btmrvl_sdio_remove,
|
||||
.drv = {
|
||||
.owner = THIS_MODULE,
|
||||
.pm = &btmrvl_sdio_pm_ops,
|
||||
}
|
||||
};
|
||||
|
||||
static int __init btmrvl_sdio_init_module(void)
|
||||
|
||||
@@ -143,6 +143,9 @@ static struct usb_device_id blacklist_table[] = {
|
||||
/* Atheros AR5BBU12 with sflash firmware */
|
||||
{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
|
||||
|
||||
/* Atheros AR5BBU12 with sflash firmware */
|
||||
{ USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 },
|
||||
|
||||
/* Broadcom BCM2035 */
|
||||
{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
|
||||
{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
|
||||
@@ -855,6 +858,7 @@ static void btusb_work(struct work_struct *work)
|
||||
{
|
||||
struct btusb_data *data = container_of(work, struct btusb_data, work);
|
||||
struct hci_dev *hdev = data->hdev;
|
||||
int new_alts;
|
||||
int err;
|
||||
|
||||
if (hdev->conn_hash.sco_num > 0) {
|
||||
@@ -868,11 +872,19 @@ static void btusb_work(struct work_struct *work)
|
||||
|
||||
set_bit(BTUSB_DID_ISO_RESUME, &data->flags);
|
||||
}
|
||||
if (data->isoc_altsetting != 2) {
|
||||
|
||||
if (hdev->voice_setting & 0x0020) {
|
||||
static const int alts[3] = { 2, 4, 5 };
|
||||
new_alts = alts[hdev->conn_hash.sco_num - 1];
|
||||
} else {
|
||||
new_alts = hdev->conn_hash.sco_num;
|
||||
}
|
||||
|
||||
if (data->isoc_altsetting != new_alts) {
|
||||
clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
|
||||
usb_kill_anchored_urbs(&data->isoc_anchor);
|
||||
|
||||
if (__set_isoc_interface(hdev, 2) < 0)
|
||||
if (__set_isoc_interface(hdev, new_alts) < 0)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ static int hci_uart_register_dev(struct hci_uart *hu)
|
||||
hdev->close = hci_uart_close;
|
||||
hdev->flush = hci_uart_flush;
|
||||
hdev->send = hci_uart_send_frame;
|
||||
hdev->parent = hu->tty->dev;
|
||||
SET_HCIDEV_DEV(hdev, hu->tty->dev);
|
||||
|
||||
if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags))
|
||||
set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
|
||||
|
||||
@@ -252,8 +252,9 @@ static int vhci_open(struct inode *inode, struct file *file)
|
||||
}
|
||||
|
||||
file->private_data = data;
|
||||
nonseekable_open(inode, file);
|
||||
|
||||
return nonseekable_open(inode, file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhci_release(struct inode *inode, struct file *file)
|
||||
|
||||
@@ -410,6 +410,12 @@ static struct usb_device_id hfcsusb_idtab[] = {
|
||||
{LED_SCHEME1, {0x88, -64, -32, -16},
|
||||
"ZyXEL OMNI.NET USB II"}),
|
||||
},
|
||||
{
|
||||
USB_DEVICE(0x1ae7, 0x0525),
|
||||
.driver_info = (unsigned long) &((struct hfcsusb_vdata)
|
||||
{LED_SCHEME1, {0x88, -64, -32, -16},
|
||||
"X-Tensions USB ISDN TA XC-525"}),
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
@@ -1082,7 +1082,7 @@ static int gfar_probe(struct platform_device *ofdev)
|
||||
|
||||
if (dev->features & NETIF_F_IP_CSUM ||
|
||||
priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER)
|
||||
dev->hard_header_len += GMAC_FCB_LEN;
|
||||
dev->needed_headroom = GMAC_FCB_LEN;
|
||||
|
||||
/* Program the isrg regs only if number of grps > 1 */
|
||||
if (priv->num_grps > 1) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user