Re: [ath5k-devel] Send packet from inside ath5k_intr() or ath5k_tasklet_rx()

Previous thread: [ath5k-devel] a question about setting the RXDP register by Lrj on Monday, June 21, 2010 - 2:04 am. (4 messages)

Next thread: [ath5k-devel] [RFC] refactor ath9k_platform to sound sane for use in both ath9k and ath5k by Daniel Golle on Monday, June 21, 2010 - 4:48 am. (3 messages)
From: Jin YunYe
Date: Monday, June 21, 2010 - 2:29 am

Dear all,

For research purpose, I want to make the Atheros wifi card to send out
a response packet immediately after ath5k_intr() is triggered by a
packet-receive interrupt.

I want to send the packet in either ath5k_intr() (although I know it
is not good practice...) or ath5k_tasklet_rx(). However, management
packet transmission functions, such as ieee80211_send_probe_req,
ieee80211_send_assoc,... are all defined in mac80211 level and take
input data structures such as struct ieee80211_sub_if_data *, struct
ieee80211_work *,  or struct ieee80211_local *, which I really have
difficulty to find or derive from the ath5k level data structures,
such as ath5k_softc, or ath5k_hw... Could anyone please advise on how
could it be done?

Alternatively, does anyone know how to "fill up" a skb structure
"manually" in the ath5k level and send it out using ath5k_tx()
directly?

Thanks a lot!
YY
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Bob Copeland
Date: Monday, June 21, 2010 - 5:25 am

You might want to use packet injection and monitor mode
for these kinds of things, then it will work with any
Linux hardware.



-- 
Bob Copeland %% www.bobcopeland.com
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Jin YunYe
Date: Tuesday, June 22, 2010 - 12:21 am

Thanks for your reply, Bob.

My problem is not exactly compatibility of hardware. Instead, I want
the driver to send out the response as soon as it receives a packet
(when notified by interrupt ath5k_intr() ).

I am thinking of calling ath5k_tx(struct ieee80211_hw *hw, struct
sk_buff *skb) inside ath5k_tasklet_rx(). However, I have difficulty in
passing the correct skb.

If I am not wrong, struct sk_buff *skb should point to a complete WLAN
packet. Could anyone please advise on how to prepare such a packet.

Thanks again.
YY

_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Bob Copeland
Date: Tuesday, June 22, 2010 - 10:32 am

You are correct, it is a complete packet.  The best advice I can give is
to look at the IEEE 802.11 standard for the packet format.  Create such
a packet in the skb->data (see documentation for dev_alloc_skb, skb_put,
etc.) and then you can invoke ath5k_tx().  Note, however, that locking may
be tricky; you might want to do all rx/tx processing in the irq with a
single lock for this particular task.

When you call ath5k_tx, the packet is put on a queue.  The queue control
unit (QCU) determines when this packet is ready according to a qdisc, and
the DCF control unit (DCU) determines when it is actually sent according
to 802.11 medium access controls, so things like contention window settings
on the queue will have an impact on the delay from hardware to the air.
You'll have to read the source to see how those parameters are programmed.

The hardware itself handles control frames such as ACK/RTS/CTS, so we
don't generate those.

-- 
Bob Copeland %% www.bobcopeland.com
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Jin YunYe
Date: Tuesday, June 22, 2010 - 5:58 pm

Hi, Bob.

Great thanks for your help!

Best Regards
YY

_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Jin YunYe
Date: Wednesday, June 23, 2010 - 11:25 pm

I am a bit curious on the CTS/RTS/ACK part.

I tried to printk out (in ath5k_intr() ) the received frame type while
I am pinging a wireless router using my atheros card at the same time.
However, I cannot see any ACK packet received by my card from the
router. Is it because both TX and RX of ACK/RTS/CTS are completely
handled by the hardware so that the RX of an ACK does not even raise
ath5k_intr()?

Thanks :)

_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Bob Copeland
Date: Thursday, June 24, 2010 - 5:04 am

[please don't top post]


The hardware handles it completely so you won't get an rx interrupt for
these packets.  But you will get TX completion interrupt for the packet
that is being ACKed when the ACK is received, and the tx status will
indicate success or failure.

-- 
Bob Copeland %% www.bobcopeland.com

_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Jin YunYe
Date: Thursday, June 24, 2010 - 5:23 am

Wow, TXOK when received ACK, that actually may save a lot of the trouble!

Thanks a lot for the valuable information, Bob.

Best Regards
YY

_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Aneeq Mahmood
Date: Thursday, June 24, 2010 - 5:41 am

Sorry for hijacking the thread but does the same procedure apply for
management packets such as beacons where there is no ACk packets?
From what i have experienced, beacon transmission is not notified by a
Tx interrupt, or am i wrong?

thanks
cheers!

From: Jin YunYe
Date: Thursday, June 24, 2010 - 5:49 am

Hi, Aneeq

I think some management frames, such as probe request, association
request, will be effectively "acknowledged" by probe response and
association response.

Beacon is normally broadcasted by AP to in-range mobile stations. It
may not be a very good idea for every MS to ACK beacon frames sent by
the same AP.

_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Aneeq Mahmood
Date: Thursday, June 24, 2010 - 6:56 am

HI Jin!

Are you implying that only those packets which are responded by ACK create a
hardware interrupt by transmission?
Sorry for the dumb question but it was a bit ambiguous for me.

And i agree with beacon things in general, broadcasts from AP are not ACKed
as is the case with beacon.

cheers!
aneeq





From: Jin YunYe
Date: Thursday, June 24, 2010 - 6:29 pm

I am not sure on when the hardware interrupt ATH5K_INT_TXOK would be triggered.

Previously, I programmed the driver to let it periodically send out
probe requests, and it seems the transmission of probe req does not
raise ATH5K_INT_TXOK.

I am going to run some tests today with DATA packet transmission and
see how things come out.

Thanks.
YY


_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Jin YunYe
Date: Tuesday, June 29, 2010 - 2:52 am

Some updates... I have been reading and trying to change the source
code these few days. I found that by changing the "rfilt" value in
"ath5k_configure_filter()" for the case of NL80211_IFTYPE_STATION,
control packets such as CTS and ACK can be received by the hardware.

I will be looing at qcu and dcu codes to see if there is a way to
compute the queuing time for the packet.

Thanks.
YY
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Holger Schurig
Date: Tuesday, June 22, 2010 - 1:09 am

> For research purpose, I want to make the Atheros wifi card to send out

Jin YunYe,

this is *NOT* targeted especially to you, so please don't be offended.


Can it be the case that "research" is a mostly a one-way road? Every other 
week I read from someone "For a research we need to do this and that, how can 
I do this". But I haven't read ANY notice about some findings during the last 
year. No research party said "We made XYZ by doing ABC. If that is of any 
interest to you, go and read the paper at http://whatever". And, even if a 
paper comes out, that paper never ends up in any substantial work that makes 
the linux kernel, WLAN drivers or userspace (iw/wpa_supplicant) any better. 
Nothing ever get's practical.

What a waste of time, talent and effort. Researching for the waste-bin ... :-(

-- 
DH3HS, http://www.holgerschurig.de
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
From: Bob Copeland
Date: Tuesday, June 22, 2010 - 10:46 am

Most of the wireless papers I've read have been focused on redesigning
all of the perceived flaws in 802.11, which makes them somewhat
inapplicable to real life.  But I suppose the hope is that anything
interesting will eventually become some future annex.

At least some people are trying out stuff with actual hardware rather
than doing everything in OpNet.  If only the world were nothing but
AWGN :)

A fun read is Rob Pike's "Systems software research is irrelevant" rant.

-- 
Bob Copeland %% www.bobcopeland.com
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel
Previous thread: [ath5k-devel] a question about setting the RXDP register by Lrj on Monday, June 21, 2010 - 2:04 am. (4 messages)

Next thread: [ath5k-devel] [RFC] refactor ath9k_platform to sound sane for use in both ath9k and ath5k by Daniel Golle on Monday, June 21, 2010 - 4:48 am. (3 messages)