Search Linux Wireless

Re: [RFC v2 36/96] cl8k: add key.c

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

 



On Tue, 2022-05-24 at 14:34 +0300, viktor.barna@xxxxxxxxxx wrote:
> 
> +static inline void cl_ccmp_hdr2pn(u8 *pn, u8 *hdr)
> +{
> +	pn[0] = hdr[7];
> +	pn[1] = hdr[6];
> +	pn[2] = hdr[5];
> +	pn[3] = hdr[4];
> +	pn[4] = hdr[1];
> +	pn[5] = hdr[0];
> +}
> +
> +static int cl_key_validate_pn(struct cl_hw *cl_hw, struct cl_sta *cl_sta, struct sk_buff *skb)
> +{
> +	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
> +	int hdrlen = 0, res = 0;
> +	u8 pn[IEEE80211_CCMP_PN_LEN];
> +	u8 tid = 0;
> +
> +	hdrlen = ieee80211_hdrlen(hdr->frame_control);
> +	tid = ieee80211_get_tid(hdr);
> +
> +	cl_ccmp_hdr2pn(pn, skb->data + hdrlen);
> +	res = memcmp(pn, cl_sta->rx_pn[tid], IEEE80211_CCMP_PN_LEN);
> +	if (res < 0) {
> +		cl_hw->rx_info.pkt_drop_invalid_pn++;
> +		return -1;
> +	}
> +
> +	memcpy(cl_sta->rx_pn[tid], pn, IEEE80211_CCMP_PN_LEN);
> +
> +	return 0;
> +}

Why do you do this stuff in the driver if it's effectively the same as
in mac80211?

johannes




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

  Powered by Linux