Search Linux Wireless

Re: [PATCH 3.14.0-rc5 v3 3/10] rsi: Adding core and main files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2014-03-03 at 13:47 +0530, Fariya Fatima wrote:
> From: Fariya Fatima

Btw, From: should also have an email address.


> +	frame_type = (skb->data[0] & 0x0f);
> +	fc = *((u16 *)&skb->data[MAC_80211_HDR_FRAME_CONTROL]);


That's not endian safe. you should typecast to a struct instead and
probably use the inlines from ieee80211.h instead of

> +	if ((frame_type == IEEE80211_MGMT_FRAME) ||
> +	    (frame_type == IEEE80211_CTL_FRAME)) {

^ that. You also forgot the masking.

> +	} else {
> +		if (fc & IEEE80211_STYPE_QOS_DATA) {

There's an inline for that too. fc should be __le16. Also you don't need
to init it, in fact don't so the compiler will warn you if you don't do
it in some code path.

> +			tid = (skb->data[24] & IEEE80211_QOS_TID);
> +			pr_info("going in qos_data check\n");
> +			skb->priority = TID_TO_WME_AC(tid);
> +		} else {
> +			tid = IEEE80211_NONQOS_TID;
> +			skb->priority = BE_Q;
> +		}

mac80211 sets and uses skb->priority, so this might not be a good idea.

> +	return -1;

again -1, not sure where it ends up getting used but a proper error code
would be better.

> +	if (!pkt_len) {
> +		rsi_dbg(ERR_ZONE, "%s: Dummy pkt has come in\n", __func__);
> +		BUG_ON(1);
> +	}

No need for BUG_ON, just do

if (WARN(!pkt_len, "Dummy packet..."))
	return NULL;

or so.

> +/**
> + * This function initializes os interface operations.

That sounds like some sort of OS abstraction, but doesn't really seem to
be one? Maybe it should have a different name.

> +	return;
> +}

naked return statements are useless.

> +static void rsi_91x_hal_module_exit(void)
> +{
> +	rsi_dbg(INIT_ZONE, "%s: Module exit called\n", __func__);
> +	return;

ditto

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux