Skip to contentSkip to conversation

d80211: Add software RTS support

PATCH Superseded Ivo van Doorn 3 participants 11 messages Jan 31, 2007 – Feb 5, 2007

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 d80211: Add software RTS support

Not all hardware are capable of generating their own RTS frames. This patch will add support for creating the RTS frame in software, when the driver requests this through the flag IEEE80211_HW_SOFTWARE_RTS

Signed-off-by Ivo van Doorn <[email protected]>

---

include/net/d80211.h +3 -0
index 65a5d36..17e0530 100644
@@ -531,6 +531,9 @@ struct ieee80211_hw {
 	 * per-packet RC4 key with each TX frame when doing hwcrypto */
 #define IEEE80211_HW_TKIP_REQ_PHASE2_KEY (1<<14)
 
+	/* Does the device need the stack to create a RTS frame */
+#define IEEE80211_HW_SOFTWARE_RTS (1<<15)
+
 	u32 flags;			/* hardware flags defined above */
 
 	/* Set to the size of a needed device specific skb headroom for TX skbs. */
net/d80211/ieee80211.c +57 -4

117 lines not on this page · raw message

net/d80211/ieee80211_i.h +6 -0
index aa4aa81..3ab910c 100644
@@ -119,6 +119,7 @@ struct ieee80211_txrx_data {
 			unsigned int ps_buffered:1;
 			unsigned int short_preamble:1;
 			unsigned int probe_last_frag:1;
+			unsigned int rts_required:1;
 			struct ieee80211_rate *rate;
 			/* use this rate (if set) for last fragment; rate can
 			 * be set to lower rate for the first fragments, e.g.,
@@ -132,6 +133,10 @@ struct ieee80211_txrx_data {
 			 * in skb) */
 			int num_extra_frag;
 			struct sk_buff **extra_frag;
+
+			/* Extra RTS frame, this should be send out
+			 * before any of the other fragments. */
+			struct sk_buff *rts_frame;
 		} tx;
 		struct {
 			struct ieee80211_rx_status *status;
@@ -168,6 +173,7 @@ struct ieee80211_tx_stored_packet {
 	int last_frag_rateidx;
 	int last_frag_hwrate;
 	unsigned int last_frag_rate_ctrl_probe:1;
+	struct sk_buff *rts_frame;
 };
 
 struct ieee80211_passive_scan {
#1 lore raw
Quoted 4 lines · Ivo van Doorn

Not all hardware are capable of generating their own RTS frames. This patch will add support for creating the RTS frame in software, when the driver requests this through the flag IEEE80211_HW_SOFTWARE_RTS

It seems this is not the ideal solution. Most of drivers needing software RTS would need to remember the RTS frame somewhere (as they need to pass it together with the actual frame).

A better solution would be either to pass a pointer to RTS frame data in tx_control or to create a function returning RTS frame.

Jiri

Signature · 2 lines
Jiri Benc
SUSE Labs
#2 lore raw
Quoted 6 lines · Jiri Benc
Quoted 4 lines · Ivo van Doorn

Not all hardware are capable of generating their own RTS frames. This patch will add support for creating the RTS frame in software, when the driver requests this through the flag IEEE80211_HW_SOFTWARE_RTS

Quoted 6 lines

It seems this is not the ideal solution. Most of drivers needing software RTS would need to remember the RTS frame somewhere (as they need to pass it together with the actual frame).

A better solution would be either to pass a pointer to RTS frame data in tx_control or to create a function returning RTS frame.

I sent a patchset that works with most (all?) hardware implementations, as it uses library calls.

I also think that sending RTS in software is not going to work, as the timing can not be guaranteed. And timing is why we do it in the first place. If the HW is not capable of sending RTS frames, we should not try to emulate them in SW, as it might make the situation even worse by messing up the NAVs by wrong timing.

Signature · 1 line
Greetings Michael.
#6 lore raw
In reply to Jiri Benc
Quoted 9 lines · Jiri Benc
Quoted 4 lines · Ivo van Doorn

Not all hardware are capable of generating their own RTS frames. This patch will add support for creating the RTS frame in software, when the driver requests this through the flag IEEE80211_HW_SOFTWARE_RTS

It seems this is not the ideal solution. Most of drivers needing software RTS would need to remember the RTS frame somewhere (as they need to pass it together with the actual frame).

Well in case of rt2x00 (I am not sure which other drivers also need software RTS) the rts packet is just inserted inside the packet ring and is treated as a regular packet/fragment that has just been inserted by the driver.

This patch just adds this additional packet just before the real packet, and in case the real packet could not be send the rts packet is stored in the ieee80211_tx_stored_packet structure to be send later.

Quoted 2 lines

A better solution would be either to pass a pointer to RTS frame data in tx_control or to create a function returning RTS frame.

In case of rt2x00 this would deliver more problems, especially since it will use a ring entry to send the rts frame and in case of rt2500usb and rt73usb it will need a sk_buff structure since it needs to pass it to the device (where the sk_buff will have some free tx_header_room for the descriptor.)

Ivo

#7 lore raw
Quoted 11 lines · Ivo van Doorn
Quoted 9 lines · Jiri Benc
Quoted 4 lines · Ivo van Doorn

Not all hardware are capable of generating their own RTS frames. This patch will add support for creating the RTS frame in software, when the driver requests this through the flag IEEE80211_HW_SOFTWARE_RTS

It seems this is not the ideal solution. Most of drivers needing software RTS would need to remember the RTS frame somewhere (as they need to pass it together with the actual frame).

Quoted 7 lines

Well in case of rt2x00 (I am not sure which other drivers also need software RTS) the rts packet is just inserted inside the packet ring and is treated as a regular packet/fragment that has just been inserted by the driver.

This patch just adds this additional packet just before the real packet, and in case the real packet could not be send the rts packet is stored in the ieee80211_tx_stored_packet structure to be send later.

Ok, I see. But this is not going to work with bcm43xx.

I also sent a fix for rt2x00 to work with my patchset.

Quoted 7 lines
Quoted 2 lines

A better solution would be either to pass a pointer to RTS frame data in tx_control or to create a function returning RTS frame.

In case of rt2x00 this would deliver more problems, especially since it will use a ring entry to send the rts frame and in case of rt2500usb and rt73usb it will need a sk_buff structure since it needs to pass it to the device (where the sk_buff will have some free tx_header_room for the descriptor.)

I don't understand this.
You need to put in into the ring either way.

See my patch.

Signature · 1 line
Greetings Michael.
#8 lore raw

Hi,

Quoted 13 lines
Quoted 13 lines
Quoted 8 lines
Quoted 4 lines

Not all hardware are capable of generating their own RTS frames. This patch will add support for creating the RTS frame in software, when the driver requests this through the flag IEEE80211_HW_SOFTWARE_RTS

It seems this is not the ideal solution. Most of drivers needing software RTS would need to remember the RTS frame somewhere (as they need to pass it together with the actual frame).

Well in case of rt2x00 (I am not sure which other drivers also need software RTS) the rts packet is just inserted inside the packet ring and is treated as a regular packet/fragment that has just been inserted by the driver.

Quoted 7 lines
Quoted 3 lines

This patch just adds this additional packet just before the real packet, and in case the real packet could not be send the rts packet is stored in the ieee80211_tx_stored_packet structure to be send later.

Ok, I see. But this is not going to work with bcm43xx.

I also sent a fix for rt2x00 to work with my patchset.

Did you already send that patchset to the netdev list? Because I haven't seen a patch series about rts for d80211 yet.

Quoted 10 lines
Quoted 7 lines
Quoted 2 lines

A better solution would be either to pass a pointer to RTS frame data in tx_control or to create a function returning RTS frame.

In case of rt2x00 this would deliver more problems, especially since it will use a ring entry to send the rts frame and in case of rt2500usb and rt73usb it will need a sk_buff structure since it needs to pass it to the device (where the sk_buff will have some free tx_header_room for the descriptor.)

I don't understand this.
You need to put in into the ring either way.

The new rt2500usb and rt73usb packet ring handling no longer use a DMA buffer but instead send the sk_buffer->data pointer to the USB layer.
The solution as suggested by Jiri could be handled by making sure the rts allocated buffer will also have a tx header room as set in the tx_header_room field. But I am not sure if that would be a better solution than putting the rts packet in a sk_buffer that is being send out just before the real packet...

For the timing problem you mentioned, another solution could be implemented, like already mentioned on the d80211 TODO list, the dscape stack should be able to send a signal to the driver that the last fragment was handed over, this signal can be used by the driver to start sending out the queued packets. This would at least work for rt2x00 where especially for PCI devices _no_ packets are being send until the TX ring has been kicked.

Ivo

#3 lore raw
In reply to Michael Buesch
Quoted 5 lines · Michael Buesch

I also think that sending RTS in software is not going to work, as the timing can not be guaranteed. And timing is why we do it in the first place. If the HW is not capable of sending RTS frames, we should not try to emulate them in SW, as it might make the situation even worse by messing up the NAVs by wrong timing.

That's not emulation in the software, it's just similar approach as with sending fragmented frames - you need (more or less) precise timing there as well and many cards still want them enqueued one-by-one. The firmware takes care of the precise timing. The same could apply to RTS frames (i. e. the firmware recognize them and doesn't send them before it has the next frame ready).

Jiri

Signature · 2 lines
Jiri Benc
SUSE Labs
#4 lore raw
Quoted 7 lines · Jiri Benc
Quoted 5 lines · Michael Buesch

I also think that sending RTS in software is not going to work, as the timing can not be guaranteed. And timing is why we do it in the first place. If the HW is not capable of sending RTS frames, we should not try to emulate them in SW, as it might make the situation even worse by messing up the NAVs by wrong timing.

Quoted 6 lines

That's not emulation in the software, it's just similar approach as with sending fragmented frames - you need (more or less) precise timing there as well and many cards still want them enqueued one-by-one. The firmware takes care of the precise timing. The same could apply to RTS frames (i. e. the firmware recognize them and doesn't send them before it has the next frame ready).

And even for a "dumb" device like rt2x00 (no firmware for rt2400pci, rt2500pci or rt2500usb) it still has rts capabilities. It is just not capable of creating the frame, but the descriptor has a special field that should be set in case of a rts frame. So that would suggest that the device will treat the frame a little bit different than a regular frame.

Ivo

#9 lore raw
In reply to Ivo van Doorn
Quoted 19 lines · Ivo van Doorn

Hi,

Quoted 17 lines
Quoted 16 lines
Quoted 8 lines
Quoted 4 lines

Not all hardware are capable of generating their own RTS frames. This patch will add support for creating the RTS frame in software, when the driver requests this through the flag IEEE80211_HW_SOFTWARE_RTS

It seems this is not the ideal solution. Most of drivers needing software RTS would need to remember the RTS frame somewhere (as they need to pass it together with the actual frame).

Well in case of rt2x00 (I am not sure which other drivers also need software RTS) the rts packet is just inserted inside the packet ring and is treated as a regular packet/fragment that has just been inserted by the driver.

This patch just adds this additional packet just before the real packet, and in case the real packet could not be send the rts packet is stored in the ieee80211_tx_stored_packet structure to be send later.

Quoted 6 lines
Quoted 3 lines

Ok, I see. But this is not going to work with bcm43xx.

I also sent a fix for rt2x00 to work with my patchset.

Did you already send that patchset to the netdev list? Because I haven't seen a patch series about rts for d80211 yet.

No, [email protected]

Quoted 6 lines

The new rt2500usb and rt73usb packet ring handling no longer use a DMA buffer but instead send the sk_buffer->data pointer to the USB layer.
The solution as suggested by Jiri could be handled by making sure the rts allocated buffer will also have a tx header room as set in the tx_header_room field. But I am not sure if that would be a better solution than putting the rts packet in a sk_buffer that is being send out just before the real packet...

In my patchset you can put it into anything you like. I put it into an skb.

Signature · 1 line
Greetings Michael.
#5 lore raw
In reply to Jiri Benc
Quoted 7 lines · Jiri Benc
Quoted 5 lines · Michael Buesch

I also think that sending RTS in software is not going to work, as the timing can not be guaranteed. And timing is why we do it in the first place. If the HW is not capable of sending RTS frames, we should not try to emulate them in SW, as it might make the situation even worse by messing up the NAVs by wrong timing.

Quoted 6 lines

That's not emulation in the software, it's just similar approach as with sending fragmented frames - you need (more or less) precise timing there as well and many cards still want them enqueued one-by-one. The firmware takes care of the precise timing. The same could apply to RTS frames (i. e. the firmware recognize them and doesn't send them before it has the next frame ready).

Yeah, ok. I got the point.
But still, this does not work with bcm43xx. :)

Signature · 1 line
Greetings Michael.
#10 lore raw
In reply to Michael Buesch

Hi,

Quoted 4 lines
Quoted 2 lines

Did you already send that patchset to the netdev list? Because I haven't seen a patch series about rts for d80211 yet.

No, [email protected]

Hmm, wasn't subscribed to that list yet. :(
But now I am. :)

Quoted 9 lines
Quoted 6 lines

The new rt2500usb and rt73usb packet ring handling no longer use a DMA buffer but instead send the sk_buffer->data pointer to the USB layer.
The solution as suggested by Jiri could be handled by making sure the rts allocated buffer will also have a tx header room as set in the tx_header_room field. But I am not sure if that would be a better solution than putting the rts packet in a sk_buffer that is being send out just before the real packet...

In my patchset you can put it into anything you like. I put it into an skb.

Sounds good, I'll look that patchset up in the mailarchive.

Ivo