Skip to contentSkip to conversation

Add iwlwifi wireless drivers

PATCH Superseded Zhu Yi 6 participants 20 messages Sep 4, 2007 – Oct 1, 2007

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Zhu Yi

author
#0 lore raw

PATCH v3 1/1 Add iwlwifi wireless drivers

Hi,

This is the third version of the patch (against 2.6.23-rc4) adds the mac80211 based wireless drivers for the Intel PRO/Wireless 3945ABG/BG Network Connection and Intel Wireless WiFi Link AGN (4965) adapters. You can find it from:
http://intellinuxwireless.org/iwlwifi/v6-Add-iwlwifi-wireless-drivers.patch

I list the changes against the last version I submitted to the list last week in case you have reviewed the previous version and only want to see the diff. You can find the overall patch here:
http://intellinuxwireless.org/iwlwifi/iwlwifi-v5_to_v6.patch

In this version, we replace the "comiple iwl-base.c twice for two drivers" scheme with separating the two drivers into two code base. In the future, we will abstract a common layer for all the iwl based drivers and make it a separate module for better maintenance.

Note, the #include "../net/mac80211/ieee80211_rate.h" still existed in this version of the driver. We are discussing how to abstract the mac80211 rate scaling interface in another thread in this ML.

Adrian Bunk (1):
iwl-base.c bugfixes

Ben Cahill (3):
iwlwifi: unify definitions (3945/4965) of struct
iwl_txpowertable_cmd
iwlwifi: remove unused definitions in iwl-4965-hw.h
iwlwifi: move 4965 Rx API stuff into iwl-commands.h

Mohamed Abbas (2):
iwlwifi: fix assert when calling LinkQuality command
iwlwifi: fix aggregation tx status

Tomas Winkler (14):
iwlwifi: kill legacy fields from iwl_cmd_meta
iwlwifi: kill __iwl_send_cmd
iwlwifi: add file iwl-prph.h
iwlwifi: CSR registers cleanup
iwlwifi: add Makefile sparse target
iwlwifi: iwl_mac_conf_tx remove casting to restricted
iwlwifi: setting RAxTID endianity fix
iwlwifi: AP setup qos and tx_conf bug fix
iwlwifi: move defines from iwl-4965.c to iwl-commands.h
iwlwifi: remove unnecessary condition check
iwlwifi: fixing LQ command changes in AP mode
iwlwifi: FAT channel bug fix for zero relevant bits
iwlwifi: Control channel fix for FAT channel
iwlwifi: move APMG registers to Periphery section

Zhu Yi (4):
iwlwifi: make "ipw going down" debug message depends on
IWL_DL_INFO
iwlwifi: fix IBSS connection problem caused by LinkQuality cmd
change
iwlwifi: Update version iwl-base.c stamp to 0.1.14
iwlwifi: move macros defines from *.c to *.h

ian (1):
avoid kernel oops in monitor mode with debug enabled

#1 lore raw
Quoted 3 lines · Zhu Yi

Note, the #include "../net/mac80211/ieee80211_rate.h" still existed in this version of the driver. We are discussing how to abstract the mac80211 rate scaling interface in another thread in this ML.

You also haven't addressed any of the other points I raised wrt. encryption [please try running your driver on the latest mac80211/net-2.6.24 tree, it'll complain very loudly], looking into frames, using the configured MAC address instead of the programmed one, oopsing if pure monitor mode is requested, doing frame aggregation and all the others.

I think this repost is mostly useless for review, I applaud that you're working on things but don't see why we'd be interested in this step.

johannes

author
#2 lore raw
Quoted 11 lines · Johannes Berg
Quoted 3 lines · Zhu Yi

Note, the #include "../net/mac80211/ieee80211_rate.h" still existed in this version of the driver. We are discussing how to abstract the mac80211 rate scaling interface in another thread in this ML.

You also haven't addressed any of the other points I raised wrt. encryption [please try running your driver on the latest mac80211/net-2.6.24 tree, it'll complain very loudly], looking into frames, using the configured MAC address instead of the programmed one, oopsing if pure monitor mode is requested,

Do you mean this?

Quoted 2 lines

ian (1):
avoid kernel oops in monitor mode with debug enabled

For your other comments, I agree they are valid and we will address them. But I don't think any of them are a block issue for .24, right? The driver works well for most users, I think we can push it into mainline for better testing and fix them slowly (keep stability) by .25 time.

Thanks,
-yi

#3 lore raw
Quoted 2 lines · Zhu Yi

For your other comments, I agree they are valid and we will address them. But I don't think any of them are a block issue for .24, right?

Actually, at least the crypto thing is an issue for you: it'll be a support nightmare. Please do what I've been saying in every second mail
now: run this driver against the mac80211 in net-2.6.24. It *will* trigger a WARN_ON() in the key handling code.

johannes

author
#4 lore raw
Quoted 3 lines · Johannes Berg

I've been saying in every second mail
now: run this driver against the mac80211 in net-2.6.24. It *will* trigger a WARN_ON() in the key handling code.

Where is the WARN_ON? I ran the iwl4965 driver with net-2.6.24 commit-id 3259203776dc4c3f99b9fe3b303e3e76b13f934d, tried WEP, CCMP, no problem, no WARN_ON.

Since the mac80211 in net-2.6.24 has some structure change, I modified the iwlwifi a little bit. You can find the iwlwifi driver for davem's net-2.6.24 from:
http://intellinuxwireless.org/iwlwifi/v6-iwlwifi-net-2.6.24.patch

Thanks,
-yi

#5 lore raw
Quoted 3 lines · Zhu Yi

Where is the WARN_ON? I ran the iwl4965 driver with net-2.6.24 commit-id 3259203776dc4c3f99b9fe3b303e3e76b13f934d, tried WEP, CCMP, no problem, no WARN_ON.

Huh, ok, I looked again, it seems I changed the WARN_ON later to be less severe, but there's this code in key.c:

        ret = key->local->ops->set_key(local_to_hw(key->local), DISABLE_KEY,
                                       key->sdata->dev->dev_addr, addr,
                                       &key->conf);

        if (ret)
                printk(KERN_ERR "mac80211-%s: failed to remove key "
                       "(%d, " MAC_FMT ") from hardware (%d)\n",
                       wiphy_name(key->local->hw.wiphy),
                       key->conf.keyidx, MAC_ARG(addr), ret);

which as far as I can tell will trigger with iwlwifi when a key is removed from the hardware acceleration. Maybe my iwlwifi is not new enough though.

Quoted 4 lines

Since the mac80211 in net-2.6.24 has some structure change, I modified the iwlwifi a little bit. You can find the iwlwifi driver for davem's net-2.6.24 from:
http://intellinuxwireless.org/iwlwifi/v6-iwlwifi-net-2.6.24.patch

Thanks. Since wireless-dev is mostly equivalent, can you post patches against that? I know it's suboptimal to be essentially maintaining two drivers..

johannes

#6 lore raw
In reply to Zhu Yi
Quoted 4 lines · Zhu Yi

In this version, we replace the "comiple iwl-base.c twice for two drivers" scheme with separating the two drivers into two code base. In the future, we will abstract a common layer for all the iwl based drivers and make it a separate module for better maintenance.

Nice. But please also get rid of the Makefile hacks added for this now that they're not required anymore.

#7 lore raw
In reply to Zhu Yi

Some more things.

+ case IEEE80211_FTYPE_DATA:
+ if (unlikely(is_duplicate_packet(priv, header)))
+ IWL_DEBUG_DROP("Dropping (dup): " MAC_FMT ", "

+				       MAC_FMT ", " MAC_FMT "\n",
+				       MAC_ARG(header->addr1),
+				       MAC_ARG(header->addr2),
+				       MAC_ARG(header->addr3));

mac80211 does duplicate detection.

+ if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
+ if (iwl_param_hwcrypto)
+ iwl_set_decrypted_flag(priv, rxb->skb,
+ ampdu_status, stats);
+ iwl_handle_data_packet_monitor(priv, rxb, hdr, len, stats, 0);
+ return;
+ }

why handle monitor mode differently? mac80211 does all that for you.

How much does the hardware do when you're in AP mode and have stations in PS mode? You seem to do some things but it's not clear why.

+ /* FIXME: not sure why this doesn't work in AP mode */
+ if (priv->iw_mode != IEEE80211_IF_TYPE_AP)
+ iwl_sequence_reset(priv);

Now, I'd understand that in a reverse engineered driver....

+static int iwl_mac_stop(struct ieee80211_hw *hw)
+{
+ struct iwl_priv *priv = hw->priv;
+
+ IWL_DEBUG_MAC80211("enter\n");
+ priv->is_open = 0;
+ /*netif_stop_queue(dev); */

eh? dead code in comments isn't nice especially if it's wrong.

+ if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
+ IWL_DEBUG_MAC80211("leave - monitor\n");
+ return -1;
+ }

Andy will hate you for that. And I see no point.

+ if (priv->interface_id) {
+ IWL_DEBUG_MAC80211("leave - interface_id != 0\n");
+ return 0;
+ }

I don't think you should return 0 for an error case, when userspace tries to add multiple you just accept them?

+ * We ignore conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME since it seems to
+ * be set inappropriately and the driver currently sets the hardware up to
+ * use it whenever needed.

would be nice to figure out if there is a bug and then fix it. I haven't noticed one.

+ /* TODO: Figure out how to get ieee80211_local->sta_scanning w/ only
+ * what is exposed through include/ declrations */
+ if (unlikely(!iwl_param_disable_hw_scan &&
+ test_bit(STATUS_SCANNING, &priv->status))) {
+ IWL_DEBUG_MAC80211("leave - scanning\n");
+ mutex_unlock(&priv->mutex);
+ return 0;
+ }

Uh huh? Is that more workarounds for the hardware scanning?

+ iwl_set_rxon_hwcrypto(priv, 1);
+ iwl_commit_rxon(priv);
+ key->flags &= ~IEEE80211_KEY_FORCE_SW_ENCRYPT;
+ key->hw_key_idx = sta_id;
+ IWL_DEBUG_MAC80211("set_key success, using hwcrypto\n");

Since you're not going to be able to push the driver into .23 and .24 will include mac80211 updates, how about making it compile with those updates? Hint: take patches from wireless-dev.

+ * The following adds a new attribute to the sysfs representation
+ * of this device driver (i.e. a new file in /sys/bus/pci/drivers/ipw/)
+ * used for controlling the debug level.
+ *
+ * See the level definitions in ipw for details.

That interface should likely live in debugfs.

+static ssize_t show_rf_kill(struct device *d,
+ struct device_attribute *attr, char *buf)
+{
+ /*
+ * 0 - RF kill not enabled
+ * 1 - SW based RF kill active (sysfs)
+ * 2 - HW based RF kill active
+ * 3 - Both HW and SW based RF kill active

that as well, along with all the other sysfs bits. Also, how about using the generic rfkill infrastructure Ivo did?

+ /* The following it a temporary work around due to the
+ * suspend / resume not fully initializing the NIC correctly.

"temporary" until when?

+ if (unlikely(!network_packet))
+ IWL_DEBUG_DROP("Dropping (non network): "

+				       MAC_FMT ", " MAC_FMT ", "
+				       MAC_FMT "\n",
+				       MAC_ARG(header->addr1),
+				       MAC_ARG(header->addr2),
+				       MAC_ARG(header->addr3));

Andy will hate that as well. I wonder if his stuff actually works?

Uh. Enough for now.

johannes

#8 lore raw
Quoted 14 lines

Uh huh? Is that more workarounds for the hardware scanning?

(quoted diff) +5 -0
+               iwl_set_rxon_hwcrypto(priv, 1);
+               iwl_commit_rxon(priv);
+               key->flags &= ~IEEE80211_KEY_FORCE_SW_ENCRYPT;
+               key->hw_key_idx = sta_id;
+               IWL_DEBUG_MAC80211("set_key success, using hwcrypto\n");

Since you're not going to be able to push the driver into .23 and .24 will include mac80211 updates, how about making it compile with those updates? Hint: take patches from wireless-dev.

Quoted 9 lines

+ * The following adds a new attribute to the sysfs representation
+ * of this device driver (i.e. a new file in /sys/bus/pci/drivers/ipw/)
+ * used for controlling the debug level.
+ *
+ * See the level definitions in ipw for details.

That interface should likely live in debugfs.

On the way as well

Quoted 6 lines

Uh. Enough for now.

johannes

#9 lore raw
In reply to Zhu Yi

I was just looking through the iwlwifi sources to find out whether it can encrypt with a key even if the packet isn't unicast... Anybody know? I myself removed the ability to upload multicast/broadcast keys because it was so unclear, but it seems that maybe the firmware knows about some sort of "virtual broadcast/multicast" station? How about multiple broadcast keys for APs with VLANs?

In any case, I found this comment:

/* XXX: ACK flag must be set for CCMP even if it
* is a multicast/broadcast packet, because CCMP
* group communication encrypted by GTK is
* actually done by the AP. */
cmd->cmd.tx.tx_flags |= TX_CMD_FLG_ACK_MSK;

and it doesn't make any sense at all. Care to explain? If we're a station associated to some other AP, then mac80211 will *obviously* set the "expect ack" bit on a "multicast data" packet that's being sent since it's actually unicast in 802.11 terms to the AP before it resends it using the group key... And if we're an AP, this is plain wrong (pending a positive answer to the question whether iwlwifi can offload broadcast/multicast encryption...) I suggest you remove the comment and the tx flags manipulation.

The same comment is present in the #if 0'ed TKIP code and still talks about CCMP. Please!

And all the crypto code does:

                cmd->cmd.tx.hdr[0].frame_control |=
                    cpu_to_le16(IEEE80211_FCTL_PROTECTED);

This is a no-op. Remove it. And while I'm at it, let me say this once
more: Do *NOT* work around the 802.11 implementation in mac80211 in the driver. Fix bugs where there are any, and otherwise don't do work mac80211 has done before.

And then I see things like

                cmd->cmd.tx.sec_ctl = 1 |       /* WEP */
                    (ctl->key_idx & 0x3) << 6;

Please use proper constants for the shifts and masks like everybody else. Can't be too hard can it?

Generally, the driver needs *LOTS* more comments. While hacking on mac80211 it is sometimes important to know what the hardware can handle, and I'm unable to answer my initial question using the iwlwifi code. We know a lot more about all the chipsets we've reverse engineered and are able to judge their capabilities MUCH better than we'll ever be able to by looking at the iwlwifi code :(

I can only guess this is intentional. While I applaud Intel's efforts in wireless especially in the light of how some other vendors behave, this is suboptimal and basically requires reverse engineering too to figure out how things work.

Oh don't get me wrong. There are some comments explaining how things work, for example the one about DMA queues. Except that it's not even correct:

* The four transmit queues allow for performing quality of service (qos)
* transmissions as per the 802.11 protocol. Currently Linux does not
* provide a mechanism to the user for utilizing prioritized queues, so
* we only utilize the first data transmit queue (queue1).

No? Why do we have an 802.11 qdisc then and all that stuff?

Further comments below while I'm at it.

* mac80211 should also be examined to determine if sta_info is duplicating
* the functionality provided here

absolutely. It also needs a good description of how the firmware manages stations. And is this for AP case or just for remote APs?

In fact, come to think of it, the only thing it does to the hardware is iwl_send_add_station so what you really want is a notification from mac80211 when a sta_info is added/removed. And for that you build a huge amount of station management code into the driver? That all needs to go and new features like HT must be folded into mac80211 instead.

* NOTE: This initializes the table for a single retry per data rate
* which is not optimal. Setting up an intelligent retry per rate
* requires feedback from transmission, which isn't exposed through
* rc80211_simple which is what this driver is currently using.

cute. No comment really, speaks for itself.

iwl_is_fat_tx_allowed and similar stuff needs to be in mac80211.

static struct ieee80211_ops iwl_hw_ops = {
        .ht_tx_agg_start = iwl_mac_ht_tx_agg_start,
        .ht_tx_agg_stop = iwl_mac_ht_tx_agg_stop,
        .ht_rx_agg_start = iwl_mac_ht_rx_agg_start,
        .ht_rx_agg_stop = iwl_mac_ht_rx_agg_stop,

That doesn't seem to be in my mac80211? Did you actually start implementing HT features in mac80211? Why are they not available? Why clutter the driver with #idef CONFIG_..._HT_AGG when that cannot possibly be defined?

        /* Hard coded to start at the highest retry fallback position
         * until the 4965 specific rate control algorithm is tied in */
        tx->initial_rate_index = LINK_QUAL_MAX_RETRY_NUM - 1;

        /* Alternate between antenna A and B for successive frames */
        if (priv->use_ant_b_for_management_frame) {
                priv->use_ant_b_for_management_frame = 0;
                rate_flags = RATE_MCS_ANT_B_MSK;
        } else {
                priv->use_ant_b_for_management_frame = 1;
                rate_flags = RATE_MCS_ANT_A_MSK;
        }

Again, you were telling us that you absolutely need the rate control algorithm tied in with things etc., yet you're not doing it.

iwl4965_sign_extend can be implemented a lot better like such:

static inline s32 sign_extend(u32 value, u8 bits)

{
	u8 shift = 32 - bits;

	return (s32)(value << shift) >> shift;
}

Note the renamed variables.

        struct ieee80211_rx_status stats = {
                .mactime = le32_to_cpu(rx_start->beacon_time_stamp),

That beacon_time_start variable looks rather misnamed. Or it shouldn't be used here.

Enough for now again. I suggest when you run into problems like the rate control algorithm not working well or HT mode missing, you start by describing the hardware functionality and the resulting software problem to linux-wireless so we can give advice on how to best implement things, instead of stuffing tons of code into the driver and then pushing it out as "hey this works can it be merged?"

Thanks,
johannes

author
#10 lore raw
Quoted 2 lines · Johannes Berg

I was just looking through the iwlwifi sources to find out whether it can encrypt with a key even if the packet isn't unicast... Anybody kn=

ow?

Quoted 1 line

I myself removed the ability to upload multicast/broadcast keys becau=

se

Quoted 1 line

it was so unclear, but it seems that maybe the firmware knows about s=

ome

Quoted 5 lines

sort of "virtual broadcast/multicast" station? How about multiple broadcast keys for APs with VLANs?
=20
In any case, I found this comment:
=20

Quoted 8 lines

/* XXX: ACK flag must be set for CCMP even if it
* is a multicast/broadcast packet, because CCMP
* group communication encrypted by GTK is
* actually done by the AP. */
cmd->cmd.tx.tx_flags |=3D TX_CMD_FLG_ACK_MSK;
=20
and it doesn't make any sense at all. Care to explain? If we're a station associated to some other AP, then mac80211 will *obviously* s=

et

Quoted 2 lines

the "expect ack" bit on a "multicast data" packet that's being sent since it's actually unicast in 802.11 terms to the AP before it resen=

ds

Quoted 1 line

it using the group key...=20

This is what exactly the above comment tells you. The comment speaks fo= r
the non-AP STA mode (the AP code was not there at that time). The tx_flags is used by the firmware, so whatever mac80211 set its flag, it has to be translated to the firmware's language -- because you are usin= g
hardware crypto.

Quoted 2 lines

And if we're an AP, this is plain wrong
(pending a positive answer to the question whether iwlwifi can offloa=

d

Quoted 1 line

broadcast/multicast encryption...) I suggest you remove the comment a=

nd

Quoted 1 line

the tx flags manipulation.

The comment is not for AP mode.

Quoted 2 lines

The same comment is present in the #if 0'ed TKIP code and still talks about CCMP. Please!

iwlwifi hardware/firmware only supports partial TKIP (ie. it can do [en= |
de]crypt, but cannot build michael_mic), so we comment out the TKIP hwcrypto code temporarily at this time. I agree the comment should run = a
's/CCMP/TKIP/g' though.

Quoted 7 lines

And all the crypto code does:
=20

                cmd->cmd.tx.hdr[0].frame_control |=3D
                    cpu_to_le16(IEEE80211_FCTL_PROTECTED);

=20
This is a no-op. Remove it. And while I'm at it, let me say this once
more: Do *NOT* work around the 802.11 implementation in mac80211 in t=

he

Quoted 2 lines

driver. Fix bugs where there are any, and otherwise don't do work mac80211 has done before.

It might be removed, but let me do some test (especially for EAP packets) first.

Quoted 6 lines

And then I see things like

                cmd->cmd.tx.sec_ctl =3D 1 |       /* WEP */
                    (ctl->key_idx & 0x3) << 6;

=20
Please use proper constants for the shifts and masks like everybody else. Can't be too hard can it?

OK.

Quoted 2 lines

Generally, the driver needs *LOTS* more comments. While hacking on mac80211 it is sometimes important to know what the hardware can hand=

le,

Quoted 1 line

and I'm unable to answer my initial question using the iwlwifi code. =

We

Quoted 1 line

know a lot more about all the chipsets we've reverse engineered and a=

re

Quoted 1 line

able to judge their capabilities MUCH better than we'll ever be able =

to

Quoted 1 line

by looking at the iwlwifi code :(

It is obviously clear, both in the comment and the code: when you get a GTK, you have already got a PTK anyway. In the non-AP STA mode, you encypt your packets with PTK (whatever for unicast, broadcast), the AP receives it and rencrypts them with GTK. Your GTK is used to decrypt fo= r
multicast, broadcast packets.

Quoted 1 line

I can only guess this is intentional. While I applaud Intel's efforts=

in

Quoted 1 line

wireless especially in the light of how some other vendors behave, th=

is

Quoted 1 line

is suboptimal and basically requires reverse engineering too to figur=

e

Quoted 1 line

out how things work.

Intentional for what? When you are not able to follow a piece of code, you think the author intentional mislead you, instead of blaming your own capability? Arrogant!

Quoted 5 lines

Oh don't get me wrong. There are some comments explaining how things work, for example the one about DMA queues. Except that it's not even correct:
=20
* The four transmit queues allow for performing quality of service (=

qos)

Quoted 1 line

* transmissions as per the 802.11 protocol. Currently Linux does no=

t

Quoted 1 line

* provide a mechanism to the user for utilizing prioritized queues, =

so

Quoted 3 lines

* we only utilize the first data transmit queue (queue1).
=20
No? Why do we have an 802.11 qdisc then and all that stuff?

iwlwifi _does_ honor the ieee80211_tx_control->queue field, I'll delete the old comment. BTW=A3=AC the whole 802.11 qdisc hack will be removed = with
the multiqueue supported in .24. =20

Quoted 3 lines

Further comments below while I'm at it.
=20
* mac80211 should also be examined to determine if sta_info is dupli=

cating

Quoted 3 lines

* the functionality provided here
=20
absolutely. It also needs a good description of how the firmware mana=

ges

Quoted 3 lines

stations. And is this for AP case or just for remote APs? =20
In fact, come to think of it, the only thing it does to the hardware =

is

Quoted 2 lines

iwl_send_add_station so what you really want is a notification from mac80211 when a sta_info is added/removed. And for that you build a h=

uge

Quoted 1 line

amount of station management code into the driver? That all needs to =

go

Quoted 16 lines

and new features like HT must be folded into mac80211 instead. =20
* NOTE: This initializes the table for a single retry per data rate
* which is not optimal. Setting up an intelligent retry per rate =20
* requires feedback from transmission, which isn't exposed through=20
* rc80211_simple which is what this driver is currently using.
=20
cute. No comment really, speaks for itself.
=20
iwl_is_fat_tx_allowed and similar stuff needs to be in mac80211. =20

static struct ieee80211_ops iwl_hw_ops =3D {
        .ht_tx_agg_start =3D iwl_mac_ht_tx_agg_start,
        .ht_tx_agg_stop =3D iwl_mac_ht_tx_agg_stop,
        .ht_rx_agg_start =3D iwl_mac_ht_rx_agg_start,
        .ht_rx_agg_stop =3D iwl_mac_ht_rx_agg_stop,
Quoted 5 lines

=20
That doesn't seem to be in my mac80211? Did you actually start implementing HT features in mac80211? Why are they not available? Why clutter the driver with #idef CONFIG_..._HT_AGG when that cannot possibly be defined?

We have the HT AGG support in our mac80211. Will submit the patch for review when we are ready.

Quoted 2 lines

/* Hard coded to start at the highest retry fallback position
* until the 4965 specific rate control algorithm is tied in =

*/

Quoted 10 lines
        tx->initial_rate_index =3D LINK_QUAL_MAX_RETRY_NUM - 1;
=20
        /* Alternate between antenna A and B for successive frames */
        if (priv->use_ant_b_for_management_frame) {
                priv->use_ant_b_for_management_frame =3D 0;
                rate_flags =3D RATE_MCS_ANT_B_MSK;
        } else {
                priv->use_ant_b_for_management_frame =3D 1;
                rate_flags =3D RATE_MCS_ANT_A_MSK;
        }
Quoted 3 lines

=20
Again, you were telling us that you absolutely need the rate control algorithm tied in with things etc., yet you're not doing it.

I have sent a proposal to reorganize the header files so that we can export a rate scale interface to the drivers. It is not perfect but it works. Then we don't like it here and there. If you have a better idea, why don't you speak it out?

Quoted 8 lines

iwl4965_sign_extend can be implemented a lot better like such:
=20
static inline s32 sign_extend(u32 value, u8 bits)

{
	u8 shift =3D 32 - bits;
=20
	return (s32)(value << shift) >> shift;
}

Really? Are you sure this work?

Quoted 4 lines

Note the renamed variables.
=20

        struct ieee80211_rx_status stats =3D {
                .mactime =3D le32_to_cpu(rx_start->beacon_time_stamp)=

,

Quoted 2 lines

=20
That beacon_time_start variable looks rather misnamed. Or it shouldn'=

t

Quoted 1 line

be used here.

OK. I assuem you mentioned the beacon_time_stamp, it should be ->timestamp.

Quoted 1 line

Enough for now again.=20

Please don't. We have given you enough time for commenting the code. Please do it in a batch like other people did. Don't squeeze a little i= n
-rc2 and another little in -rc4, ... You are wasting people's time.

Quoted 3 lines

I suggest when you run into problems like the rate
control algorithm not working well or HT mode missing, you start by describing the hardware functionality and the resulting software prob=

lem

Quoted 1 line

to linux-wireless so we can give advice on how to best implement thin=

gs,

Quoted 1 line

instead of stuffing tons of code into the driver and then pushing it =

out

James had done this several months ago. We did everything the mac80211 people suggested, but the patch is still not merged. Do you think we'd really like to workaound the mac80211 issues in the driver, or even hav= e
our own mac80211 package? Absolutely not, if you mac80211 guys are easy to work with. Without creating our own mac80211 package, today, the users are still no better rate scale algorithm selection, no advanced wireless QoS, no 11N support, not even mention about link aggregation.

Quoted 1 line

as "hey this works can it be merged?"

Something working is always better than something not working whatever how beautiful the code looks like. And I believe the current iwlwifi driver has reached the quality to be merged mainline (both it looks and it works).

Thanks,
-yi
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw
Quoted 12 lines · Zhu Yi
Quoted 11 lines

/* XXX: ACK flag must be set for CCMP even if it
* is a multicast/broadcast packet, because CCMP
* group communication encrypted by GTK is
* actually done by the AP. */
cmd->cmd.tx.tx_flags |= TX_CMD_FLG_ACK_MSK;

and it doesn't make any sense at all. Care to explain? If we're a station associated to some other AP, then mac80211 will *obviously* set the "expect ack" bit on a "multicast data" packet that's being sent since it's actually unicast in 802.11 terms to the AP before it resends it using the group key...

Quoted 5 lines

This is what exactly the above comment tells you. The comment speaks for the non-AP STA mode (the AP code was not there at that time). The tx_flags is used by the firmware, so whatever mac80211 set its flag, it has to be translated to the firmware's language -- because you are using hardware crypto.

But you need to have another place where this flag is set based on the equivalent mac80211 flag, so this is not necessary.

Quoted 2 lines

BTW, the whole 802.11 qdisc hack will be removed with the multiqueue supported in .24.

Yeah, is anybody working on that? I have to admit I didn't look into that yet.

Quoted 2 lines

We have the HT AGG support in our mac80211. Will submit the patch for review when we are ready.

Yeah I gathered that much from what Tomas said, but why do you keep pushing for including this driver when you know it's not the right thing to do?

Quoted 10 lines
Quoted 8 lines

iwl4965_sign_extend can be implemented a lot better like such:

static inline s32 sign_extend(u32 value, u8 bits)

{
	u8 shift = 32 - bits;

	return (s32)(value << shift) >> shift;
}

Really? Are you sure this work?

Hmm? Of course, shift it up and then do a signed shift down.

Quoted 5 lines
Quoted 1 line

Enough for now again.

Please don't. We have given you enough time for commenting the code. Please do it in a batch like other people did. Don't squeeze a little in -rc2 and another little in -rc4, ... You are wasting people's time.

I just don't have enough time/energy to read through all this at once.

Quoted 7 lines

James had done this several months ago. We did everything the mac80211 people suggested, but the patch is still not merged. Do you think we'd really like to workaound the mac80211 issues in the driver, or even have our own mac80211 package? Absolutely not, if you mac80211 guys are easy to work with. Without creating our own mac80211 package, today, the users are still no better rate scale algorithm selection, no advanced wireless QoS, no 11N support, not even mention about link aggregation.

You still haven't fixed the issues we pointed out in the 11N deaggregation code. And maybe we missed some things too. Also, I personally only recently started working on mac80211 and Jiri seems to have vanished completely.

Quoted 4 lines

Something working is always better than something not working whatever how beautiful the code looks like. And I believe the current iwlwifi driver has reached the quality to be merged mainline (both it looks and it works).

Well, I disagree. I see no incentive for you to help improving mac80211 when we have a driver with lots of stuff that works around mac80211.

In any case, let's get back to more productive things. I apologise for anything I might have said that offended you, I didn't mean to. All the code that superficially looks like workarounds around mac80211 stuff made me not like the code and I suppose that showed.

Can you post patches against the iwlwifi currently included in wireless-dev? Currently, it seems that I have to either dig in your repository or through your patches to figure out the current state of things I commented on, which is suboptimal because I don't even get to see the fixes to things I pointed out. I'd like to have iwlwifi in wireless-dev be essentially the same as is merged into mainline, modulo the bits that depend on things like HT deaggregation that are not in mainline yet.

Incidentally, I currently have just about as much a hard time getting things changed in mac80211 as you do because nobody wants to review that code. Hence, it would even help if you could review the patches I posted and maybe look if that is easy/possible to support with iwlwifi and possibly even adapt iwlwifi and test so that John feels more confident in merging patches. Conversely, I promise I'll review and test any patches you make to mac80211 as time permits.

johannes

author
#12 lore raw
Quoted 1 line · Johannes Berg

But you need to have another place where this flag is set based on th=

e

Quoted 1 line

equivalent mac80211 flag, so this is not necessary.

OK. Will use mac80211's indication if mac80211 already takes care about the "trick".

Quoted 5 lines
Quoted 2 lines

BTW=A3=AC the whole 802.11 qdisc hack will be removed with the multiqueue supported in .24. =20

=20
Yeah, is anybody working on that? I have to admit I didn't look into that yet.

If nobody will work on that, we Intel will do. I remembered Tomas promised John in this OLS ;)

Quoted 1 line
Quoted 1 line

We have the HT AGG support in our mac80211. Will submit the patch f=

or

Quoted 4 lines
Quoted 1 line

review when we are ready.

=20
Yeah I gathered that much from what Tomas said, but why do you keep pushing for including this driver when you know it's not the right th=

ing

Quoted 10 lines

to do?
=20

Quoted 8 lines
Quoted 8 lines

iwl4965_sign_extend can be implemented a lot better like such:
=20
static inline s32 sign_extend(u32 value, u8 bits)

{
	u8 shift =3D 32 - bits;
=20
	return (s32)(value << shift) >> shift;
}
Quoted 4 lines
Quoted 2 lines

=20
Really? Are you sure this work?

=20
Hmm? Of course, shift it up and then do a signed shift down.

It should be 31, not 32 (shift =3D 31 - bits). Will use your suggestion= =2E

Quoted 3 lines

You still haven't fixed the issues we pointed out in the 11N deaggregation code. And maybe we missed some things too. Also, I personally only recently started working on mac80211 and Jiri seems t=

o

Quoted 1 line

have vanished completely.

OK. Let me remove the 11N stuff in iwlwifi for .24 and then we do another round of mac80211 11N patches submission/review later. I believ= e
you can do a better job than Jiri did.

Quoted 1 line

In any case, let's get back to more productive things. I apologise fo=

r

Quoted 1 line

anything I might have said that offended you, I didn't mean to. All t=

he

Quoted 7 lines

code that superficially looks like workarounds around mac80211 stuff made me not like the code and I suppose that showed.
=20
Can you post patches against the iwlwifi currently included in wireless-dev? Currently, it seems that I have to either dig in your repository or through your patches to figure out the current state of things I commented on, which is suboptimal because I don't even get t=

o

Quoted 2 lines

see the fixes to things I pointed out. I'd like to have iwlwifi in wireless-dev be essentially the same as is merged into mainline, modu=

lo

Quoted 2 lines

the bits that depend on things like HT deaggregation that are not in mainline yet.

I thought John would take my .24 iwlwifi patch to wireless-dev GIT directly since he just rebased the tree (at that time) and all the commits for iwlwifi were merged into one big patch. Anyway, I will repost it explicitly for wireless-dev next time: iwlwifi driver + HT features for the iwlwifi (or everything) branch; and iwlwifi driver without HT features for pending-upstream branch. We can work on iwlwifi driver to make it in .24 first and sort out HT things in .25.

Quoted 2 lines

Incidentally, I currently have just about as much a hard time getting things changed in mac80211 as you do because nobody wants to review t=

hat

Quoted 1 line

code. Hence, it would even help if you could review the patches I pos=

ted

Quoted 2 lines

and maybe look if that is easy/possible to support with iwlwifi and possibly even adapt iwlwifi and test so that John feels more confiden=

t

Quoted 2 lines

in merging patches. Conversely, I promise I'll review and test any patches you make to mac80211 as time permits.

I totally agree with you.

Thanks,
-yi
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#13 lore raw
Quoted 6 lines · Zhu Yi
Quoted 2 lines · Johannes Berg

But you need to have another place where this flag is set based on the equivalent mac80211 flag, so this is not necessary.

OK. Will use mac80211's indication if mac80211 already takes care about the "trick".

If not I'd consider it a bug. But I don't see a "trick" there anyhow. What's non-standard in this behaviour? Almost every unicast packet is expected to be acknowledged.

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

BTW, the whole 802.11 qdisc hack will be removed with the multiqueue supported in .24.

If nobody will work on that, we Intel will do. I remembered Tomas promised John in this OLS ;)

:)
Sounds good. Do you guys have contact to whoever wrote it? ISTR it came from Intel in the first place.

Quoted 1 line

It should be 31, not 32 (shift = 31 - bits). Will use your suggestion.

Huh. /me double-checks. Am I doing this bit-calculation totally wrong? I thought you had a "bits"-bit number that included the sign in the bit "bits-1" (if you number 0 through "bits-1"). Then you have to shift up by "32 - bits" so that the "bits" bits including the sign live in the upper "bits" bits of the 32-bit number, and then shift down again by the same amount to do the sign extension. I wonder if there's a good way to ask gcc to do this :)

Quoted 2 lines

OK. Let me remove the 11N stuff in iwlwifi for .24 and then we do another round of mac80211 11N patches submission/review later.

That would be much appreciated. We really also should have rate control be able to influence that generically and lots more things that have to be figured out but that are quite hard to work with when the 802.11n drafts are not available to many.

Quoted 2 lines

I believe
you can do a better job than Jiri did.

Thanks. I'm not sure I can live up to that though; for example I'll have to mostly disappear for the next 10 days or so to prepare for an exam. I'll be around, but not patching quite as much ;)

Quoted 3 lines

I thought John would take my .24 iwlwifi patch to wireless-dev GIT directly since he just rebased the tree (at that time) and all the commits for iwlwifi were merged into one big patch.

Ah ok.

Quoted 5 lines

Anyway, I will
repost it explicitly for wireless-dev next time: iwlwifi driver + HT features for the iwlwifi (or everything) branch; and iwlwifi driver without HT features for pending-upstream branch. We can work on iwlwifi driver to make it in .24 first and sort out HT things in .25.

Sounds good. I'll take another look then.

Thanks,
johannes

#14 lore raw
Quoted 15 lines · Johannes Berg
Quoted 6 lines · Zhu Yi
Quoted 2 lines · Johannes Berg

But you need to have another place where this flag is set based on the equivalent mac80211 flag, so this is not necessary.

OK. Will use mac80211's indication if mac80211 already takes care about the "trick".

If not I'd consider it a bug. But I don't see a "trick" there anyhow. What's non-standard in this behaviour? Almost every unicast packet is expected to be acknowledged.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

BTW, the whole 802.11 qdisc hack will be removed with the multiqueue supported in .24.

Quoted 7 lines
Quoted 2 lines

If nobody will work on that, we Intel will do. I remembered Tomas promised John in this OLS ;)

:)
Sounds good. Do you guys have contact to whoever wrote it? ISTR it came from Intel in the first place.

It is my best intention yet first we need native interface which make in turn problems in eb tables. So it is a long shot.

Quoted 10 lines
Quoted 1 line

It should be 31, not 32 (shift = 31 - bits). Will use your suggestion.

Huh. /me double-checks. Am I doing this bit-calculation totally wrong? I thought you had a "bits"-bit number that included the sign in the bit "bits-1" (if you number 0 through "bits-1"). Then you have to shift up by "32 - bits" so that the "bits" bits including the sign live in the upper "bits" bits of the 32-bit number, and then shift down again by the same amount to do the sign extension. I wonder if there's a good way to ask gcc to do this :)

Quoted 7 lines
Quoted 2 lines

OK. Let me remove the 11N stuff in iwlwifi for .24 and then we do another round of mac80211 11N patches submission/review later.

That would be much appreciated. We really also should have rate control be able to influence that generically and lots more things that have to be figured out but that are quite hard to work with when the 802.11n drafts are not available to many.

I wouldn't appreciate this at all. 11n is major feature of our NIC. Major obstacle in finally pushing 11n is constant code base change of iwlwifi. This is already 4th code base. The latest was because the
driver didn't look nice enough, what an engineering reason! In the
bottom line we are hunting our own tail for wrong reasons

Quoted 25 lines
Quoted 2 lines

I believe
you can do a better job than Jiri did.

Thanks. I'm not sure I can live up to that though; for example I'll have to mostly disappear for the next 10 days or so to prepare for an exam. I'll be around, but not patching quite as much ;)

Quoted 3 lines

I thought John would take my .24 iwlwifi patch to wireless-dev GIT directly since he just rebased the tree (at that time) and all the commits for iwlwifi were merged into one big patch.

Ah ok.

Quoted 5 lines

Anyway, I will
repost it explicitly for wireless-dev next time: iwlwifi driver + HT features for the iwlwifi (or everything) branch; and iwlwifi driver without HT features for pending-upstream branch. We can work on iwlwifi driver to make it in .24 first and sort out HT things in .25.

Sounds good. I'll take another look then.

Thanks,
johannes

#15 lore raw
Quoted 2 lines · Tomas Winkler

It is my best intention yet first we need native interface which make in turn problems in eb tables. So it is a long shot.

Ok. We've managed long enough without it so I guess we can wait :)

Quoted 5 lines

I wouldn't appreciate this at all. 11n is major feature of our NIC. Major obstacle in finally pushing 11n is constant code base change of iwlwifi. This is already 4th code base. The latest was because the
driver didn't look nice enough, what an engineering reason! In the
bottom line we are hunting our own tail for wrong reasons

Well, I believe that there are bad layering violations in your current driver, namely looking at the packets mac80211 sends, doing 11N manipulations and everything in the driver and duplicating the sta_info stuff because mac80211 happens to be missing a few hooks. If you think those are "wrong reasons" that's fine with me.

Personally, I'm just raising these points and marking them down as "against merging as-is". If others don't care about them, that's ok with me.

johannes

#16 lore raw
Quoted 13 lines · Johannes Berg
Quoted 2 lines · Tomas Winkler

It is my best intention yet first we need native interface which make in turn problems in eb tables. So it is a long shot.

Ok. We've managed long enough without it so I guess we can wait :)

Quoted 5 lines

I wouldn't appreciate this at all. 11n is major feature of our NIC. Major obstacle in finally pushing 11n is constant code base change of iwlwifi. This is already 4th code base. The latest was because the
driver didn't look nice enough, what an engineering reason! In the
bottom line we are hunting our own tail for wrong reasons

Quoted 5 lines

Well, I believe that there are bad layering violations in your current driver, namely looking at the packets mac80211 sends, doing 11N manipulations and everything in the driver and duplicating the sta_info stuff because mac80211 happens to be missing a few hooks. If you think those are "wrong reasons" that's fine with me.

There is no doubt that what you currently see is ugly, we reworked the code and added these few hooks the problem is that they don't apply anymore to recent code, since I'm stabilizing basic flows after each code base in the middle of development.
I know I'm not 'release often' complained but I really test the code that I'm publishing, it takes time.
I prefer to have stable driver and fix it step by step then releasing 30 patches that nobody have time to consume and review in addition it just kills the functionality. Don't know maybe I'm too old for Linux :)

Quoted 5 lines

Personally, I'm just raising these points and marking them down as "against merging as-is". If others don't care about them, that's ok with me.

After all it is functional driver. It gets ~60Mps in TCP even more.

Quoted 3 lines

johannes

#17 lore raw
Quoted 20 lines · On Tuesday 11 September 2007 19:37:40 Tomas Winkler wrote:
Quoted 13 lines · Johannes Berg
Quoted 2 lines · Tomas Winkler

It is my best intention yet first we need native interface which make in turn problems in eb tables. So it is a long shot.

Ok. We've managed long enough without it so I guess we can wait :)

Quoted 5 lines

I wouldn't appreciate this at all. 11n is major feature of our NIC. Major obstacle in finally pushing 11n is constant code base change of iwlwifi. This is already 4th code base. The latest was because the
driver didn't look nice enough, what an engineering reason! In the
bottom line we are hunting our own tail for wrong reasons

Quoted 5 lines

Well, I believe that there are bad layering violations in your current driver, namely looking at the packets mac80211 sends, doing 11N manipulations and everything in the driver and duplicating the sta_info stuff because mac80211 happens to be missing a few hooks. If you think those are "wrong reasons" that's fine with me.

Quoted 10 lines

There is no doubt that what you currently see is ugly, we reworked the code and added these few hooks the problem is that they don't apply anymore to recent code, since I'm stabilizing basic flows after each code base in the middle of development.
I know I'm not 'release often' complained but I really test the code that I'm publishing, it takes time.
I prefer to have stable driver and fix it step by step then releasing 30 patches that nobody have time to consume and review in addition it just kills the functionality. Don't know maybe I'm too old for Linux :)

Well, if you post the patches to get included into wireless-dev, people will start testing them. So they test them im parallel with you (you will do your testing of course as well).
Of course you do some basic testing before releasing the patches, such as "does it compile" or "does the card basically still work". But with this you get _more_ review and testing. That's the whole point of "release early and often".
Testing early-released patches is SMP, while testing alone is UP. ;)

Quoted 5 lines
Quoted 4 lines

Personally, I'm just raising these points and marking them down as "against merging as-is". If others don't care about them, that's ok with me.

After all it is functional driver. It gets ~60Mps in TCP even more.

Well, lots of other functional stuff was rejected, because it was simply ugly and a maintanance hell. (I'm not saying that your driver is such a thing. I didn't look at it, yet).

Signature · 1 line
Greetings Michael.
#18 lore raw

mac80211 multiqueue

In reply to Zhu Yi
Quoted 6 lines · Zhu Yi
Quoted 4 lines · Johannes Berg
Quoted 2 lines

BTW=EF=BC=8C the whole 802.11 qdisc hack will be removed with the multiqueue supported in .24. =20

=20
Yeah, is anybody working on that? I have to admit I didn't look int=

o

Quoted 4 lines
Quoted 1 line

that yet.

=20
If nobody will work on that, we Intel will do. I remembered Tomas promised John in this OLS ;)

Indeed he did...Tomas, any progress on this?

John
--=20
John W. Linville
[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#19 lore raw

Re: mac80211 multiqueue

Quoted 6 lines · John W. Linville
Quoted 5 lines · Zhu Yi
Quoted 3 lines · Johannes Berg
Quoted 2 lines

BTW, the whole 802.11 qdisc hack will be removed with the multiqueue supported in .24.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Yeah, is anybody working on that? I have to admit I didn't look into that yet.

If nobody will work on that, we Intel will do. I remembered Tomas promised John in this OLS ;)

Indeed he did...Tomas, any progress on this?

Not much, yet it's definitely on the list. This will get priority after we have proper 11n in mac80211, hope soon, as I'm getting more familiar with Johannes revolution.

I'm still wondering how multiqueue will be used effectively with stacking it between wlanX and wmasterX as native 80211 interface is far to reach.

Tomas

Quoted 9 lines

John
--
John W. Linville
[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html