2009-01-22 21:52:34

by Gordon, Charles

[permalink] [raw]
Subject: Question on tx field of struct ieee80211_ops

I'm writing a wireless driver that will use the mac80211 API. My hardware = allows me to send one packet at a time. The driver is suppose to set the t= x field (among others) in the struct ieee80211_ops argument passed to ieee8= 0211_alloc_hw(). The tx field should be loaded with a pointer to a low lev= el transmit routine. However, it's not clear from the documentation if thi= s routine should maintain a packet queue or not. Is it okay for the low le= vel transmit routine to only allow one packet to be transmitted at a time, = or should it maintain a queue of tx packets? It seems like the mac80211 AP= I is already maintaining a queue, so I'm not sure that the low level driver= should maintain a second one.

Thanks for any information you can provide.



2009-01-23 05:46:04

by Larry Finger

[permalink] [raw]
Subject: Re: Question on tx field of struct ieee80211_ops

Gordon, Charles wrote:
> A follow up question on this is if my transmit routine does not have its own queue and the H/W can only transmit 1 packet at a time, should the transmit routine call ieee80211_stop_queue() when it starts the transmit procedure, and then call ieee80211_wake_queue() when the hardware indicates it has finished transmitting the packet.

I'm not an expert on mac80211, but if you look at the code in
drivers/net/wireless/rtl818x/rtl8187_dev.c, you will see that they TX
packets are not queued by the driver. When the tx ops routine is
called, the data is processed as required and the packet is sent on to
the hardware. In the callback routine, certain status information is
filled in and ieee80211_tx_status_irqsafe() is called to finish the
transaction. You only need to worry about protecting the private data
from concurrent access.

Larry

2009-01-23 22:11:01

by Johannes Berg

[permalink] [raw]
Subject: RE: Question on tx field of struct ieee80211_ops

On Thu, 2009-01-22 at 16:26 -0600, Gordon, Charles wrote:
> A follow up question on this is if my transmit routine does not have
> its own queue and the H/W can only transmit 1 packet at a time, should
> the transmit routine call ieee80211_stop_queue() when it starts the
> transmit procedure, and then call ieee80211_wake_queue() when the
> hardware indicates it has finished transmitting the packet.

Yes, that's exactly the right way to do it. I think adm8211.c does that
too.

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2009-01-22 22:26:57

by Gordon, Charles

[permalink] [raw]
Subject: RE: Question on tx field of struct ieee80211_ops

A follow up question on this is if my transmit routine does not have its own queue and the H/W can only transmit 1 packet at a time, should the transmit routine call ieee80211_stop_queue() when it starts the transmit procedure, and then call ieee80211_wake_queue() when the hardware indicates it has finished transmitting the packet.


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Gordon, Charles
Sent: Thursday, January 22, 2009 4:53 PM
To: [email protected]
Subject: Question on tx field of struct ieee80211_ops

I'm writing a wireless driver that will use the mac80211 API. My hardware = allows me to send one packet at a time. The driver is suppose to set the t= x field (among others) in the struct ieee80211_ops argument passed to ieee8= 0211_alloc_hw(). The tx field should be loaded with a pointer to a low lev= el transmit routine. However, it's not clear from the documentation if thi= s routine should maintain a packet queue or not. Is it okay for the low le= vel transmit routine to only allow one packet to be transmitted at a time, = or should it maintain a queue of tx packets? It seems like the mac80211 AP= I is already maintaining a queue, so I'm not sure that the low level driver= should maintain a second one.

Thanks for any information you can provide.

2009-01-23 14:40:51

by Kalle Valo

[permalink] [raw]
Subject: Re: Question on tx field of struct ieee80211_ops

"Gordon, Charles" <[email protected]> writes:

> I'm writing a wireless driver that will use the mac80211 API. My
> hardware = allows me to send one packet at a time. The driver is
> suppose to set the t= x field (among others) in the struct
> ieee80211_ops argument passed to ieee8= 0211_alloc_hw(). The tx field
> should be loaded with a pointer to a low lev= el transmit routine.
> However, it's not clear from the documentation if thi= s routine
> should maintain a packet queue or not. Is it okay for the low le= vel
> transmit routine to only allow one packet to be transmitted at a time,
> = or should it maintain a queue of tx packets? It seems like the
> mac80211 AP= I is already maintaining a queue, so I'm not sure that
> the low level driver= should maintain a second one.

In my opinion, the driver should not have a second queue. Just stop
queue while transmitting the frame and wake the queue after it has
been transmitted.

--
Kalle Valo