]> err.no Git - linux-2.6/commitdiff
Updated ipw2200 to use the new ieee80211 callbacks
authorJames Ketrenos <jketreno@linux.intel.com>
Fri, 19 Aug 2005 18:18:55 +0000 (13:18 -0500)
committerJames Ketrenos <jketreno@linux.intel.com>
Mon, 7 Nov 2005 23:51:06 +0000 (17:51 -0600)
(handle_probe_response, handle_beacon, handle_association_response).

Fixed a problem with ipw_send_cmd() returning non-zero on success.

Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
drivers/net/wireless/ipw2200.c

index 40759e5f3cc59c80f618502e6352d79714de8be5..53a6bb2dbd4c687d1edd4813aff46333e32d733e 100644 (file)
@@ -1925,7 +1925,8 @@ static int ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
                        goto exit;
                }
                spin_unlock_irqrestore(&priv->lock, flags);
-       }
+       } else
+               rc = 0;
 
        if (priv->status & STATUS_RF_KILL_HW) {
                IPW_ERROR("Failed to send %s: Aborted due to RF kill switch.\n",
@@ -7011,9 +7012,9 @@ u8 ipw_qos_current_mode(struct ipw_priv * priv)
 /*
 * Handle management frame beacon and probe response
 */
-static int ipw_qos_handle_probe_reponse(struct ipw_priv *priv,
-                                       int active_network,
-                                       struct ieee80211_network *network)
+static int ipw_qos_handle_probe_response(struct ipw_priv *priv,
+                                        int active_network,
+                                        struct ieee80211_network *network)
 {
        u32 size = sizeof(struct ieee80211_qos_parameters);
 
@@ -7407,35 +7408,41 @@ static void ipw_bg_qos_activate(void *data)
        up(&priv->sem);
 }
 
-/*
-* Handler for probe responce and beacon frame
-*/
-static int ipw_handle_management(struct net_device *dev,
-                                struct ieee80211_network *network, u16 type)
+static int ipw_handle_probe_response(struct net_device *dev,
+                                    struct ieee80211_probe_response *resp,
+                                    struct ieee80211_network *network)
 {
        struct ipw_priv *priv = ieee80211_priv(dev);
-       int active_network;
+       int active_network = ((priv->status & STATUS_ASSOCIATED) &&
+                             (network == priv->assoc_network));
 
-       if (priv->status & STATUS_ASSOCIATED && network == priv->assoc_network)
-               active_network = 1;
-       else
-               active_network = 0;
+       ipw_qos_handle_probe_response(priv, active_network, network);
 
-       switch (type) {
-       case IEEE80211_STYPE_PROBE_RESP:
-       case IEEE80211_STYPE_BEACON:
-               ipw_qos_handle_probe_reponse(priv, active_network, network);
-               break;
-       case IEEE80211_STYPE_ASSOC_RESP:
-               ipw_qos_association_resp(priv, network);
-               break;
-       default:
-               break;
-       }
+       return 0;
+}
+
+static int ipw_handle_beacon(struct net_device *dev,
+                            struct ieee80211_beacon *resp,
+                            struct ieee80211_network *network)
+{
+       struct ipw_priv *priv = ieee80211_priv(dev);
+       int active_network = ((priv->status & STATUS_ASSOCIATED) &&
+                             (network == priv->assoc_network));
+
+       ipw_qos_handle_probe_response(priv, active_network, network);
 
        return 0;
 }
 
+static int ipw_handle_assoc_response(struct net_device *dev,
+                                    struct ieee80211_assoc_response *resp,
+                                    struct ieee80211_network *network)
+{
+       struct ipw_priv *priv = ieee80211_priv(dev);
+       ipw_qos_association_resp(priv, network);
+       return 0;
+}
+
 static int ipw_send_qos_params_command(struct ipw_priv *priv, struct ieee80211_qos_parameters
                                       *qos_param)
 {
@@ -11260,7 +11267,9 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        priv->ieee->is_queue_full = ipw_net_is_queue_full;
 
 #ifdef CONFIG_IPW_QOS
-       priv->ieee->handle_management = ipw_handle_management;
+       priv->ieee->handle_probe_response = ipw_handle_beacon;
+       priv->ieee->handle_beacon = ipw_handle_probe_response;
+       priv->ieee->handle_assoc_response = ipw_handle_assoc_response;
 #endif                         /* CONFIG_IPW_QOS */
 
        priv->ieee->perfect_rssi = -20;