]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
iwlwifi: iwl5000 WiFi/WiMax coexistence
authorRon Rindjunsky <ron.rindjunsky@intel.com>
Thu, 15 May 2008 05:54:14 +0000 (13:54 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 22 May 2008 01:48:05 +0000 (21:48 -0400)
This patch adds WiFi/WiMax coexistence to iwl5000.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-commands.h

index 5e818eedb0ecff3c4d79e6b4a7c87dd84ba7d3c3..520c7eaf1b0dd7f597a54ae0cece2a393a9eafe9 100644 (file)
@@ -494,6 +494,16 @@ static void iwl5000_tx_queue_set_status(struct iwl_priv *priv,
                       scd_retry ? "BA" : "AC", txq_id, tx_fifo_id);
 }
 
+static int iwl5000_send_wimax_coex(struct iwl_priv *priv)
+{
+       struct iwl_wimax_coex_cmd coex_cmd;
+
+       memset(&coex_cmd, 0, sizeof(coex_cmd));
+
+       return iwl_send_cmd_pdu(priv, COEX_PRIORITY_TABLE_CMD,
+                               sizeof(coex_cmd), &coex_cmd);
+}
+
 static int iwl5000_alive_notify(struct iwl_priv *priv)
 {
        u32 a;
@@ -568,6 +578,8 @@ static int iwl5000_alive_notify(struct iwl_priv *priv)
        iwl_release_nic_access(priv);
        spin_unlock_irqrestore(&priv->lock, flags);
 
+       iwl5000_send_wimax_coex(priv);
+
        /* Ask for statistics now, the uCode will send notification
         * periodically after association */
        iwl_send_statistics_request(priv, CMD_ASYNC);
index dd84326c97d2b3eedc2e48c5241d19842f408526..5b9e9bf0ac8fc95198f01905a932ec163c2bb778 100644 (file)
@@ -93,6 +93,11 @@ enum {
        REPLY_LEDS_CMD = 0x48,
        REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* 4965 only */
 
+       /* WiMAX coexistence */
+       COEX_PRIORITY_TABLE_CMD = 0x5a, /*5000 only */
+       COEX_MEDIUM_NOTIFICATION = 0x5b,
+       COEX_EVENT_CMD = 0x5c,
+
        /* 802.11h related */
        RADAR_NOTIFICATION = 0x70,      /* not used */
        REPLY_QUIET_CMD = 0x71,         /* not used */
@@ -2797,6 +2802,55 @@ struct iwl4965_led_cmd {
        u8 reserved;
 } __attribute__ ((packed));
 
+/*
+ * Coexistence WIFI/WIMAX  Command
+ * COEX_PRIORITY_TABLE_CMD = 0x5a
+ *
+ */
+enum {
+       COEX_UNASSOC_IDLE               = 0,
+       COEX_UNASSOC_MANUAL_SCAN        = 1,
+       COEX_UNASSOC_AUTO_SCAN          = 2,
+       COEX_CALIBRATION                = 3,
+       COEX_PERIODIC_CALIBRATION       = 4,
+       COEX_CONNECTION_ESTAB           = 5,
+       COEX_ASSOCIATED_IDLE            = 6,
+       COEX_ASSOC_MANUAL_SCAN          = 7,
+       COEX_ASSOC_AUTO_SCAN            = 8,
+       COEX_ASSOC_ACTIVE_LEVEL         = 9,
+       COEX_RF_ON                      = 10,
+       COEX_RF_OFF                     = 11,
+       COEX_STAND_ALONE_DEBUG          = 12,
+       COEX_IPAN_ASSOC_LEVEL           = 13,
+       COEX_RSRVD1                     = 14,
+       COEX_RSRVD2                     = 15,
+       COEX_NUM_OF_EVENTS              = 16
+};
+
+struct iwl_wimax_coex_event_entry {
+       u8 request_prio;
+       u8 win_medium_prio;
+       u8 reserved;
+       u8 flags;
+} __attribute__ ((packed));
+
+/* COEX flag masks */
+
+/* Staion table is valid */
+#define COEX_FLAGS_STA_TABLE_VALID_MSK      (0x1)
+/* UnMask wakeup src at unassociated sleep */
+#define COEX_FLAGS_UNASSOC_WA_UNMASK_MSK    (0x4)
+/* UnMask wakeup src at associated sleep */
+#define COEX_FLAGS_ASSOC_WA_UNMASK_MSK      (0x8)
+/* Enable CoEx feature. */
+#define COEX_FLAGS_COEX_ENABLE_MSK          (0x80)
+
+struct iwl_wimax_coex_cmd {
+       u8 flags;
+       u8 reserved[3];
+       struct iwl_wimax_coex_event_entry sta_prio[COEX_NUM_OF_EVENTS];
+} __attribute__ ((packed));
+
 /******************************************************************************
  * (13)
  * Union of all expected notifications/responses: