forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
…t/linville/wireless-next-2.6 into for-davem
- Loading branch information
Showing
124 changed files
with
6,268 additions
and
1,033 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
Linux NFC subsystem | ||
=================== | ||
|
||
The Near Field Communication (NFC) subsystem is required to standardize the | ||
NFC device drivers development and to create an unified userspace interface. | ||
|
||
This document covers the architecture overview, the device driver interface | ||
description and the userspace interface description. | ||
|
||
Architecture overview | ||
--------------------- | ||
|
||
The NFC subsystem is responsible for: | ||
- NFC adapters management; | ||
- Polling for targets; | ||
- Low-level data exchange; | ||
|
||
The subsystem is divided in some parts. The 'core' is responsible for | ||
providing the device driver interface. On the other side, it is also | ||
responsible for providing an interface to control operations and low-level | ||
data exchange. | ||
|
||
The control operations are available to userspace via generic netlink. | ||
|
||
The low-level data exchange interface is provided by the new socket family | ||
PF_NFC. The NFC_SOCKPROTO_RAW performs raw communication with NFC targets. | ||
|
||
|
||
+--------------------------------------+ | ||
| USER SPACE | | ||
+--------------------------------------+ | ||
^ ^ | ||
| low-level | control | ||
| data exchange | operations | ||
| | | ||
| v | ||
| +-----------+ | ||
| AF_NFC | netlink | | ||
| socket +-----------+ | ||
| raw ^ | ||
| | | ||
v v | ||
+---------+ +-----------+ | ||
| rawsock | <--------> | core | | ||
+---------+ +-----------+ | ||
^ | ||
| | ||
v | ||
+-----------+ | ||
| driver | | ||
+-----------+ | ||
|
||
Device Driver Interface | ||
----------------------- | ||
|
||
When registering on the NFC subsystem, the device driver must inform the core | ||
of the set of supported NFC protocols and the set of ops callbacks. The ops | ||
callbacks that must be implemented are the following: | ||
|
||
* start_poll - setup the device to poll for targets | ||
* stop_poll - stop on progress polling operation | ||
* activate_target - select and initialize one of the targets found | ||
* deactivate_target - deselect and deinitialize the selected target | ||
* data_exchange - send data and receive the response (transceive operation) | ||
|
||
Userspace interface | ||
-------------------- | ||
|
||
The userspace interface is divided in control operations and low-level data | ||
exchange operation. | ||
|
||
CONTROL OPERATIONS: | ||
|
||
Generic netlink is used to implement the interface to the control operations. | ||
The operations are composed by commands and events, all listed below: | ||
|
||
* NFC_CMD_GET_DEVICE - get specific device info or dump the device list | ||
* NFC_CMD_START_POLL - setup a specific device to polling for targets | ||
* NFC_CMD_STOP_POLL - stop the polling operation in a specific device | ||
* NFC_CMD_GET_TARGET - dump the list of targets found by a specific device | ||
|
||
* NFC_EVENT_DEVICE_ADDED - reports an NFC device addition | ||
* NFC_EVENT_DEVICE_REMOVED - reports an NFC device removal | ||
* NFC_EVENT_TARGETS_FOUND - reports START_POLL results when 1 or more targets | ||
are found | ||
|
||
The user must call START_POLL to poll for NFC targets, passing the desired NFC | ||
protocols through NFC_ATTR_PROTOCOLS attribute. The device remains in polling | ||
state until it finds any target. However, the user can stop the polling | ||
operation by calling STOP_POLL command. In this case, it will be checked if | ||
the requester of STOP_POLL is the same of START_POLL. | ||
|
||
If the polling operation finds one or more targets, the event TARGETS_FOUND is | ||
sent (including the device id). The user must call GET_TARGET to get the list of | ||
all targets found by such device. Each reply message has target attributes with | ||
relevant information such as the supported NFC protocols. | ||
|
||
All polling operations requested through one netlink socket are stopped when | ||
it's closed. | ||
|
||
LOW-LEVEL DATA EXCHANGE: | ||
|
||
The userspace must use PF_NFC sockets to perform any data communication with | ||
targets. All NFC sockets use AF_NFC: | ||
|
||
struct sockaddr_nfc { | ||
sa_family_t sa_family; | ||
__u32 dev_idx; | ||
__u32 target_idx; | ||
__u32 nfc_protocol; | ||
}; | ||
|
||
To establish a connection with one target, the user must create an | ||
NFC_SOCKPROTO_RAW socket and call the 'connect' syscall with the sockaddr_nfc | ||
struct correctly filled. All information comes from NFC_EVENT_TARGETS_FOUND | ||
netlink event. As a target can support more than one NFC protocol, the user | ||
must inform which protocol it wants to use. | ||
|
||
Internally, 'connect' will result in an activate_target call to the driver. | ||
When the socket is closed, the target is deactivated. | ||
|
||
The data format exchanged through the sockets is NFC protocol dependent. For | ||
instance, when communicating with MIFARE tags, the data exchanged are MIFARE | ||
commands and their responses. | ||
|
||
The first received package is the response to the first sent package and so | ||
on. In order to allow valid "empty" responses, every data received has a NULL | ||
header of 1 byte. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,3 +122,4 @@ obj-y += ieee802154/ | |
obj-y += clk/ | ||
|
||
obj-$(CONFIG_HWSPINLOCK) += hwspinlock/ | ||
obj-$(CONFIG_NFC) += nfc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Broadcom specific AMBA | ||
* PCI Core in hostmode | ||
* | ||
* Licensed under the GNU/GPL. See COPYING for details. | ||
*/ | ||
|
||
#include "bcma_private.h" | ||
#include <linux/bcma/bcma.h> | ||
|
||
void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) | ||
{ | ||
pr_err("No support for PCI core in hostmode yet\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Firmware command interface definitions | ||
* | ||
* Copyright 2008, Johannes Berg <[email protected]> | ||
* Copyright 2009, 2010, Christian Lamparter <[email protected]> | ||
* Copyright 2009-2011 Christian Lamparter <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -54,6 +54,7 @@ enum carl9170_cmd_oids { | |
CARL9170_CMD_BCN_CTRL = 0x05, | ||
CARL9170_CMD_READ_TSF = 0x06, | ||
CARL9170_CMD_RX_FILTER = 0x07, | ||
CARL9170_CMD_WOL = 0x08, | ||
|
||
/* CAM */ | ||
CARL9170_CMD_EKEY = 0x10, | ||
|
@@ -180,6 +181,21 @@ struct carl9170_bcn_ctrl_cmd { | |
#define CARL9170_BCN_CTRL_DRAIN 0 | ||
#define CARL9170_BCN_CTRL_CAB_TRIGGER 1 | ||
|
||
struct carl9170_wol_cmd { | ||
__le32 flags; | ||
u8 mac[6]; | ||
u8 bssid[6]; | ||
__le32 null_interval; | ||
__le32 free_for_use2; | ||
__le32 mask; | ||
u8 pattern[32]; | ||
} __packed; | ||
|
||
#define CARL9170_WOL_CMD_SIZE 60 | ||
|
||
#define CARL9170_WOL_DISCONNECT 1 | ||
#define CARL9170_WOL_MAGIC_PKT 2 | ||
|
||
struct carl9170_cmd_head { | ||
union { | ||
struct { | ||
|
@@ -203,6 +219,7 @@ struct carl9170_cmd { | |
struct carl9170_write_reg wreg; | ||
struct carl9170_rf_init rf_init; | ||
struct carl9170_psm psm; | ||
struct carl9170_wol_cmd wol; | ||
struct carl9170_bcn_ctrl_cmd bcn_ctrl; | ||
struct carl9170_rx_filter_cmd rx_filter; | ||
u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* | ||
* Firmware descriptor format | ||
* | ||
* Copyright 2009, 2010, Christian Lamparter <[email protected]> | ||
* Copyright 2009-2011 Christian Lamparter <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -72,6 +72,9 @@ enum carl9170fw_feature_list { | |
/* Wake up on WLAN */ | ||
CARL9170FW_WOL, | ||
|
||
/* Firmware supports PSM in the 5GHZ Band */ | ||
CARL9170FW_FIXED_5GHZ_PSM, | ||
|
||
/* KEEP LAST */ | ||
__CARL9170FW_FEATURE_NUM | ||
}; | ||
|
@@ -82,6 +85,7 @@ enum carl9170fw_feature_list { | |
#define DBG_MAGIC "DBG\0" | ||
#define CHK_MAGIC "CHK\0" | ||
#define TXSQ_MAGIC "TXSQ" | ||
#define WOL_MAGIC "WOL\0" | ||
#define LAST_MAGIC "LAST" | ||
|
||
#define CARL9170FW_SET_DAY(d) (((d) - 1) % 31) | ||
|
@@ -104,7 +108,7 @@ struct carl9170fw_desc_head { | |
(sizeof(struct carl9170fw_desc_head)) | ||
|
||
#define CARL9170FW_OTUS_DESC_MIN_VER 6 | ||
#define CARL9170FW_OTUS_DESC_CUR_VER 6 | ||
#define CARL9170FW_OTUS_DESC_CUR_VER 7 | ||
struct carl9170fw_otus_desc { | ||
struct carl9170fw_desc_head head; | ||
__le32 feature_set; | ||
|
@@ -186,6 +190,16 @@ struct carl9170fw_txsq_desc { | |
#define CARL9170FW_TXSQ_DESC_SIZE \ | ||
(sizeof(struct carl9170fw_txsq_desc)) | ||
|
||
#define CARL9170FW_WOL_DESC_MIN_VER 1 | ||
#define CARL9170FW_WOL_DESC_CUR_VER 1 | ||
struct carl9170fw_wol_desc { | ||
struct carl9170fw_desc_head head; | ||
|
||
__le32 supported_triggers; /* CARL9170_WOL_ */ | ||
} __packed; | ||
#define CARL9170FW_WOL_DESC_SIZE \ | ||
(sizeof(struct carl9170fw_wol_desc)) | ||
|
||
#define CARL9170FW_LAST_DESC_MIN_VER 1 | ||
#define CARL9170FW_LAST_DESC_CUR_VER 2 | ||
struct carl9170fw_last_desc { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Register map, hardware-specific definitions | ||
* | ||
* Copyright 2008, Johannes Berg <[email protected]> | ||
* Copyright 2009, 2010, Christian Lamparter <[email protected]> | ||
* Copyright 2009-2011 Christian Lamparter <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -357,7 +357,18 @@ | |
|
||
#define AR9170_MAC_REG_DMA_WLAN_STATUS (AR9170_MAC_REG_BASE + 0xd38) | ||
#define AR9170_MAC_REG_DMA_STATUS (AR9170_MAC_REG_BASE + 0xd3c) | ||
|
||
#define AR9170_MAC_REG_DMA_TXQ_LAST_ADDR (AR9170_MAC_REG_BASE + 0xd40) | ||
#define AR9170_MAC_REG_DMA_TXQ0_LAST_ADDR (AR9170_MAC_REG_BASE + 0xd40) | ||
#define AR9170_MAC_REG_DMA_TXQ1_LAST_ADDR (AR9170_MAC_REG_BASE + 0xd44) | ||
#define AR9170_MAC_REG_DMA_TXQ2_LAST_ADDR (AR9170_MAC_REG_BASE + 0xd48) | ||
#define AR9170_MAC_REG_DMA_TXQ3_LAST_ADDR (AR9170_MAC_REG_BASE + 0xd4c) | ||
#define AR9170_MAC_REG_DMA_TXQ4_LAST_ADDR (AR9170_MAC_REG_BASE + 0xd50) | ||
#define AR9170_MAC_REG_DMA_TXQ0Q1_LEN (AR9170_MAC_REG_BASE + 0xd54) | ||
#define AR9170_MAC_REG_DMA_TXQ2Q3_LEN (AR9170_MAC_REG_BASE + 0xd58) | ||
#define AR9170_MAC_REG_DMA_TXQ4_LEN (AR9170_MAC_REG_BASE + 0xd5c) | ||
|
||
#define AR9170_MAC_REG_DMA_TXQX_LAST_ADDR (AR9170_MAC_REG_BASE + 0xd74) | ||
#define AR9170_MAC_REG_DMA_TXQX_FAIL_ADDR (AR9170_MAC_REG_BASE + 0xd78) | ||
#define AR9170_MAC_REG_TXRX_MPI (AR9170_MAC_REG_BASE + 0xd7c) | ||
#define AR9170_MAC_TXRX_MPI_TX_MPI_MASK 0x0000000f | ||
#define AR9170_MAC_TXRX_MPI_TX_TO_MASK 0x0000fff0 | ||
|
Oops, something went wrong.