Skip to content

Commit

Permalink
NFC: Move LLCP code to the NFC top level diirectory
Browse files Browse the repository at this point in the history
And stop making it optional. LLCP is a fundamental part of the NFC
specifications and making it optional does not make much sense.

Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
Samuel Ortiz committed Apr 26, 2013
1 parent b006ed5 commit 30cc458
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 79 deletions.
1 change: 0 additions & 1 deletion net/nfc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ menuconfig NFC

source "net/nfc/nci/Kconfig"
source "net/nfc/hci/Kconfig"
source "net/nfc/llcp/Kconfig"

source "drivers/nfc/Kconfig"
6 changes: 4 additions & 2 deletions net/nfc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
obj-$(CONFIG_NFC) += nfc.o
obj-$(CONFIG_NFC_NCI) += nci/
obj-$(CONFIG_NFC_HCI) += hci/
#obj-$(CONFIG_NFC_LLCP) += llcp/

nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \
llcp_sock.o

nfc-objs := core.o netlink.o af_nfc.o rawsock.o
nfc-$(CONFIG_NFC_LLCP) += llcp/llcp.o llcp/commands.o llcp/sock.o
File renamed without changes.
7 changes: 0 additions & 7 deletions net/nfc/llcp/Kconfig

This file was deleted.

2 changes: 1 addition & 1 deletion net/nfc/llcp/commands.c → net/nfc/llcp_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <net/nfc/nfc.h>

#include "../nfc.h"
#include "nfc.h"
#include "llcp.h"

static u8 llcp_tlv_length[LLCP_TLV_MAX] = {
Expand Down
2 changes: 1 addition & 1 deletion net/nfc/llcp/llcp.c → net/nfc/llcp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <linux/list.h>
#include <linux/nfc.h>

#include "../nfc.h"
#include "nfc.h"
#include "llcp.h"

static u8 llcp_magic[3] = {0x46, 0x66, 0x6d};
Expand Down
2 changes: 1 addition & 1 deletion net/nfc/llcp/sock.c → net/nfc/llcp_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <linux/module.h>
#include <linux/nfc.h>

#include "../nfc.h"
#include "nfc.h"
#include "llcp.h"

static int sock_wait_state(struct sock *sk, int state, unsigned long timeo)
Expand Down
3 changes: 1 addition & 2 deletions net/nfc/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
#include <linux/slab.h>

#include "nfc.h"

#include "llcp/llcp.h"
#include "llcp.h"

static struct genl_multicast_group nfc_genl_event_mcgrp = {
.name = NFC_GENL_MCAST_EVENT_NAME,
Expand Down
64 changes: 0 additions & 64 deletions net/nfc/nfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ struct nfc_rawsock {

struct nfc_llcp_sdp_tlv;

#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);
Expand All @@ -64,68 +62,6 @@ void nfc_llcp_exit(void);
void nfc_llcp_free_sdp_tlv(struct nfc_llcp_sdp_tlv *sdp);
void nfc_llcp_free_sdp_tlv_list(struct hlist_head *head);

#else

static inline void nfc_llcp_mac_is_down(struct nfc_dev *dev)
{
}

static inline 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, size_t *gb_len)
{
*gb_len = 0;
return NULL;
}

static inline int nfc_llcp_data_received(struct nfc_dev *dev,
struct sk_buff *skb)
{
return 0;
}

static inline struct nfc_llcp_local *nfc_llcp_find_local(struct nfc_dev *dev)
{
return NULL;
}

static inline int nfc_llcp_init(void)
{
return 0;
}

static inline void nfc_llcp_exit(void)
{
}

static inline void nfc_llcp_free_sdp_tlv(struct nfc_llcp_sdp_tlv *sdp)
{
}

static inline void nfc_llcp_free_sdp_tlv_list(struct hlist_head *sdp_head)
{
}

#endif

int __init rawsock_init(void);
void rawsock_exit(void);

Expand Down

0 comments on commit 30cc458

Please sign in to comment.