• Reinette Chatre's avatar
    iwlwifi: initialize geo/channel information during probe · 849e0dce
    Reinette Chatre authored
    The geo/channel information is obtained from the EEPROM, which is read
    during probe. We can thus set up channel information at this time. This
    helps us to support ioctl commands that rely on this before the interface
    is brought up.
    
    Clearly matches _init_channel_map with _free_channel_map and _init_geos
    with _free_geos to ensure functions calling these routines can also call
    their cleanup routines.
    
    Fixes a few bugs:
    - if channel information is not available when ioctl commands are
      issued then we get a NULL pointer oops. Having channel information
      set up during probe we can deal with ioctl commands without requiring
      interface to be brought up.
      This fixes bug: http://www.bughost.org/bugzilla/show_bug.cgi?id=1552
    - Fix potential problem if user triggers probe/remove/probe sequence. The
      value of priv->channel_count was used to determine if channel map is
      set up. This value was never reset when channel map was removed.
    - Fix memory leak: priv->modes need to be freed when device removed.
    Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    849e0dce
iwl3945-base.c 246 KB