|
@@ -143,7 +143,8 @@ rtllib_frag_cache_get(struct rtllib_device *ieee,
|
|
|
memcpy(entry->dst_addr, hdr->addr1, ETH_ALEN);
|
|
|
} else {
|
|
|
/* received a fragment of a frame for which the head fragment
|
|
|
- * should have already been received */
|
|
|
+ * should have already been received
|
|
|
+ */
|
|
|
entry = rtllib_frag_cache_find(ieee, seq, frag, tid, hdr->addr2,
|
|
|
hdr->addr1);
|
|
|
if (entry != NULL) {
|
|
@@ -199,7 +200,8 @@ static int rtllib_frag_cache_invalidate(struct rtllib_device *ieee,
|
|
|
*
|
|
|
* Responsible for handling management control frames
|
|
|
*
|
|
|
- * Called by rtllib_rx */
|
|
|
+ * Called by rtllib_rx
|
|
|
+ */
|
|
|
static inline int
|
|
|
rtllib_rx_frame_mgmt(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
struct rtllib_rx_stats *rx_stats, u16 type,
|
|
@@ -224,8 +226,9 @@ rtllib_rx_frame_mgmt(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
|
|
|
-/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
|
|
|
+/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation
|
|
|
+ * Ethernet-II snap header (RFC1042 for most EtherTypes)
|
|
|
+ */
|
|
|
static unsigned char rfc1042_header[] = {
|
|
|
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
|
|
|
};
|
|
@@ -482,7 +485,8 @@ void rtllib_indicate_packets(struct rtllib_device *ieee, struct rtllib_rxb **prx
|
|
|
ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
|
|
|
memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE) == 0)) {
|
|
|
/* remove RFC1042 or Bridge-Tunnel encapsulation
|
|
|
- * and replace EtherType */
|
|
|
+ * and replace EtherType
|
|
|
+ */
|
|
|
skb_pull(sub_skb, SNAP_SIZE);
|
|
|
memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN);
|
|
|
memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN);
|
|
@@ -582,8 +586,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- * Sliding window manipulation. Conditions includes:
|
|
|
+ /* Sliding window manipulation. Conditions includes:
|
|
|
* 1. Incoming SeqNum is equal to WinStart =>Window shift 1
|
|
|
* 2. Incoming SeqNum is larger than the WinEnd => Window shift N
|
|
|
*/
|
|
@@ -598,13 +601,12 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
|
|
|
RTLLIB_DEBUG(RTLLIB_DL_REORDER, "Window Shift! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- * Indication process.
|
|
|
+ /* Indication process.
|
|
|
* After Packet dropping and Sliding Window shifting as above, we can
|
|
|
* now just indicate the packets with the SeqNum smaller than latest
|
|
|
* WinStart and struct buffer other packets.
|
|
|
- */
|
|
|
- /* For Rx Reorder condition:
|
|
|
+ *
|
|
|
+ * For Rx Reorder condition:
|
|
|
* 1. All packets with SeqNum smaller than WinStart => Indicate
|
|
|
* 2. All packets with SeqNum larger than or equal to
|
|
|
* WinStart => Buffer it.
|
|
@@ -647,8 +649,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
|
|
|
pTS->RxIndicateSeq, SeqNum);
|
|
|
}
|
|
|
} else {
|
|
|
- /*
|
|
|
- * Packets are dropped if there are not enough reorder
|
|
|
+ /* Packets are dropped if there are not enough reorder
|
|
|
* entries. This part should be modified!! We can just
|
|
|
* indicate all the packets in struct buffer and get
|
|
|
* reorder entries.
|
|
@@ -698,7 +699,8 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
|
|
|
}
|
|
|
|
|
|
/* Handling pending timer. Set this timer to prevent from long time
|
|
|
- * Rx buffering.*/
|
|
|
+ * Rx buffering.
|
|
|
+ */
|
|
|
if (index > 0) {
|
|
|
if (timer_pending(&pTS->RxPktPendingTimer))
|
|
|
del_timer_sync(&pTS->RxPktPendingTimer);
|
|
@@ -973,7 +975,8 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc,
|
|
|
}
|
|
|
|
|
|
/* Nullfunc frames may have PS-bit set, so they must be passed to
|
|
|
- * hostap_handle_sta_rx() before being dropped here. */
|
|
|
+ * hostap_handle_sta_rx() before being dropped here.
|
|
|
+ */
|
|
|
if (!ieee->IntelPromiscuousModeInfo.bPromiscuousOn) {
|
|
|
if (stype != RTLLIB_STYPE_DATA &&
|
|
|
stype != RTLLIB_STYPE_DATA_CFACK &&
|
|
@@ -1015,7 +1018,8 @@ static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
|
|
|
*crypt = ieee->crypt_info.crypt[idx];
|
|
|
/* allow NULL decrypt to indicate an station specific override
|
|
|
- * for default encryption */
|
|
|
+ * for default encryption
|
|
|
+ */
|
|
|
if (*crypt && ((*crypt)->ops == NULL ||
|
|
|
(*crypt)->ops->decrypt_mpdu == NULL))
|
|
|
*crypt = NULL;
|
|
@@ -1024,7 +1028,8 @@ static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
/* This seems to be triggered by some (multicast?)
|
|
|
* frames from other than current BSS, so just drop the
|
|
|
* frames silently instead of filling system log with
|
|
|
- * these reports. */
|
|
|
+ * these reports.
|
|
|
+ */
|
|
|
RTLLIB_DEBUG_DROP("Decryption failed (not set) (SA= %pM)\n",
|
|
|
hdr->addr2);
|
|
|
ieee->ieee_stats.rx_discards_undecryptable++;
|
|
@@ -1088,11 +1093,13 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
|
|
|
if (frag == 0) {
|
|
|
/* copy first fragment (including full headers) into
|
|
|
- * beginning of the fragment cache skb */
|
|
|
+ * beginning of the fragment cache skb
|
|
|
+ */
|
|
|
memcpy(skb_put(frag_skb, flen), skb->data, flen);
|
|
|
} else {
|
|
|
/* append frame payload to the end of the fragment
|
|
|
- * cache skb */
|
|
|
+ * cache skb
|
|
|
+ */
|
|
|
memcpy(skb_put(frag_skb, flen), skb->data + hdrlen,
|
|
|
flen);
|
|
|
}
|
|
@@ -1102,19 +1109,22 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
if (fc & RTLLIB_FCTL_MOREFRAGS) {
|
|
|
/* more fragments expected - leave the skb in fragment
|
|
|
* cache for now; it will be delivered to upper layers
|
|
|
- * after all fragments have been received */
|
|
|
+ * after all fragments have been received
|
|
|
+ */
|
|
|
return -2;
|
|
|
}
|
|
|
|
|
|
/* this was the last fragment and the frame will be
|
|
|
- * delivered, so remove skb from fragment cache */
|
|
|
+ * delivered, so remove skb from fragment cache
|
|
|
+ */
|
|
|
skb = frag_skb;
|
|
|
hdr = (struct rtllib_hdr_4addr *) skb->data;
|
|
|
rtllib_frag_cache_invalidate(ieee, hdr);
|
|
|
}
|
|
|
|
|
|
/* skb: hdr + (possible reassembled) full MSDU payload; possibly still
|
|
|
- * encrypted/authenticated */
|
|
|
+ * encrypted/authenticated
|
|
|
+ */
|
|
|
if (ieee->host_decrypt && (fc & RTLLIB_FCTL_WEP) &&
|
|
|
rtllib_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) {
|
|
|
netdev_info(ieee->dev, "%s: ==>decrypt msdu error\n", __func__);
|
|
@@ -1127,7 +1137,8 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
rtllib_is_eapol_frame(ieee, skb, hdrlen)) {
|
|
|
|
|
|
/* pass unencrypted EAPOL frames even if encryption is
|
|
|
- * configured */
|
|
|
+ * configured
|
|
|
+ */
|
|
|
struct eapol *eap = (struct eapol *)(skb->data +
|
|
|
24);
|
|
|
RTLLIB_DEBUG_EAP("RX: IEEE 802.1X EAPOL frame: %s\n",
|
|
@@ -1204,7 +1215,8 @@ static void rtllib_rx_indicate_pkt_legacy(struct rtllib_device *ieee,
|
|
|
ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
|
|
|
memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE) == 0)) {
|
|
|
/* remove RFC1042 or Bridge-Tunnel encapsulation and
|
|
|
- * replace EtherType */
|
|
|
+ * replace EtherType
|
|
|
+ */
|
|
|
skb_pull(sub_skb, SNAP_SIZE);
|
|
|
memcpy(skb_push(sub_skb, ETH_ALEN), src, ETH_ALEN);
|
|
|
memcpy(skb_push(sub_skb, ETH_ALEN), dst, ETH_ALEN);
|
|
@@ -1396,7 +1408,8 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
|
|
|
/* Returning 0 indicates to caller that we have not handled the SKB--
|
|
|
* so it is still allocated and can be used again by underlying
|
|
|
- * hardware as a DMA target */
|
|
|
+ * hardware as a DMA target
|
|
|
+ */
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -1442,7 +1455,8 @@ static int rtllib_rx_Mesh(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
|
|
|
/* All received frames are sent to this function. @skb contains the frame in
|
|
|
* IEEE 802.11 format, i.e., in the format it was sent over air.
|
|
|
- * This function is called only as a tasklet (software IRQ). */
|
|
|
+ * This function is called only as a tasklet (software IRQ).
|
|
|
+ */
|
|
|
int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,
|
|
|
struct rtllib_rx_stats *rx_stats)
|
|
|
{
|
|
@@ -1488,10 +1502,7 @@ EXPORT_SYMBOL(rtllib_rx);
|
|
|
|
|
|
static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 };
|
|
|
|
|
|
-/*
|
|
|
-* Make ther structure we read from the beacon packet has
|
|
|
-* the right values
|
|
|
-*/
|
|
|
+/* Make ther structure we read from the beacon packet has the right values */
|
|
|
static int rtllib_verify_qos_info(struct rtllib_qos_information_element
|
|
|
*info_element, int sub_type)
|
|
|
{
|
|
@@ -1509,9 +1520,7 @@ static int rtllib_verify_qos_info(struct rtllib_qos_information_element
|
|
|
}
|
|
|
|
|
|
|
|
|
-/*
|
|
|
- * Parse a QoS parameter element
|
|
|
- */
|
|
|
+/* Parse a QoS parameter element */
|
|
|
static int rtllib_read_qos_param_element(struct rtllib_qos_parameter_info
|
|
|
*element_param, struct rtllib_info_element
|
|
|
*info_element)
|
|
@@ -1535,9 +1544,7 @@ static int rtllib_read_qos_param_element(struct rtllib_qos_parameter_info
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * Parse a QoS information element
|
|
|
- */
|
|
|
+/* Parse a QoS information element */
|
|
|
static int rtllib_read_qos_info_element(struct
|
|
|
rtllib_qos_information_element
|
|
|
*element_info, struct rtllib_info_element
|
|
@@ -1566,9 +1573,7 @@ static int rtllib_read_qos_info_element(struct
|
|
|
}
|
|
|
|
|
|
|
|
|
-/*
|
|
|
- * Write QoS parameters from the ac parameters.
|
|
|
- */
|
|
|
+/* Write QoS parameters from the ac parameters. */
|
|
|
static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info *param_elm,
|
|
|
struct rtllib_qos_data *qos_data)
|
|
|
{
|
|
@@ -1627,8 +1632,7 @@ static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * we have a generic data element which it may contain QoS information or
|
|
|
+/* we have a generic data element which it may contain QoS information or
|
|
|
* parameters element. check the information element length to decide
|
|
|
* which type to read
|
|
|
*/
|
|
@@ -1750,7 +1754,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
|
|
|
length, info_element->id);
|
|
|
/* We stop processing but don't return an error here
|
|
|
* because some misbehaviour APs break this rule. ie.
|
|
|
- * Orinoco AP1000. */
|
|
|
+ * Orinoco AP1000.
|
|
|
+ */
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -2302,7 +2307,8 @@ static inline int is_same_network(struct rtllib_network *src,
|
|
|
/* A network is only a duplicate if the channel, BSSID, ESSID
|
|
|
* and the capability field (in particular IBSS and BSS) all match.
|
|
|
* We treat all <hidden> with the same BSSID and channel
|
|
|
- * as one network */
|
|
|
+ * as one network
|
|
|
+ */
|
|
|
return (((src->ssid_len == dst->ssid_len) || (!ssidbroad)) &&
|
|
|
(src->channel == dst->channel) &&
|
|
|
!memcmp(src->bssid, dst->bssid, ETH_ALEN) &&
|
|
@@ -2524,10 +2530,12 @@ static inline void rtllib_process_probe_response(
|
|
|
*
|
|
|
* NOTE: This search is definitely not optimized. Once its doing
|
|
|
* the "right thing" we'll optimize it for efficiency if
|
|
|
- * necessary */
|
|
|
+ * necessary
|
|
|
+ */
|
|
|
|
|
|
/* Search for this entry in the list and update it if it is
|
|
|
- * already there. */
|
|
|
+ * already there.
|
|
|
+ */
|
|
|
|
|
|
spin_lock_irqsave(&ieee->lock, flags);
|
|
|
if (is_same_network(&ieee->current_network, network,
|
|
@@ -2556,7 +2564,8 @@ static inline void rtllib_process_probe_response(
|
|
|
}
|
|
|
|
|
|
/* If we didn't find a match, then get a new network slot to initialize
|
|
|
- * with this beacon's information */
|
|
|
+ * with this beacon's information
|
|
|
+ */
|
|
|
if (&target->list == &ieee->network_list) {
|
|
|
if (list_empty(&ieee->network_free_list)) {
|
|
|
/* If there are no more slots, expire the oldest */
|