Given the recent fixes required for ipw(4), I suspect that iwi(4)
has similar issues and requires the patch below to actually pass
any packets.
While here, add a missing error check in the association sequence.

Could anyone test iwi(4) without this patch to confirm that it is
broken, and again with this patch to confirm that this fixes things?

Thinkpads which may contain this device are the following, at least
according to Levono (as far as I know the 60/61 series shipped with
wpi or iwn already):
- R50, R50e, R50p, R51, R51e, R52
- R60, R60e, R61, R61e, R61i
- T40, T40p, T41, T41p, T42, T42p, T43, T43p
- T60, T60p, T61, T61p
- X31, X32, X40, X41, X41 Tablet
- X60, X60s, X60 Tablet, X61, X61s, X61 Tablet
- X300
- Z60m, Z61e, Z61m, Z61p, Z61t

diff 99d61435bea38c80c9830f1a5599f26f7b71e8ce /usr/src
blob - 8ed15f30328a703731e0ca1fd82e58f4d358019c
file + sys/dev/pci/if_iwi.c
--- sys/dev/pci/if_iwi.c
+++ sys/dev/pci/if_iwi.c
@@ -725,9 +725,13 @@ int
 iwi_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
 {
        struct iwi_softc *sc = ic->ic_softc;
+       struct ifnet *ifp = &ic->ic_if;
        enum ieee80211_state ostate;
        uint32_t tmp;
 
+       if (LINK_STATE_IS_UP(ifp->if_link_state))
+               ieee80211_set_link_state(ic, LINK_STATE_DOWN);
+
        ostate = ic->ic_state;
 
        switch (nstate) {
@@ -736,7 +740,10 @@ iwi_newstate(struct ieee80211com *ic, enum ieee80211_s
                break;
 
        case IEEE80211_S_AUTH:
-               iwi_auth_and_assoc(sc);
+               if (iwi_auth_and_assoc(sc)) {
+                       ieee80211_begin_scan(&ic->ic_if);
+                       return 0;
+               }
                break;
 
        case IEEE80211_S_RUN:
@@ -752,6 +759,14 @@ iwi_newstate(struct ieee80211com *ic, enum ieee80211_s
                /* assoc led on */
                tmp = MEM_READ_4(sc, IWI_MEM_EVENT_CTL) & IWI_LED_MASK;
                MEM_WRITE_4(sc, IWI_MEM_EVENT_CTL, tmp | IWI_LED_ASSOC);
+
+               if (!(ic->ic_flags & IEEE80211_F_RSNON)) {
+                       /*
+                        * NB: When RSN is enabled, we defer setting
+                        * the link up until the port is valid.
+                        */
+                       ieee80211_set_link_state(ic, LINK_STATE_UP);
+               }
                break;
 
        case IEEE80211_S_INIT:

Reply via email to