info_element->data[1] == 0x50 &&
info_element->data[2] == 0xf2 &&
info_element->data[3] == 0x04) {
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_WZC: %d bytes\n",
- info_element->len);
- network->wzc_ie_len = min(info_element->len+2,
- MAX_WZC_IE_LEN);
- memcpy(network->wzc_ie, info_element,
- network->wzc_ie_len);
+ netdev_dbg(ieee->dev, "MFIE_TYPE_WZC: %d bytes\n",
+ info_element->len);
+ network->wzc_ie_len = min(info_element->len+2, MAX_WZC_IE_LEN);
+ memcpy(network->wzc_ie, info_element, network->wzc_ie_len);
}
}
while (length >= sizeof(*info_element)) {
if (sizeof(*info_element) + info_element->len > length) {
- RTLLIB_DEBUG_MGMT("Info elem: parse failed: info_element->len + 2 > left : info_element->len+2=%zd left=%d, id=%d.\n",
- info_element->len +
- sizeof(*info_element),
- length, info_element->id);
+ netdev_dbg(ieee->dev,
+ "Info elem: parse failed: info_element->len + 2 > left : info_element->len+2=%zd left=%d, id=%d.\n",
+ info_element->len + sizeof(*info_element),
+ length, info_element->id);
/* We stop processing but don't return an error here
* because some misbehaviour APs break this rule. ie.
* Orinoco AP1000.
memset(network->ssid + network->ssid_len, 0,
IW_ESSID_MAX_SIZE - network->ssid_len);
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n",
- network->ssid, network->ssid_len);
+ netdev_dbg(ieee->dev, "MFIE_TYPE_SSID: '%s' len=%d.\n",
+ network->ssid, network->ssid_len);
break;
case MFIE_TYPE_RATES:
}
}
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_RATES: '%s' (%d)\n",
- rates_str, network->rates_len);
+ netdev_dbg(ieee->dev, "MFIE_TYPE_RATES: '%s' (%d)\n",
+ rates_str, network->rates_len);
break;
case MFIE_TYPE_RATES_EX:
}
}
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_RATES_EX: '%s' (%d)\n",
- rates_str, network->rates_ex_len);
+ netdev_dbg(ieee->dev, "MFIE_TYPE_RATES_EX: '%s' (%d)\n",
+ rates_str, network->rates_ex_len);
break;
case MFIE_TYPE_DS_SET:
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_DS_SET: %d\n",
- info_element->data[0]);
+ netdev_dbg(ieee->dev, "MFIE_TYPE_DS_SET: %d\n",
+ info_element->data[0]);
network->channel = info_element->data[0];
break;
case MFIE_TYPE_FH_SET:
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_FH_SET: ignored\n");
+ netdev_dbg(ieee->dev, "MFIE_TYPE_FH_SET: ignored\n");
break;
case MFIE_TYPE_CF_SET:
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_CF_SET: ignored\n");
+ netdev_dbg(ieee->dev, "MFIE_TYPE_CF_SET: ignored\n");
break;
case MFIE_TYPE_TIM:
case MFIE_TYPE_ERP:
network->erp_value = info_element->data[0];
network->flags |= NETWORK_HAS_ERP_VALUE;
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_ERP_SET: %d\n",
- network->erp_value);
+ netdev_dbg(ieee->dev, "MFIE_TYPE_ERP_SET: %d\n",
+ network->erp_value);
break;
case MFIE_TYPE_IBSS_SET:
network->atim_window = info_element->data[0];
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_IBSS_SET: %d\n",
- network->atim_window);
+ netdev_dbg(ieee->dev, "MFIE_TYPE_IBSS_SET: %d\n",
+ network->atim_window);
break;
case MFIE_TYPE_CHALLENGE:
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_CHALLENGE: ignored\n");
+ netdev_dbg(ieee->dev, "MFIE_TYPE_CHALLENGE: ignored\n");
break;
case MFIE_TYPE_GENERIC:
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_GENERIC: %d bytes\n",
- info_element->len);
+ netdev_dbg(ieee->dev, "MFIE_TYPE_GENERIC: %d bytes\n",
+ info_element->len);
+
rtllib_parse_mife_generic(ieee, info_element, network,
&tmp_htcap_len,
&tmp_htinfo_len);
break;
case MFIE_TYPE_RSN:
- RTLLIB_DEBUG_MGMT("MFIE_TYPE_RSN: %d bytes\n",
- info_element->len);
+ netdev_dbg(ieee->dev, "MFIE_TYPE_RSN: %d bytes\n",
+ info_element->len);
network->rsn_ie_len = min(info_element->len + 2,
MAX_WPA_IE_LEN);
memcpy(network->rsn_ie, info_element,
break;
/* TODO */
default:
- RTLLIB_DEBUG_MGMT
- ("Unsupported info element: %s (%d)\n",
- get_info_element_string(info_element->id),
- info_element->id);
+ netdev_dbg(ieee->dev,
+ "Unsupported info element: %s (%d)\n",
+ get_info_element_string(info_element->id),
+ info_element->id);
break;
}
switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) {
case RTLLIB_STYPE_BEACON:
- RTLLIB_DEBUG_MGMT("received BEACON (%d)\n",
- WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
+ netdev_dbg(ieee->dev, "received BEACON (%d)\n",
+ WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
rtllib_process_probe_response(
ieee, (struct rtllib_probe_response *)header,
stats);
break;
case RTLLIB_STYPE_PROBE_RESP:
- RTLLIB_DEBUG_MGMT("received PROBE RESPONSE (%d)\n",
- WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
+ netdev_dbg(ieee->dev, "received PROBE RESPONSE (%d)\n",
+ WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
rtllib_process_probe_response(ieee,
(struct rtllib_probe_response *)header, stats);
break;
case RTLLIB_STYPE_PROBE_REQ:
- RTLLIB_DEBUG_MGMT("received PROBE RESQUEST (%d)\n",
- WLAN_FC_GET_STYPE(
- le16_to_cpu(header->frame_ctl)));
+ netdev_dbg(ieee->dev, "received PROBE RESQUEST (%d)\n",
+ WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) &&
((ieee->iw_mode == IW_MODE_ADHOC ||
ieee->iw_mode == IW_MODE_MASTER) &&
* with, so we retry or just get back to NO_LINK and scanning
*/
if (ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATING) {
- RTLLIB_DEBUG_MGMT("Authentication failed\n");
+ netdev_dbg(ieee->dev, "Authentication failed\n");
ieee->softmac_stats.no_auth_rs++;
} else {
- RTLLIB_DEBUG_MGMT("Association failed\n");
+ netdev_dbg(ieee->dev, "Association failed\n");
ieee->softmac_stats.no_ass_rs++;
}
struct rtllib_network *beacon = &ieee->current_network;
struct sk_buff *skb;
- RTLLIB_DEBUG_MGMT("Stopping scan\n");
+ netdev_dbg(ieee->dev, "Stopping scan\n");
ieee->softmac_stats.tx_auth_rq++;
rtllib_associate_abort(ieee);
else {
ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATING;
- RTLLIB_DEBUG_MGMT("Sending authentication request\n");
+ netdev_dbg(ieee->dev, "Sending authentication request\n");
softmac_mgmt_xmit(skb, ieee);
if (!timer_pending(&ieee->associate_timer)) {
ieee->associate_timer.expires = jiffies + (HZ / 2);
*(c++) = chlen;
memcpy(c, challenge, chlen);
- RTLLIB_DEBUG_MGMT("Sending authentication challenge response\n");
+ netdev_dbg(ieee->dev,
+ "Sending authentication challenge response\n");
rtllib_encrypt_fragment(ieee, skb,
sizeof(struct rtllib_hdr_3addr));
del_timer_sync(&ieee->associate_timer);
- RTLLIB_DEBUG_MGMT("Sending association request\n");
+ netdev_dbg(ieee->dev, "Sending association request\n");
ieee->softmac_stats.tx_ass_rq++;
skb = rtllib_association_req(beacon, ieee);
spin_unlock_irqrestore(&ieee->lock, flags);
}
-static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen)
+static inline u16 auth_parse(struct net_device *dev, struct sk_buff *skb,
+ u8 **challenge, int *chlen)
{
struct rtllib_authentication *a;
u8 *t;
if (skb->len < (sizeof(struct rtllib_authentication) -
sizeof(struct rtllib_info_element))) {
- RTLLIB_DEBUG_MGMT("invalid len in auth resp: %d\n", skb->len);
+ netdev_dbg(dev, "invalid len in auth resp: %d\n", skb->len);
return 0xcafe;
}
*challenge = NULL;
return le16_to_cpu(a->status);
}
-static int auth_rq_parse(struct sk_buff *skb, u8 *dest)
+static int auth_rq_parse(struct net_device *dev, struct sk_buff *skb, u8 *dest)
{
struct rtllib_authentication *a;
if (skb->len < (sizeof(struct rtllib_authentication) -
sizeof(struct rtllib_info_element))) {
- RTLLIB_DEBUG_MGMT("invalid len in auth request: %d\n",
- skb->len);
+ netdev_dbg(dev, "invalid len in auth request: %d\n", skb->len);
return -1;
}
a = (struct rtllib_authentication *) skb->data;
return !strncmp(ssid, ieee->current_network.ssid, ssidlen);
}
-static int assoc_rq_parse(struct sk_buff *skb, u8 *dest)
+static int assoc_rq_parse(struct net_device *dev, struct sk_buff *skb, u8 *dest)
{
struct rtllib_assoc_request_frame *a;
if (skb->len < (sizeof(struct rtllib_assoc_request_frame) -
sizeof(struct rtllib_info_element))) {
-
- RTLLIB_DEBUG_MGMT("invalid len in auth request:%d\n", skb->len);
+ netdev_dbg(dev, "invalid len in auth request:%d\n", skb->len);
return -1;
}
u16 status_code;
if (skb->len < sizeof(struct rtllib_assoc_response_frame)) {
- RTLLIB_DEBUG_MGMT("invalid len in auth resp: %d\n", skb->len);
+ netdev_dbg(ieee->dev, "Invalid len in auth resp: %d\n",
+ skb->len);
return 0xcafe;
}
ieee->softmac_stats.rx_auth_rq++;
- status = auth_rq_parse(skb, dest);
+ status = auth_rq_parse(ieee->dev, skb, dest);
if (status != -1)
rtllib_resp_to_auth(ieee, status, dest);
}
ieee->softmac_stats.rx_ass_rq++;
- if (assoc_rq_parse(skb, dest) != -1)
+ if (assoc_rq_parse(ieee->dev, skb, dest) != -1)
rtllib_resp_to_assoc_rq(ieee, dest);
netdev_info(ieee->dev, "New client associated: %pM\n", dest);
struct rtllib_assoc_response_frame *assoc_resp;
struct rtllib_hdr_3addr *header = (struct rtllib_hdr_3addr *) skb->data;
- RTLLIB_DEBUG_MGMT("received [RE]ASSOCIATION RESPONSE (%d)\n",
- WLAN_FC_GET_STYPE(header->frame_ctl));
+ netdev_dbg(ieee->dev, "received [RE]ASSOCIATION RESPONSE (%d)\n",
+ WLAN_FC_GET_STYPE(header->frame_ctl));
if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATED &&
netdev_info(ieee->dev,
"Association response status code 0x%x\n",
errcode);
- RTLLIB_DEBUG_MGMT(
- "Association response status code 0x%x\n",
- errcode);
if (ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT)
queue_delayed_work_rsl(ieee->wq,
&ieee->associate_procedure_wq, 0);
int chlen = 0;
bool bSupportNmode = true, bHalfSupportNmode = false;
- errcode = auth_parse(skb, &challenge, &chlen);
+ errcode = auth_parse(ieee->dev, skb, &challenge, &chlen);
if (errcode) {
ieee->softmac_stats.rx_auth_rs_err++;
- RTLLIB_DEBUG_MGMT("Authentication respose status code 0x%x",
- errcode);
-
netdev_info(ieee->dev,
"Authentication respose status code 0x%x", errcode);
rtllib_associate_abort(ieee);
if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) {
if (ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATING &&
(ieee->iw_mode == IW_MODE_INFRA)) {
- RTLLIB_DEBUG_MGMT("Received authentication response");
+ netdev_dbg(ieee->dev,
+ "Received authentication response");
rtllib_rx_auth_resp(ieee, skb);
} else if (ieee->iw_mode == IW_MODE_MASTER) {
rtllib_rx_auth_rq(ieee, skb);