NFC: Initial LLCP support
This patch is an initial implementation for the NFC Logical Link Control protocol. It's also known as NFC peer to peer mode. This is a basic implementation as it lacks SDP (services Discovery Protocol), frames aggregation support, and frame rejecion parsing. Follow up patches will implement those missing features. This code has been tested against a Nexus S phone implementing LLCP 1.0. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
361f3cb7f9
commit
d646960f79
@@ -46,6 +46,60 @@ struct nfc_rawsock {
|
||||
#define to_rawsock_sk(_tx_work) \
|
||||
((struct sock *) container_of(_tx_work, struct nfc_rawsock, tx_work))
|
||||
|
||||
#ifdef CONFIG_NFC_LLCP
|
||||
|
||||
void nfc_llcp_mac_is_down(struct nfc_dev *dev);
|
||||
void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx,
|
||||
u8 comm_mode, u8 rf_mode);
|
||||
int nfc_llcp_register_device(struct nfc_dev *dev);
|
||||
void nfc_llcp_unregister_device(struct nfc_dev *dev);
|
||||
int nfc_llcp_set_remote_gb(struct nfc_dev *dev, u8 *gb, u8 gb_len);
|
||||
u8 *nfc_llcp_general_bytes(struct nfc_dev *dev, u8 *general_bytes_len);
|
||||
int __init nfc_llcp_init(void);
|
||||
void nfc_llcp_exit(void);
|
||||
|
||||
#else
|
||||
|
||||
void nfc_llcp_mac_is_down(struct nfc_dev *dev)
|
||||
{
|
||||
}
|
||||
|
||||
void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx,
|
||||
u8 comm_mode, u8 rf_mode)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int nfc_llcp_register_device(struct nfc_dev *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void nfc_llcp_unregister_device(struct nfc_dev *dev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int nfc_llcp_set_remote_gb(struct nfc_dev *dev, u8 *gb, u8 gb_len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline u8 *nfc_llcp_general_bytes(struct nfc_dev *dev, u8 *gb_len)
|
||||
{
|
||||
*gb_len = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int nfc_llcp_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void nfc_llcp_exit(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int __init rawsock_init(void);
|
||||
void rawsock_exit(void);
|
||||
|
||||
|
Reference in New Issue
Block a user