From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, kvalo@codeaurora.org,
Larry.Finger@lwfinger.net
Subject: Re: [PATCH 1/1] New driver: rtl8xxxu (mac80211)
Date: Wed, 02 Sep 2015 21:59:30 -0400 [thread overview]
Message-ID: <wrfj4mjcqn3x.fsf@redhat.com> (raw)
In-Reply-To: <1441120044.2441.9.camel@sipsolutions.net> (Johannes Berg's message of "Tue, 01 Sep 2015 17:07:24 +0200")
Johannes Berg <johannes@sipsolutions.net> writes:
> On Mon, 2015-08-31 at 19:42 -0400, Jes Sorensen wrote:
>>
>> Anything related to doing things correctly wrt to the mac80211 API
>> would be awesome.
>
> :)
>
>> static int rtl8xxxu_add_interface(struct ieee80211_hw *hw,
>> struct ieee80211_vif *vif)
>> {
>> struct rtl8xxxu_priv *priv = hw->priv;
>> int ret;
>> u8 val8;
>>
>> switch (vif->type) {
>> case NL80211_IFTYPE_STATION:
>> rtl8723a_stop_tx_beacon(priv);
>
> This seems odd - you shouldn't have any kind of operation before
> add_interface(), so why stop anything?
> (You also don't even support beaconing yet anyway)
The code mimics what the vendor driver does - part of the bringup of the
chip sets a bunch of parameters from an register value array. Rather
than guessing what their default is, I feel it's safer to just shut it
down here and stick with that.
>
>> /*
>> * This is a bit of a hack - the lower bits of the cipher
>> * suite selector happens to match the cipher index in the
>> * CAM
>> */
>
> That's probably simply intentional - the cipher suite selector is built
> as a OUI : cipher number ...
>
> However - I don't see any code actually using key->cipher here? You
> should move the comment into rtl8xxxu_cam_write() I guess.
I did assume it was intentional, but still a bit of a hack in my book.
I'll move the comment, as you suggested.
>> static int
>> rtl8xxxu_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
>> enum ieee80211_ampdu_mlme_action action,
>> struct ieee80211_sta *sta, u16 tid, u16 *ssn, u8 buf_size)
>> {
>> struct rtl8xxxu_priv *priv = hw->priv;
>> struct device *dev = &priv->udev->dev;
>> u8 ampdu_factor, ampdu_density;
>>
>> switch (action) {
> [...]
>
> I'd be extremely surprised if any of this worked - perhaps you're not
> advertising A-MPDU support (yet)?
>
> You're not calling ieee80211_start_tx_ba_cb_irqsafe() or
> ieee80211_stop_tx_ba_cb_irqsafe(), so this can't really work. The
> session might be set up but will never actually start.
>
> That said, the code also looks incomplete. Perhaps better to just
> remove it entirely for now?
I started working on this, but I guess I didn't finish it. One thing I
haven't figured out yet is why I see AMPDU_RX_START events, but I never
see AMPDU_TX_START events show in the log.
>> sta_priv->short_preamble = false;
>
> I don't think there's any need to track it, especially since you only
> use it in TX where you have the TX info data about it.
Oh, I hadn't spotted that information in struct tx_info - in that case I
ought to be able to get rid of this one.
>
>> };
>
> stray semicolons at the end of functions in a few places :)
Gone :)
> I guess you can get rid of sta_add/remove entirely. sta_state() is the
> better hook to implement, but you don't really need any of the three.
I added it because I was looking at using it for AMPDU, then got stock,
but didn't feel like removing it in case I would need it later.
I need to figure out what goes on with the AMPDU side of things - the
problem writing a driver like this without any spec sheets is that it
isn't quite clear to me, how much of this the firmware takes care of
transparently.
>> static void rtl8xxxu_sw_scan_start(struct ieee80211_hw *hw,
>> struct ieee80211_vif *vif, const u8 *mac)
>> {
>> }
>
> No need for this ... You'll get stop even without the start, but
> actually I think your start is perhaps missing setting
> BEACON_DISABLE_TSF_UPDATE (which stop clears)
I'll have a look at this.
Thanks for the comments!
Jes
next prev parent reply other threads:[~2015-09-03 1:59 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-29 21:18 [PATCH 0/1] rtl8xxxu (mac80211) driver for rtl8188[cr]u/rtl8192cu/rtl8723au Jes.Sorensen
2015-08-29 21:18 ` [PATCH 1/1] New driver: rtl8xxxu (mac80211) Jes.Sorensen
2015-08-30 4:42 ` Larry Finger
2015-08-30 18:41 ` Jes Sorensen
2015-08-30 21:02 ` Jes Sorensen
2015-08-30 23:51 ` Larry Finger
2015-08-31 2:39 ` Jes Sorensen
2015-08-31 15:45 ` Larry Finger
2015-08-31 23:43 ` Jes Sorensen
2015-09-01 0:16 ` Larry Finger
2015-09-01 4:54 ` Jes Sorensen
2015-09-01 5:17 ` Larry Finger
2015-09-01 5:26 ` Jes Sorensen
2015-08-31 1:06 ` Joe Perches
2015-08-31 13:11 ` Jes Sorensen
2015-08-31 8:19 ` Johannes Berg
2015-08-31 14:48 ` Johannes Berg
2015-08-31 23:42 ` Jes Sorensen
2015-09-01 15:07 ` Johannes Berg
2015-09-03 1:59 ` Jes Sorensen [this message]
2015-09-03 2:39 ` Jes Sorensen
2015-09-03 10:17 ` Johannes Berg
2015-09-04 18:24 ` Jes Sorensen
2015-09-04 18:25 ` Johannes Berg
2015-09-05 4:02 ` Sujith Manoharan
2015-09-17 16:46 ` Johannes Berg
2015-10-05 18:49 ` Jes Sorensen
2015-10-05 18:56 ` Johannes Berg
2015-10-05 19:04 ` Jes Sorensen
2015-10-05 19:12 ` Johannes Berg
2015-10-05 19:19 ` Jes Sorensen
2015-10-05 19:20 ` Johannes Berg
2015-10-05 19:53 ` Jes Sorensen
2015-09-03 10:17 ` Johannes Berg
2015-09-04 17:48 ` Jes Sorensen
2015-09-04 18:02 ` Johannes Berg
2015-10-08 16:23 ` Jakub Sitnicki
2015-10-08 19:09 ` Jes Sorensen
2015-10-08 20:33 ` Stefan Lippers-Hollmann
2015-10-08 21:06 ` Jes Sorensen
2015-10-08 21:03 ` Jes Sorensen
2015-10-10 4:17 ` Taehee Yoo
2015-08-30 16:49 ` [PATCH 0/1] rtl8xxxu (mac80211) driver for rtl8188[cr]u/rtl8192cu/rtl8723au Larry Finger
2015-08-30 18:45 ` Jes Sorensen
-- strict thread matches above, loose matches on Subject: below --
2015-08-30 21:02 [PATCH v2 " Jes.Sorensen
2015-08-30 21:02 ` [PATCH 1/1] New driver: rtl8xxxu (mac80211) Jes.Sorensen
2015-09-06 14:59 ` Kalle Valo
2015-09-06 17:06 ` Larry Finger
2015-09-07 1:41 ` Jes Sorensen
2015-09-07 1:40 ` Jes Sorensen
2015-09-07 13:20 ` Kalle Valo
2015-09-07 21:08 ` Jes Sorensen
2015-10-15 0:44 [PATCH v3 0/1] rtl8xxxu (mac80211) driver for rtl8188[cr]u/rtl8192cu/rtl8723au Jes.Sorensen
2015-10-15 0:44 ` [PATCH 1/1] New driver: rtl8xxxu (mac80211) Jes.Sorensen
2015-10-15 12:09 ` Bruno Randolf
2015-10-15 12:16 ` Jes Sorensen
2015-10-23 13:07 Xose Vazquez Perez
2015-10-23 14:00 ` Jes Sorensen
2015-10-23 16:09 ` Jes Sorensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wrfj4mjcqn3x.fsf@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=Larry.Finger@lwfinger.net \
--cc=johannes@sipsolutions.net \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).