Search Linux Wireless

Re: [PATCH 1/2] add mt7601u driver

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

 



On Mon, 04 May 2015 11:37:28 +0200, Johannes Berg wrote:
> On Sat, 2015-05-02 at 15:01 +0200, moorray3@xxxxx wrote:
> 
> > +int mt7601u_wait_asic_ready(struct mt7601u_dev *dev)
> > +{
> > +	int i = 100;
> > +	u32 val;
> > +
> > +	do {
> > +		val = mt7601u_rr(dev, MT_MAC_CSR0);
> > +		if (val && ~val)
> > +			return 0;
> 
> No delays here? Seems odd. You do have one in the next function where
> you also call the _rr() function.

I have not seen this check fail ever, but placing a delay won't hurt.

> > +	skb = alloc_skb(seg_len, GFP_ATOMIC);
> > +	if (!skb)
> > +		return NULL;
> > +
> > +	memset(skb->cb, 0, sizeof(skb->cb));
> 
> Pretty sure that's pointless.

Shamefully pointless, thanks for spotting it.

> > +	if (rxwi->rxinfo & cpu_to_le32(MT_RXINFO_L2PAD)) {
> > +		int hdr_len = ieee80211_get_hdrlen_from_buf(data, seg_len);
> > +
> > +		memcpy(skb_put(skb, hdr_len), data, hdr_len);
> > +		data += hdr_len + 2;
> > +		seg_len -= hdr_len;
> > +	}
> > +
> > +	memcpy(skb_put(skb, seg_len), data, seg_len);
> > +
> > +	return skb;
> 
> Don't know how your buffers are set up, but if the DMA engine consumes
> pages you could consider using paged RX instead of the memcpy().

DMA engine can concatenate multiple frames into a single USB bulk
transfer to a large continuous buffer.  There is no way to request 
any alignment of the frames within that large buffer so I think paged 
RX is not an option.
--
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