Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340928
b: refs/heads/master
c: 7e2afc9
h: refs/heads/master
v: v3
  • Loading branch information
Arron Wang authored and Samuel Ortiz committed Oct 26, 2012
1 parent 6a2e4a1 commit f984db9
Show file tree
Hide file tree
Showing 14 changed files with 84 additions and 105 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d1f10302568221c20628200bc8baa426c55f61c0
refs/heads/master: 7e2afc9d072b9f84b314b208a125c2b1ce36b685
62 changes: 62 additions & 0 deletions trunk/drivers/nfc/pn544_hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ enum pn544_state {
#define PN544_SYS_MGMT_INFO_NOTIFICATION 0x02

#define PN544_POLLING_LOOP_MGMT_GATE 0x94
#define PN544_DEP_MODE 0x01
#define PN544_DEP_ATR_REQ 0x02
#define PN544_DEP_ATR_RES 0x03
#define PN544_DEP_MERGE 0x0D
#define PN544_PL_RDPHASES 0x06
#define PN544_PL_EMULATION 0x07
#define PN544_PL_NFCT_DEACTIVATED 0x09
Expand Down Expand Up @@ -630,6 +634,9 @@ static int pn544_hci_start_poll(struct nfc_hci_dev *hdev,
int r;
u8 duration[2];
u8 activated;
u8 i_mode = 0x3f; /* Enable all supported modes */
u8 t_mode = 0x0f;
u8 t_merge = 0x01; /* Enable merge by default */

pr_info(DRIVER_DESC ": %s protocols 0x%x 0x%x\n",
__func__, im_protocols, tm_protocols);
Expand Down Expand Up @@ -667,6 +674,61 @@ static int pn544_hci_start_poll(struct nfc_hci_dev *hdev,
if (r < 0)
return r;

if ((im_protocols | tm_protocols) & NFC_PROTO_NFC_DEP_MASK) {
hdev->gb = nfc_get_local_general_bytes(hdev->ndev,
&hdev->gb_len);
pr_debug("generate local bytes %p", hdev->gb);
if (hdev->gb == NULL || hdev->gb_len == 0) {
im_protocols &= ~NFC_PROTO_NFC_DEP_MASK;
tm_protocols &= ~NFC_PROTO_NFC_DEP_MASK;
}
}

if (im_protocols & NFC_PROTO_NFC_DEP_MASK) {
r = nfc_hci_send_event(hdev,
PN544_RF_READER_NFCIP1_INITIATOR_GATE,
NFC_HCI_EVT_END_OPERATION, NULL, 0);
if (r < 0)
return r;

r = nfc_hci_set_param(hdev,
PN544_RF_READER_NFCIP1_INITIATOR_GATE,
PN544_DEP_MODE, &i_mode, 1);
if (r < 0)
return r;

r = nfc_hci_set_param(hdev,
PN544_RF_READER_NFCIP1_INITIATOR_GATE,
PN544_DEP_ATR_REQ, hdev->gb, hdev->gb_len);
if (r < 0)
return r;

r = nfc_hci_send_event(hdev,
PN544_RF_READER_NFCIP1_INITIATOR_GATE,
NFC_HCI_EVT_READER_REQUESTED, NULL, 0);
if (r < 0)
nfc_hci_send_event(hdev,
PN544_RF_READER_NFCIP1_INITIATOR_GATE,
NFC_HCI_EVT_END_OPERATION, NULL, 0);
}

if (tm_protocols & NFC_PROTO_NFC_DEP_MASK) {
r = nfc_hci_set_param(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE,
PN544_DEP_MODE, &t_mode, 1);
if (r < 0)
return r;

r = nfc_hci_set_param(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE,
PN544_DEP_ATR_RES, hdev->gb, hdev->gb_len);
if (r < 0)
return r;

r = nfc_hci_set_param(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE,
PN544_DEP_MERGE, &t_merge, 1);
if (r < 0)
return r;
}

r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE,
NFC_HCI_EVT_READER_REQUESTED, NULL, 0);
if (r < 0)
Expand Down
13 changes: 0 additions & 13 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -3222,19 +3222,6 @@ void ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
struct sk_buff *skb, u8 *p2k);

/**
* ieee80211_aes_cmac_calculate_k1_k2 - calculate the AES-CMAC sub keys
*
* This function computes the two AES-CMAC sub-keys, based on the
* previously installed master key.
*
* @keyconf: the parameter passed with the set key
* @k1: a buffer to be filled with the 1st sub-key
* @k2: a buffer to be filled with the 2nd sub-key
*/
void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf,
u8 *k1, u8 *k2);

/**
* struct ieee80211_key_seq - key sequence counter
*
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/net/nfc/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ struct nfc_hci_dev {
int async_cb_type;
data_exchange_cb_t async_cb;
void *async_cb_context;

u8 *gb;
size_t gb_len;
};

/* hci device allocation */
Expand Down
17 changes: 0 additions & 17 deletions trunk/net/mac80211/aes_cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,3 @@ void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm)
{
crypto_free_cipher(tfm);
}

void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf,
u8 *k1, u8 *k2)
{
u8 l[AES_BLOCK_SIZE] = {};
struct ieee80211_key *key =
container_of(keyconf, struct ieee80211_key, conf);

crypto_cipher_encrypt_one(key->u.aes_cmac.tfm, l, l);

memcpy(k1, l, AES_BLOCK_SIZE);
gf_mulx(k1);

memcpy(k2, k1, AES_BLOCK_SIZE);
gf_mulx(k2);
}
EXPORT_SYMBOL(ieee80211_aes_cmac_calculate_k1_k2);
2 changes: 1 addition & 1 deletion trunk/net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
if (comb->num_different_channels > 1)
return -EINVAL;
}
} else {

/*
* WDS is currently prohibited when channel contexts are used
* because there's no clear definition of which channel WDS
Expand Down
9 changes: 4 additions & 5 deletions trunk/net/mac80211/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,8 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
ieee802_11_parse_elems(mgmt->u.probe_resp.variable, len - baselen,
&elems);

/* ignore non-mesh or secure / unsecure mismatch */
if ((!elems.mesh_id || !elems.mesh_config) ||
(elems.rsn && sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) ||
(!elems.rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE))
/* ignore beacons from secure mesh peers if our security is off */
if (elems.rsn_len && sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE)
return;

if (elems.ds_params && elems.ds_params_len == 1)
Expand All @@ -719,7 +717,8 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
return;

if (mesh_matches_local(sdata, &elems))
if (elems.mesh_id && elems.mesh_config &&
mesh_matches_local(sdata, &elems))
mesh_neighbour_update(sdata, mgmt->sa, &elems);

if (ifmsh->sync_ops)
Expand Down
9 changes: 5 additions & 4 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2433,7 +2433,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
struct ieee80211_chanctx_conf *chanctx_conf;
struct ieee80211_channel *chan;
u32 changed = 0;
bool erp_valid;
bool erp_valid, directed_tim = false;
u8 erp_value = 0;
u32 ncrc;
u8 *bssid;
Expand Down Expand Up @@ -2564,10 +2564,11 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
len - baselen, &elems,
care_about_ies, ncrc);

if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)
directed_tim = ieee80211_check_tim(elems.tim, elems.tim_len,
ifmgd->aid);

if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) {
bool directed_tim = ieee80211_check_tim(elems.tim,
elems.tim_len,
ifmgd->aid);
if (directed_tim) {
if (local->hw.conf.dynamic_ps_timeout > 0) {
if (local->hw.conf.flags & IEEE80211_CONF_PS) {
Expand Down
34 changes: 3 additions & 31 deletions trunk/net/mac80211/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,33 +315,20 @@ TRACE_EVENT(drv_bss_info_changed,
TP_STRUCT__entry(
LOCAL_ENTRY
VIF_ENTRY
__field(u32, changed)
__field(bool, assoc)
__field(bool, ibss_joined)
__field(bool, ibss_creator)
__field(u16, aid)
__field(bool, cts)
__field(bool, shortpre)
__field(bool, shortslot)
__field(bool, enable_beacon)
__field(u8, dtimper)
__field(u16, bcnint)
__field(u16, assoc_cap)
__field(u64, sync_tsf)
__field(u32, sync_device_ts)
__field(u32, basic_rates)
__array(int, mcast_rate, IEEE80211_NUM_BANDS)
__field(u32, changed)
__field(bool, enable_beacon)
__field(u16, ht_operation_mode)
__field(s32, cqm_rssi_thold);
__field(s32, cqm_rssi_hyst);
__field(u32, channel_type);
__dynamic_array(u32, arp_addr_list, info->arp_addr_cnt);
__field(bool, arp_filter_enabled);
__field(bool, qos);
__field(bool, idle);
__field(bool, ps);
__dynamic_array(u8, ssid, info->ssid_len);
__field(bool, hidden_ssid);
),

TP_fast_assign(
Expand All @@ -350,32 +337,17 @@ TRACE_EVENT(drv_bss_info_changed,
__entry->changed = changed;
__entry->aid = info->aid;
__entry->assoc = info->assoc;
__entry->ibss_joined = info->ibss_joined;
__entry->ibss_creator = info->ibss_creator;
__entry->shortpre = info->use_short_preamble;
__entry->cts = info->use_cts_prot;
__entry->shortslot = info->use_short_slot;
__entry->enable_beacon = info->enable_beacon;
__entry->dtimper = info->dtim_period;
__entry->bcnint = info->beacon_int;
__entry->assoc_cap = info->assoc_capability;
__entry->sync_tsf = info->sync_tsf;
__entry->sync_device_ts = info->sync_device_ts;
__entry->basic_rates = info->basic_rates;
memcpy(__entry->mcast_rate, info->mcast_rate,
sizeof(__entry->mcast_rate));
__entry->enable_beacon = info->enable_beacon;
__entry->ht_operation_mode = info->ht_operation_mode;
__entry->cqm_rssi_thold = info->cqm_rssi_thold;
__entry->cqm_rssi_hyst = info->cqm_rssi_hyst;
__entry->channel_type = info->channel_type;
memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list,
sizeof(u32) * info->arp_addr_cnt);
__entry->arp_filter_enabled = info->arp_filter_enabled;
__entry->qos = info->qos;
__entry->idle = info->idle;
__entry->ps = info->ps;
memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
__entry->hidden_ssid = info->hidden_ssid;
),

TP_printk(
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
if (elem_parse_failed)
elems->parse_error = true;
else
__set_bit(id, seen_elems);
set_bit(id, seen_elems);

left -= elen;
pos += elen;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked)
case NL80211_IFTYPE_P2P_DEVICE:
if (!wdev->p2p_started)
break;
rdev_stop_p2p_device(rdev, wdev);
rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
wdev->p2p_started = false;
rdev->opencount--;
break;
Expand Down Expand Up @@ -774,7 +774,7 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev)
case NL80211_IFTYPE_P2P_DEVICE:
if (!wdev->p2p_started)
break;
rdev_stop_p2p_device(rdev, wdev);
rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
wdev->p2p_started = false;
rdev->opencount--;
break;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -6932,7 +6932,7 @@ static int nl80211_start_p2p_device(struct sk_buff *skb, struct genl_info *info)
if (err)
return err;

err = rdev_start_p2p_device(rdev, wdev);
err = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
if (err)
return err;

Expand All @@ -6958,7 +6958,7 @@ static int nl80211_stop_p2p_device(struct sk_buff *skb, struct genl_info *info)
if (!wdev->p2p_started)
return 0;

rdev_stop_p2p_device(rdev, wdev);
rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
wdev->p2p_started = false;

mutex_lock(&rdev->devlist_mtx);
Expand Down
18 changes: 0 additions & 18 deletions trunk/net/wireless/rdev-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -858,22 +858,4 @@ static inline struct ieee80211_channel
return ret;
}

static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
int ret;

trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}

static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
trace_rdev_return_void(&rdev->wiphy);
}
#endif /* __CFG80211_RDEV_OPS */
10 changes: 0 additions & 10 deletions trunk/net/wireless/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -1741,16 +1741,6 @@ TRACE_EVENT(rdev_return_channel,
WIPHY_PR_ARG, CHAN_PR_ARG, __entry->type)
);

DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
TP_ARGS(wiphy, wdev)
);

DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_device,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
TP_ARGS(wiphy, wdev)
);

/*************************************************************
* cfg80211 exported functions traces *
*************************************************************/
Expand Down

0 comments on commit f984db9

Please sign in to comment.