From: Ivo v. D. <iv...@gm...> - 2005-07-23 16:39:40
|
Hi, This patch adds support for the creation of RTS packets when the config fla= g=20 CFG_IEEE80211_RTS has been set. Patch is against ieee80211 1.0.3. Signed-Off-By: Ivo van Doorn <Iv...@gm...> IvD diff -U 3 -H -w -E -d -r -N -- ieee80211-1.0.3/ieee80211_module.c=20 ieee80211-1.0.3-rts/ieee80211_module.c =2D-- ieee80211-1.0.3/ieee80211_module.c 2005-07-15 01:53:35.000000000 +0200 +++ ieee80211-1.0.3-rts/ieee80211_module.c 2005-07-19 16:47:37.000000000 +0= 200 @@ -131,6 +131,7 @@ =20 /* Default fragmentation threshold is maximum payload size */ ieee->fts =3D DEFAULT_FTS; + ieee->rts =3D DEFAULT_FTS; ieee->scan_age =3D DEFAULT_MAX_SCAN_AGE; ieee->open_wep =3D 1; =20 diff -U 3 -H -w -E -d -r -N -- ieee80211-1.0.3/ieee80211_tx.c=20 ieee80211-1.0.3-rts/ieee80211_tx.c =2D-- ieee80211-1.0.3/ieee80211_tx.c 2005-07-15 01:53:35.000000000 +0200 +++ ieee80211-1.0.3-rts/ieee80211_tx.c 2005-07-19 16:47:37.000000000 +0200 @@ -244,7 +244,7 @@ struct ieee80211_device *ieee =3D netdev_priv(dev); struct ieee80211_txb *txb =3D NULL; struct ieee80211_hdr *frag_hdr; =2D int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size; + int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size, rts_required; unsigned long flags; struct net_device_stats *stats =3D &ieee->stats; int ether_type, encrypt, host_encrypt, host_encrypt_msdu; @@ -399,6 +399,10 @@ frag_size =3D bytes + IEEE80211_3ADDR_LEN; } =20 + rts_required =3D (frag_size > ieee->rts && ieee->config & CFG_IEEE80211_R= TS); + if (rts_required) + nr_frags++; + /* When we allocate the TXB we allocate enough space for the reserve * and full fragment bytes (bytes_per_frag doesn't include prefix, * postfix, header, FCS, etc.) */ @@ -414,7 +418,31 @@ else txb->payload_size =3D bytes; =20 =2D for (i =3D 0; i < nr_frags; i++) { + i =3D 0; + if (rts_required) { + skb_frag =3D txb->fragments[i]; + frag_hdr =3D (struct ieee80211_hdr *)skb_put(skb_frag, hdr_len); + + /* + * Set header frame_ctl to the RTS. + */ + header.frame_ctl =3D cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_R= TS); + memcpy(frag_hdr, &header, hdr_len); + + /* + * Restore header frame_ctl to the original data setting. + */ + header.frame_ctl =3D cpu_to_le16(fc); + + if (ieee->config & + (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) + skb_put(skb_frag, 4); + + txb->rts_included =3D 1; + i =3D 1; + } + + for (; i < nr_frags; i++) { skb_frag =3D txb->fragments[i]; =20 if (host_encrypt) diff -U 3 -H -w -E -d -r -N -- ieee80211-1.0.3/net/ieee80211.h=20 ieee80211-1.0.3-rts/net/ieee80211.h =2D-- ieee80211-1.0.3/net/ieee80211.h 2005-07-15 01:53:35.000000000 +0200 +++ ieee80211-1.0.3-rts/net/ieee80211.h 2005-07-19 16:47:37.000000000 +0200 @@ -584,7 +584,8 @@ struct ieee80211_txb { u8 nr_frags; u8 encrypted; =2D u16 reserved; + u8 rts_included; + u8 reserved; u16 frag_size; u16 payload_size; struct sk_buff *fragments[0]; @@ -723,6 +724,7 @@ =20 #define CFG_IEEE80211_RESERVE_FCS (1<<0) #define CFG_IEEE80211_COMPUTE_FCS (1<<1) +#define CFG_IEEE80211_RTS (1<<2) =20 #define IEEE80211_24GHZ_MIN_FREQ 2412 #define IEEE80211_24GHZ_MAX_FREQ 2477 @@ -821,6 +823,7 @@ struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN]; unsigned int frag_next_idx; u16 fts; /* Fragmentation Threshold */ + u16 rts; /* RTS threshold */ =20 /* Association info */ u8 bssid[ETH_ALEN]; |
From: Ivo v. D. <iv...@gm...> - 2005-07-28 15:03:01
|
SGksCgpUaGlzIHBhdGNoIHdpbGwgYWRkIHRoZSBpZWVlODAyMTFfaGRyXzNhZGRyIHRvIHRoZSAK aWVlZTgwMjExX2Fzc29jX3JlcXVlc3RfZnJhbWUgc3RydWN0dXJlLgoKUGF0Y2ggaXMgYWdhaW5z dCBpZWVlODAyMTEgMS4wLjMuCgpJdkQKCgpkaWZmIC1VIDMgLUggLXcgLUUgLWQgLXIgLU4gLS0g aWVlZTgwMjExLTEuMC4zL25ldC9pZWVlODAyMTEuaCAKaWVlZTgwMjExLTEuMC4zLWFzc29jL25l dC9pZWVlODAyMTEuaAotLS0gaWVlZTgwMjExLTEuMC4zL25ldC9pZWVlODAyMTEuaMKgwqDCoMKg wqAyMDA1LTA3LTE1IDAxOjUzOjM1LjAwMDAwMDAwMCArMDIwMAorKysgaWVlZTgwMjExLTEuMC4z LWFzc29jL25ldC9pZWVlODAyMTEuaMKgwqDCoMKgwqDCoMKgMjAwNS0wNy0yOCAxNjo1ODozMC4w MDAwMDAwMDAgCiswMjAwCkBAIC01NjYsNiArNTY2LDcgQEAKwqB9IF9fYXR0cmlidXRlX18gKChw YWNrZWQpKTsKwqAKwqBzdHJ1Y3QgaWVlZTgwMjExX2Fzc29jX3JlcXVlc3RfZnJhbWUgeworwqDC oMKgwqDCoMKgwqBzdHJ1Y3QgaWVlZTgwMjExX2hkcl8zYWRkciBoZWFkZXI7CsKgwqDCoMKgwqDC oMKgwqB1MTYgY2FwYWJpbGl0eTsKwqDCoMKgwqDCoMKgwqDCoHUxNiBsaXN0ZW5faW50ZXJ2YWw7 CsKgwqDCoMKgwqDCoMKgwqB1OCBjdXJyZW50X2FwW0VUSF9BTEVOXTsK |
From: Pedro R. <ram...@se...> - 2005-07-28 15:10:05
|
Ivo van Doorn wrote: > Hi, > > This patch will add the ieee80211_hdr_3addr to the > ieee80211_assoc_request_frame structure. > > Patch is against ieee80211 1.0.3. > > IvD > > > diff -U 3 -H -w -E -d -r -N -- ieee80211-1.0.3/net/ieee80211.h > ieee80211-1.0.3-assoc/net/ieee80211.h > --- ieee80211-1.0.3/net/ieee80211.h 2005-07-15 01:53:35.000000000 +0200 > +++ ieee80211-1.0.3-assoc/net/ieee80211.h 2005-07-28 16:58:30.000000000 > +0200 > @@ -566,6 +566,7 @@ > } __attribute__ ((packed)); > > struct ieee80211_assoc_request_frame { > + struct ieee80211_hdr_3addr header; > u16 capability; > u16 listen_interval; > u8 current_ap[ETH_ALEN]; I don't get it. What's that good for? Thanks! -- Pedro Ramalhais |
From: Ivo v. D. <iv...@gm...> - 2005-07-28 15:19:15
|
On Thursday 28 July 2005 17:10, Pedro Ramalhais wrote: > Ivo van Doorn wrote: > > Hi, > > > > This patch will add the ieee80211_hdr_3addr to the > > ieee80211_assoc_request_frame structure. > > > > Patch is against ieee80211 1.0.3. > > > > IvD > > > > > > diff -U 3 -H -w -E -d -r -N -- ieee80211-1.0.3/net/ieee80211.h > > ieee80211-1.0.3-assoc/net/ieee80211.h > > --- ieee80211-1.0.3/net/ieee80211.h 2005-07-15 01:53:35.000000000 > > +0200 +++ ieee80211-1.0.3-assoc/net/ieee80211.h 2005-07-28 > > 16:58:30.000000000 +0200 > > @@ -566,6 +566,7 @@ > > } __attribute__ ((packed)); > > > > struct ieee80211_assoc_request_frame { > > + struct ieee80211_hdr_3addr header; > > u16 capability; > > u16 listen_interval; > > u8 current_ap[ETH_ALEN]; > > I don't get it. What's that good for? > Thanks! It will make more sense since the structures ieee80211_authentication ieee80211_probe_response ieee80211_assoc_response_frame also contain this ieee80211_hdr_3addr header. I cannot see a reason why it should not be in ieee80211_assoc_request_frame. IvD |
From: Alejandro B. <abo...@li...> - 2005-07-28 15:10:05
|
> Hi, >=20 > This patch will add the ieee80211_hdr_3addr to the=20 > ieee80211_assoc_request_frame structure. >=20 > Patch is against ieee80211 1.0.3. >=20 > IvD >=20 >=20 > diff -U 3 -H -w -E -d -r -N -- ieee80211-1.0.3/net/ieee80211.h=20 > ieee80211-1.0.3-assoc/net/ieee80211.h > --- ieee80211-1.0.3/net/ieee80211.h 2005-07-15=20 > 01:53:35.000000000 +0200 > +++ ieee80211-1.0.3-assoc/net/ieee80211.h 2005-07-28=20 > 16:58:30.000000000=20 > +0200 > @@ -566,6 +566,7 @@ > } __attribute__ ((packed)); > =20 > struct ieee80211_assoc_request_frame { > + struct ieee80211_hdr_3addr header; > u16 capability; > u16 listen_interval; > u8 current_ap[ETH_ALEN]; >=20 Sorry, What is the difference with this patch and the one for ipw2100 to = compile against 1.0.3? http://ipw2100.sourceforge.net/patches/ipw2100-1.1.2-ieee80211-1.0.3.patc= h That patch gives: -#define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_header_data) +#define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_hdr_3addr) #define IPW_MAX_80211_PAYLOAD_SIZE 2304U #define IPW_MAX_802_11_PAYLOAD_LENGTH 2312 #define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536 So this is doing ieee80211_hdr_3addr for the ipw2100 to compile with = 1.0.3, but isn't ieee80211_hdr_3addr already there? I'm confused... |
From: Ivo v. D. <iv...@gm...> - 2005-07-28 15:18:47
|
On Thursday 28 July 2005 17:09, Alejandro Bonilla wrote: > > Hi, > > > > This patch will add the ieee80211_hdr_3addr to the > > ieee80211_assoc_request_frame structure. > > > > Patch is against ieee80211 1.0.3. > > > > IvD > > > > > > diff -U 3 -H -w -E -d -r -N -- ieee80211-1.0.3/net/ieee80211.h > > ieee80211-1.0.3-assoc/net/ieee80211.h > > --- ieee80211-1.0.3/net/ieee80211.h 2005-07-15 > > 01:53:35.000000000 +0200 > > +++ ieee80211-1.0.3-assoc/net/ieee80211.h 2005-07-28 > > 16:58:30.000000000 > > +0200 > > @@ -566,6 +566,7 @@ > > } __attribute__ ((packed)); > > > > struct ieee80211_assoc_request_frame { > > + struct ieee80211_hdr_3addr header; > > u16 capability; > > u16 listen_interval; > > u8 current_ap[ETH_ALEN]; > > Sorry, What is the difference with this patch and the one for ipw2100 to > compile against 1.0.3? > http://ipw2100.sourceforge.net/patches/ipw2100-1.1.2-ieee80211-1.0.3.patch > > That patch gives: > -#define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_header_data) > +#define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_hdr_3addr) > #define IPW_MAX_80211_PAYLOAD_SIZE 2304U > #define IPW_MAX_802_11_PAYLOAD_LENGTH 2312 > #define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536 > > So this is doing ieee80211_hdr_3addr for the ipw2100 to compile with 1.0.= 3, > but isn't ieee80211_hdr_3addr already there? > > I'm confused... The structures ieee80211_authentication ieee80211_probe_response ieee80211_assoc_response_frame All contain the ieee80211_hdr_3addr header, I would consider it more logica= l=20 when ieee80211_assoc_request_frame also contains the header. And with this patch is also removes the requirement for the=20 ipw2100-1.1.2-ieee80211-1.0.3.patch I guess. The ieee80211-devel stack is not only for ipw2100 or ipw2200 correct, so on= ly=20 looking to the ipw drivers and how they operate is not completely=20 appropriate. I think the code must be generic and logical so other drivers= =20 may take advantage of it as well. IvD |
From: James K. <jke...@li...> - 2005-08-05 22:59:21
|
Ivo van Doorn wrote: >This patch adds support for the creation of RTS packets when the config flag >CFG_IEEE80211_RTS has been set. > > Just to make sure I understand... if RTS is enabled, you want to build a single packet, with no payload, that has the RTS bit set, correct? > /* When we allocate the TXB we allocate enough space for the reserve > * and full fragment bytes (bytes_per_frag doesn't include prefix, > * postfix, header, FCS, etc.) */ >@@ -414,7 +418,31 @@ > else > txb->payload_size = bytes; > >- for (i = 0; i < nr_frags; i++) { >+ i = 0; > > Rather than set it to 0 only to set it to 1 later, we can do: >+ if (rts_required) { >+ skb_frag = txb->fragments[i]; >+ frag_hdr = (struct ieee80211_hdr *)skb_put(skb_frag, hdr_len); >+ >+ /* >+ * Set header frame_ctl to the RTS. >+ */ >+ header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS); >+ memcpy(frag_hdr, &header, hdr_len); >+ >+ /* >+ * Restore header frame_ctl to the original data setting. >+ */ >+ header.frame_ctl = cpu_to_le16(fc); >+ >+ if (ieee->config & >+ (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) >+ skb_put(skb_frag, 4); >+ >+ txb->rts_included = 1; >+ i = 1; >+ } > >else i = 0; > > add ^^^ I've applied this and your ieee80211_frame_3addr header fix. Updating GIT overlay in a few minutes. NOTE: I've updated the GIT overlay scripts to pull the ancestor data from .git/info vs. .git/refs If you use my git- scripts then you should pull new copies from rsync://bughost.org/repos/scripts/ James |
From: James K. <jke...@li...> - 2005-08-05 23:10:12
|
James Ketrenos wrote: >I've applied this and your ieee80211_frame_3addr header fix. Updating >GIT overlay in a few minutes. > > The GIT overlay at: rsync://bughos.org/repos/ieee80211-delta/.git/ has been updated with the patches discussed on here as well as several others. James |
From: Ivo v. D. <iv...@gm...> - 2005-08-06 11:02:09
|
Hi, On Saturday 6 August 2005 00:59, James Ketrenos wrote: > Ivo van Doorn wrote: > >This patch adds support for the creation of RTS packets when the config > > flag CFG_IEEE80211_RTS has been set. > > Just to make sure I understand... if RTS is enabled, you want to build a > single packet, with no payload, that has the RTS bit set, correct? Yes, this is correct, this was the exact way the original Ralink drivers ar= e=20 creating a RTS packet, since they don't work with Firmware I guess it is sa= fe=20 to assume this is the correct approach for the creation of a RTS packet. > > /* When we allocate the TXB we allocate enough space for the reserve > > * and full fragment bytes (bytes_per_frag doesn't include prefix, > > * postfix, header, FCS, etc.) */ > >@@ -414,7 +418,31 @@ > > else > > txb->payload_size =3D bytes; > > > >- for (i =3D 0; i < nr_frags; i++) { > >+ i =3D 0; > > Rather than set it to 0 only to set it to 1 later, we can do: > >+ if (rts_required) { > >+ skb_frag =3D txb->fragments[i]; > >+ frag_hdr =3D (struct ieee80211_hdr *)skb_put(skb_frag, hdr_len); > >+ > >+ /* > >+ * Set header frame_ctl to the RTS. > >+ */ > >+ header.frame_ctl =3D cpu_to_le16(IEEE80211_FTYPE_CTL | > > IEEE80211_STYPE_RTS); + memcpy(frag_hdr, &header, hdr_len); > >+ > >+ /* > >+ * Restore header frame_ctl to the original data setting. > >+ */ > >+ header.frame_ctl =3D cpu_to_le16(fc); > >+ > >+ if (ieee->config & > >+ (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) > >+ skb_put(skb_frag, 4); > >+ > >+ txb->rts_included =3D 1; > >+ i =3D 1; > >+ } > > > > > >else i =3D 0; > > add ^^^ Sounds good to me. > I've applied this and your ieee80211_frame_3addr header fix. Updating > GIT overlay in a few minutes. > > NOTE: I've updated the GIT overlay scripts to pull the ancestor data > from .git/info vs. .git/refs If you use my git- scripts then you should > pull new copies from rsync://bughost.org/repos/scripts/ Excellent, thanks. IvD |