Commit 25845388 authored by Pranjal Bhor's avatar Pranjal Bhor Committed by Greg Kroah-Hartman

staging: wlan-ng: Logical continuation fixes

Logical continuation coding style issues fixed while
condition checking
Signed-off-by: default avatarPranjal Bhor <bhor.pranjal@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a55218e
...@@ -153,8 +153,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv, ...@@ -153,8 +153,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
(struct wlan_snap *) skb_push(skb, (struct wlan_snap *) skb_push(skb,
sizeof(struct wlan_snap)); sizeof(struct wlan_snap));
e_snap->type = htons(proto); e_snap->type = htons(proto);
if (ethconv == WLAN_ETHCONV_8021h if (ethconv == WLAN_ETHCONV_8021h &&
&& p80211_stt_findproto(proto)) { p80211_stt_findproto(proto)) {
memcpy(e_snap->oui, oui_8021h, memcpy(e_snap->oui, oui_8021h,
WLAN_IEEE_OUI_LEN); WLAN_IEEE_OUI_LEN);
} else { } else {
...@@ -204,8 +204,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv, ...@@ -204,8 +204,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
p80211_wep->data = NULL; p80211_wep->data = NULL;
if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) &&
&& (wlandev->hostwep & HOSTWEP_ENCRYPT)) { (wlandev->hostwep & HOSTWEP_ENCRYPT)) {
/* XXXX need to pick keynum other than default? */ /* XXXX need to pick keynum other than default? */
p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC); p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC);
...@@ -304,12 +304,12 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -304,12 +304,12 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if ((WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 0)) { if ((WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 0)) {
ether_addr_copy(daddr, w_hdr->a3.a1); ether_addr_copy(daddr, w_hdr->a3.a1);
ether_addr_copy(saddr, w_hdr->a3.a2); ether_addr_copy(saddr, w_hdr->a3.a2);
} else if ((WLAN_GET_FC_TODS(fc) == 0) } else if ((WLAN_GET_FC_TODS(fc) == 0) &&
&& (WLAN_GET_FC_FROMDS(fc) == 1)) { (WLAN_GET_FC_FROMDS(fc) == 1)) {
ether_addr_copy(daddr, w_hdr->a3.a1); ether_addr_copy(daddr, w_hdr->a3.a1);
ether_addr_copy(saddr, w_hdr->a3.a3); ether_addr_copy(saddr, w_hdr->a3.a3);
} else if ((WLAN_GET_FC_TODS(fc) == 1) } else if ((WLAN_GET_FC_TODS(fc) == 1) &&
&& (WLAN_GET_FC_FROMDS(fc) == 0)) { (WLAN_GET_FC_FROMDS(fc) == 0)) {
ether_addr_copy(daddr, w_hdr->a3.a3); ether_addr_copy(daddr, w_hdr->a3.a3);
ether_addr_copy(saddr, w_hdr->a3.a2); ether_addr_copy(saddr, w_hdr->a3.a2);
} else { } else {
...@@ -324,8 +324,9 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -324,8 +324,9 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
} }
/* perform de-wep if necessary.. */ /* perform de-wep if necessary.. */
if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) && WLAN_GET_FC_ISWEP(fc) if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) &&
&& (wlandev->hostwep & HOSTWEP_DECRYPT)) { WLAN_GET_FC_ISWEP(fc) &&
(wlandev->hostwep & HOSTWEP_DECRYPT)) {
if (payload_length <= 8) { if (payload_length <= 8) {
netdev_err(netdev, netdev_err(netdev,
"WEP frame too short (%u).\n", skb->len); "WEP frame too short (%u).\n", skb->len);
...@@ -383,15 +384,15 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -383,15 +384,15 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
skb_trim(skb, skb->len - WLAN_CRC_LEN); skb_trim(skb, skb->len - WLAN_CRC_LEN);
} else if ((payload_length >= sizeof(struct wlan_llc) + } else if ((payload_length >= sizeof(struct wlan_llc) +
sizeof(struct wlan_snap)) sizeof(struct wlan_snap)) &&
&& (e_llc->dsap == 0xaa) (e_llc->dsap == 0xaa) &&
&& (e_llc->ssap == 0xaa) (e_llc->ssap == 0xaa) &&
&& (e_llc->ctl == 0x03) (e_llc->ctl == 0x03) &&
&& (((memcmp(e_snap->oui, oui_rfc1042,
(((memcmp(e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN) == 0) WLAN_IEEE_OUI_LEN) == 0) &&
&& (ethconv == WLAN_ETHCONV_8021h) (ethconv == WLAN_ETHCONV_8021h) &&
&& (p80211_stt_findproto(le16_to_cpu(e_snap->type)))) (p80211_stt_findproto(le16_to_cpu(e_snap->type)))) ||
|| (memcmp(e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN) != (memcmp(e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN) !=
0))) { 0))) {
pr_debug("SNAP+RFC1042 len: %d\n", payload_length); pr_debug("SNAP+RFC1042 len: %d\n", payload_length);
/* it's a SNAP + RFC1042 frame && protocol is in STT */ /* it's a SNAP + RFC1042 frame && protocol is in STT */
...@@ -419,10 +420,10 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -419,10 +420,10 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
skb_trim(skb, skb->len - WLAN_CRC_LEN); skb_trim(skb, skb->len - WLAN_CRC_LEN);
} else if ((payload_length >= sizeof(struct wlan_llc) + } else if ((payload_length >= sizeof(struct wlan_llc) +
sizeof(struct wlan_snap)) sizeof(struct wlan_snap)) &&
&& (e_llc->dsap == 0xaa) (e_llc->dsap == 0xaa) &&
&& (e_llc->ssap == 0xaa) (e_llc->ssap == 0xaa) &&
&& (e_llc->ctl == 0x03)) { (e_llc->ctl == 0x03)) {
pr_debug("802.1h/RFC1042 len: %d\n", payload_length); pr_debug("802.1h/RFC1042 len: %d\n", payload_length);
/* it's an 802.1h frame || (an RFC1042 && protocol not in STT) /* it's an 802.1h frame || (an RFC1042 && protocol not in STT)
* build a DIXII + RFC894 * build a DIXII + RFC894
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment