net: wireless: Update SD8897 WLAN/BT driver to 429
Marc Yang [Wed, 11 Sep 2013 00:12:19 +0000 (17:12 -0700)]
Signed-off-by: Marc Yang <yangyang@marvell.com>

Bug 1318054
Bug 1354601

Change-Id: Id7360eeddc88ad82335de842f79dd9ea81c03824
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: http://git-master/r/277114
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

73 files changed:
drivers/bluetooth/sd8897/bt/bt_drv.h
drivers/bluetooth/sd8897/bt/bt_init.c
drivers/bluetooth/sd8897/bt/bt_main.c
drivers/bluetooth/sd8897/bt/bt_proc.c
drivers/bluetooth/sd8897/bt/bt_sdiommc.c
drivers/bluetooth/sd8897/bt/mbt_char.c
drivers/bluetooth/sd8897/bt/mbt_char.h
drivers/net/wireless/sd8897/mlan/mlan.h
drivers/net/wireless/sd8897/mlan/mlan_11ac.c
drivers/net/wireless/sd8897/mlan/mlan_11ac.h
drivers/net/wireless/sd8897/mlan/mlan_11d.c
drivers/net/wireless/sd8897/mlan/mlan_11h.c
drivers/net/wireless/sd8897/mlan/mlan_11h.h
drivers/net/wireless/sd8897/mlan/mlan_11n.c
drivers/net/wireless/sd8897/mlan/mlan_11n.h
drivers/net/wireless/sd8897/mlan/mlan_11n_aggr.c
drivers/net/wireless/sd8897/mlan/mlan_11n_aggr.h
drivers/net/wireless/sd8897/mlan/mlan_11n_rxreorder.c
drivers/net/wireless/sd8897/mlan/mlan_11n_rxreorder.h
drivers/net/wireless/sd8897/mlan/mlan_cfp.c
drivers/net/wireless/sd8897/mlan/mlan_cmdevt.c
drivers/net/wireless/sd8897/mlan/mlan_decl.h
drivers/net/wireless/sd8897/mlan/mlan_fw.h
drivers/net/wireless/sd8897/mlan/mlan_ieee.h
drivers/net/wireless/sd8897/mlan/mlan_init.c
drivers/net/wireless/sd8897/mlan/mlan_init.h
drivers/net/wireless/sd8897/mlan/mlan_ioctl.h
drivers/net/wireless/sd8897/mlan/mlan_join.c
drivers/net/wireless/sd8897/mlan/mlan_join.h
drivers/net/wireless/sd8897/mlan/mlan_main.h
drivers/net/wireless/sd8897/mlan/mlan_meas.c
drivers/net/wireless/sd8897/mlan/mlan_meas.h
drivers/net/wireless/sd8897/mlan/mlan_misc.c
drivers/net/wireless/sd8897/mlan/mlan_module.c
drivers/net/wireless/sd8897/mlan/mlan_scan.c
drivers/net/wireless/sd8897/mlan/mlan_sdio.c
drivers/net/wireless/sd8897/mlan/mlan_sdio.h
drivers/net/wireless/sd8897/mlan/mlan_shim.c
drivers/net/wireless/sd8897/mlan/mlan_sta_cmd.c
drivers/net/wireless/sd8897/mlan/mlan_sta_cmdresp.c
drivers/net/wireless/sd8897/mlan/mlan_sta_event.c
drivers/net/wireless/sd8897/mlan/mlan_sta_ioctl.c
drivers/net/wireless/sd8897/mlan/mlan_sta_rx.c
drivers/net/wireless/sd8897/mlan/mlan_sta_tx.c
drivers/net/wireless/sd8897/mlan/mlan_txrx.c
drivers/net/wireless/sd8897/mlan/mlan_uap.h
drivers/net/wireless/sd8897/mlan/mlan_uap_cmdevent.c
drivers/net/wireless/sd8897/mlan/mlan_uap_ioctl.c
drivers/net/wireless/sd8897/mlan/mlan_uap_txrx.c
drivers/net/wireless/sd8897/mlan/mlan_util.h
drivers/net/wireless/sd8897/mlan/mlan_wmm.c
drivers/net/wireless/sd8897/mlan/mlan_wmm.h
drivers/net/wireless/sd8897/mlinux/mlan_decl.h
drivers/net/wireless/sd8897/mlinux/mlan_ieee.h
drivers/net/wireless/sd8897/mlinux/mlan_ioctl.h
drivers/net/wireless/sd8897/mlinux/moal_cfg80211.c
drivers/net/wireless/sd8897/mlinux/moal_cfg80211.h
drivers/net/wireless/sd8897/mlinux/moal_debug.c
drivers/net/wireless/sd8897/mlinux/moal_eth_ioctl.c
drivers/net/wireless/sd8897/mlinux/moal_eth_ioctl.h
drivers/net/wireless/sd8897/mlinux/moal_ioctl.c
drivers/net/wireless/sd8897/mlinux/moal_main.c
drivers/net/wireless/sd8897/mlinux/moal_main.h
drivers/net/wireless/sd8897/mlinux/moal_priv.c
drivers/net/wireless/sd8897/mlinux/moal_proc.c
drivers/net/wireless/sd8897/mlinux/moal_sdio_mmc.c
drivers/net/wireless/sd8897/mlinux/moal_shim.c
drivers/net/wireless/sd8897/mlinux/moal_shim.h
drivers/net/wireless/sd8897/mlinux/moal_sta_cfg80211.c
drivers/net/wireless/sd8897/mlinux/moal_uap.h
drivers/net/wireless/sd8897/mlinux/moal_uap_cfg80211.c
drivers/net/wireless/sd8897/mlinux/moal_uap_wext.c
drivers/net/wireless/sd8897/mlinux/moal_wext.c

index 6773d34..8e6f21f 100644 (file)
@@ -54,6 +54,16 @@ typedef u32 t_ptr;
 /** Define maximum number of radio func supported */
 #define MAX_RADIO_FUNC     4
 
+/** MAC address print format */
+#ifndef MACSTR
+#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
+#endif
+
+/** MAC address print arguments */
+#ifndef MAC2STR
+#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
+#endif
+
 /** Debug level : Message */
 #define        DBG_MSG                 BIT(0)
 /** Debug level : Fatal */
@@ -435,6 +445,8 @@ typedef struct _bt_private {
        spinlock_t driver_lock;
        /** Driver lock flags */
        ulong driver_flags;
+       /** Driver reference flags */
+       struct kobject kobj;
        int debug_device_pending;
        int debug_ocf_ogf[2];
 
@@ -566,6 +578,8 @@ int fm_set_intr_mask(bt_private * priv, u32 mask);
 /** default idle time */
 #define DEFAULT_IDLE_TIME           1000
 
+#define BT_CMD_HEADER_SIZE    3
+
 typedef struct _BT_CMD {
        /** OCF OGF */
        u16 ocf_ogf;
@@ -588,7 +602,10 @@ typedef struct _BT_EVENT {
 int check_evtpkt(bt_private * priv, struct sk_buff *skb);
 
 /* Prototype of global function */
-
+/** This function gets the priv reference */
+struct kobject *bt_priv_get(bt_private * priv);
+/** This function release the priv reference */
+void bt_priv_put(bt_private * priv);
 /** This function adds the card */
 bt_private *bt_add_card(void *card);
 /** This function removes the card */
@@ -690,6 +707,7 @@ int bt_init_config(bt_private * priv, char *cfg_file);
 int bt_load_cal_data(bt_private * priv, u8 * config_data, u8 * mac);
 /** BT set user defined calibration data */
 int bt_cal_config(bt_private * priv, char *cfg_file, char *mac);
+int bt_init_mac_address(bt_private * priv, char *mac);
 
 typedef struct _BT_HCI_CMD {
        /** OCF OGF */
index 2de8c12..55481d5 100644 (file)
@@ -30,7 +30,7 @@
                         || ('A' <= (c) && (c) <= 'F'))
 
 #define isdigit(c)     (('0' <= (c) && (c) <= '9'))
-#define isspace(c)  (c <= ' ' && (c == ' ' || (c <= 13 && c >=9)))
+#define isspace(c)  (c <= ' ' && (c == ' ' || (c <= 13 && c >= 9)))
 /**
  *  @brief Returns hex value of a give character
  *
@@ -116,7 +116,7 @@ bt_strsep(char **s, char delim, char esc)
  *  @return    hex value
  */
 static int
-bt_atox(char *a)
+bt_atox(const char *a)
 {
        int i = 0;
        ENTER();
@@ -199,35 +199,43 @@ bt_atoi(int *data, char *a)
  *
  *  @return        BT_STATUS_SUCCESS or BT_STATUS_FAILURE
  */
-static u32
-bt_parse_cal_cfg(u8 * src, u32 len, u8 * dst, u32 dst_size)
+static int
+bt_parse_cal_cfg(const u8 * src, u32 len, u8 * dst, u32 dst_size)
 {
-       u8 *ptr;
+       const u8 *ptr;
        u8 *dptr;
+       int ret = BT_STATUS_FAILURE;
 
        ENTER();
        ptr = src;
        dptr = dst;
 
-       while (ptr - src < len) {
-               if (*ptr && (isspace(*ptr) || *ptr == '\t')) {
+       while ((ptr - src) < len) {
+               if (*ptr && isspace(*ptr)) {
                        ptr++;
                        continue;
                }
 
                if (isxdigit(*ptr)) {
+                       if ((dptr - dst) >= dst_size) {
+                               PRINTM(ERROR, "cal_file size too big!!!\n");
+                               goto done;
+                       }
                        *dptr++ = bt_atox(ptr);
                        ptr += 2;
                } else {
                        ptr++;
                }
-               if ((dptr - dst) > dst_size) {
-                       PRINTM(ERROR, "cal_file size too big!!!\n");
-                       break;
-               }
        }
+       if (dptr == dst) {
+               ret = BT_STATUS_FAILURE;
+               goto done;
+       }
+
+       ret = BT_STATUS_SUCCESS;
+done:
        LEAVE();
-       return (dptr - dst);
+       return ret;
 }
 
 /**
@@ -241,7 +249,7 @@ bt_parse_cal_cfg(u8 * src, u32 len, u8 * dst, u32 dst_size)
 int
 parse_cfg_get_line(u8 * data, u32 size, u8 * line_pos)
 {
-       static s32 pos = 0;
+       static s32 pos;
        u8 *src, *dest;
 
        if (pos >= size) {      /* reach the end */
@@ -330,10 +338,8 @@ bt_process_init_cfg(bt_private * priv, u8 * data, u32 size)
                                        /* Convert MAC format */
                                        bt_mac2u8(bt_mac, bt_addr);
                                        PRINTM(CMD,
-                                              "HCI: %s new BT Address %02x:%02x:%02x:%02x:%02x:%02x\n",
-                                              dev_name, bt_mac[0], bt_mac[1],
-                                              bt_mac[2], bt_mac[3], bt_mac[4],
-                                              bt_mac[5]);
+                                              "HCI: %s new BT Address " MACSTR
+                                              "\n", dev_name, MAC2STR(bt_mac));
                                        if (BT_STATUS_SUCCESS !=
                                            bt_set_mac_address(priv, bt_mac)) {
                                                PRINTM(FATAL,
@@ -490,29 +496,25 @@ bt_process_cal_cfg(bt_private * priv, u8 * data, u32 size, char *mac)
 {
        u8 bt_mac[ETH_ALEN];
        u8 cal_data[32];
+       u8 *mac_data = NULL;
        int ret = BT_STATUS_FAILURE;
 
        memset(bt_mac, 0, sizeof(bt_mac));
-       bt_parse_cal_cfg(data, size, cal_data, sizeof(cal_data));
+       if (BT_STATUS_SUCCESS !=
+           bt_parse_cal_cfg(data, size, cal_data, sizeof(cal_data))) {
+               goto done;
+       }
        if (mac != NULL) {
                /* Convert MAC format */
                bt_mac2u8(bt_mac, mac);
-               PRINTM(CMD,
-                      "HCI: new BT Address %02x:%02x:%02x:%02x:%02x:%02x\n",
-                      bt_mac[0], bt_mac[1], bt_mac[2], bt_mac[3], bt_mac[4],
-                      bt_mac[5]);
-               if (BT_STATUS_SUCCESS !=
-                   bt_load_cal_data(priv, cal_data, bt_mac)) {
-                       PRINTM(FATAL, "BT: Fail to load calibrate data\n");
-                       goto done;
-               }
-       } else {
-               if (BT_STATUS_SUCCESS != bt_load_cal_data(priv, cal_data, NULL)) {
-                       PRINTM(FATAL, "BT: Fail to load calibrate data\n");
-                       goto done;
-               }
+               PRINTM(CMD, "HCI: new BT Address " MACSTR "\n",
+                      MAC2STR(bt_mac));
+               mac_data = bt_mac;
+       }
+       if (BT_STATUS_SUCCESS != bt_load_cal_data(priv, cal_data, mac_data)) {
+               PRINTM(FATAL, "BT: Fail to load calibrate data\n");
+               goto done;
        }
-
        ret = BT_STATUS_SUCCESS;
 
 done:
@@ -551,3 +553,29 @@ done:
        LEAVE();
        return ret;
 }
+
+/**
+ *    @brief BT init mac address from bt_mac parametre when insmod
+ *
+ *    @param priv    a pointer to bt_private structure
+ *    @param bt_mac  mac address buf
+ *    @return        BT_STATUS_SUCCESS or BT_STATUS_FAILURE
+ */
+int
+bt_init_mac_address(bt_private * priv, char *mac)
+{
+       u8 bt_mac[ETH_ALEN];
+       int ret = BT_STATUS_FAILURE;
+
+       ENTER();
+       memset(bt_mac, 0, sizeof(bt_mac));
+       bt_mac2u8(bt_mac, mac);
+       PRINTM(CMD, "HCI: New BT Address " MACSTR "\n", MAC2STR(bt_mac));
+       ret = bt_set_mac_address(priv, bt_mac);
+       if (ret != BT_STATUS_SUCCESS)
+               PRINTM(FATAL,
+                      "BT: Fail to set mac address from insmod parametre.\n");
+
+       LEAVE();
+       return ret;
+}
index 96260f0..d7ce8ec 100644 (file)
@@ -65,33 +65,33 @@ static char fw_version[32] = "0.0.0.p0";
 static struct class *chardev_class;
 
 /** Interface specific variables */
-static int mbtchar_minor = 0;
-static int fmchar_minor = 0;
-static int nfcchar_minor = 0;
-static int debugchar_minor = 0;
+static int mbtchar_minor;
+static int fmchar_minor;
+static int nfcchar_minor;
+static int debugchar_minor;
 
 /** Default Driver mode */
 static int drv_mode = (DRV_MODE_BT | DRV_MODE_FM | DRV_MODE_NFC);
 
 /** BT interface name */
-static char *bt_name = NULL;
+static char *bt_name;
 /** FM interface name */
-static char *fm_name = NULL;
+static char *fm_name;
 /** NFC interface name */
-static char *nfc_name = NULL;
+static char *nfc_name;
 /** BT debug interface name */
-static char *debug_name = NULL;
+static char *debug_name;
 
 /** Firmware flag */
 static int fw = 1;
 /** default powermode */
 static int psmode = 1;
 /** Init config file (MAC address, register etc.) */
-static char *init_cfg = NULL;
+static char *init_cfg;
 /** Calibration config file (MAC address, init powe etc.) */
-static char *cal_cfg = NULL;
+static char *cal_cfg;
 /** Init MAC address */
-static char *bt_mac = NULL;
+static char *bt_mac;
 
 /** Setting mbt_drvdbg value based on DEBUG level */
 #ifdef DEBUG_LEVEL1
@@ -111,9 +111,9 @@ int mbt_pm_keep_power = 1;
 static int debug_intf = 1;
 
 /** Enable minicard power-up/down */
-int minicard_pwrup = 1;
+static int minicard_pwrup = 1;
 /** Pointer to struct with control hooks */
-struct wifi_platform_data *bt_control_data = NULL;
+static struct wifi_platform_data *bt_control_data;
 
 /**
  *  @brief Alloc bt device
@@ -522,7 +522,7 @@ bt_send_reset_command(bt_private * priv)
                ret = BT_STATUS_FAILURE;
                goto exit;
        }
-       pCmd = (BT_HCI_CMD *) skb->tail;
+       pCmd = (BT_HCI_CMD *) skb->data;
        pCmd->ocf_ogf = (RESET_OGF << 10) | BT_CMD_RESET;
        pCmd->length = 0x00;
        pCmd->cmd_type = 0x00;
@@ -581,7 +581,7 @@ bt_send_module_cfg_cmd(bt_private * priv, int subcmd)
        pCmd->length = 1;
        pCmd->data[0] = subcmd;
        bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
-       skb_put(skb, sizeof(BT_CMD));
+       skb_put(skb, BT_CMD_HEADER_SIZE + pCmd->length);
        skb->dev = (void *)(&(priv->bt_dev.m_dev[BT_SEQ]));
        skb_queue_head(&priv->adapter->tx_queue, skb);
        priv->bt_dev.sendcmdflag = TRUE;
@@ -644,7 +644,7 @@ bt_enable_ps(bt_private * priv)
                pCmd->length = 1;
        }
        bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
-       skb_put(skb, sizeof(BT_CMD));
+       skb_put(skb, BT_CMD_HEADER_SIZE + pCmd->length);
        skb->dev = (void *)(&(priv->bt_dev.m_dev[BT_SEQ]));
        skb_queue_head(&priv->adapter->tx_queue, skb);
        PRINTM(CMD, "Queue PSMODE Command(0x%x):%d\n", pCmd->ocf_ogf,
@@ -690,7 +690,7 @@ bt_send_hscfg_cmd(bt_private * priv)
        pCmd->data[0] = (priv->bt_dev.gpio_gap & 0xff00) >> 8;
        pCmd->data[1] = (u8) (priv->bt_dev.gpio_gap & 0x00ff);
        bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
-       skb_put(skb, sizeof(BT_CMD));
+       skb_put(skb, BT_CMD_HEADER_SIZE + pCmd->length);
        skb->dev = (void *)(&(priv->bt_dev.m_dev[BT_SEQ]));
        skb_queue_head(&priv->adapter->tx_queue, skb);
        PRINTM(CMD, "Queue HSCFG Command(0x%x),gpio=0x%x,gap=0x%x\n",
@@ -738,7 +738,7 @@ bt_send_sdio_pull_ctrl_cmd(bt_private * priv)
        pCmd->data[2] = (priv->bt_dev.sdio_pull_cfg & 0x00ff0000) >> 16;
        pCmd->data[3] = (priv->bt_dev.sdio_pull_cfg & 0xff000000) >> 24;
        bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
-       skb_put(skb, sizeof(BT_CMD));
+       skb_put(skb, BT_CMD_HEADER_SIZE + pCmd->length);
        skb->dev = (void *)(&(priv->bt_dev.m_dev[BT_SEQ]));
        skb_queue_head(&priv->adapter->tx_queue, skb);
        PRINTM(CMD,
@@ -792,7 +792,7 @@ fm_set_intr_mask(bt_private * priv, u32 mask)
        memcpy(&pCmd->data[1], &mask, sizeof(mask));
        PRINTM(CMD, "FM set intr mask=0x%x\n", mask);
        bt_cb(skb)->pkt_type = HCI_COMMAND_PKT;
-       skb_put(skb, sizeof(BT_CMD));
+       skb_put(skb, BT_CMD_HEADER_SIZE + pCmd->length);
        skb->dev = (void *)(&(priv->bt_dev.m_dev[FM_SEQ]));
        skb_queue_head(&priv->adapter->tx_queue, skb);
        priv->bt_dev.sendcmdflag = TRUE;
@@ -836,7 +836,7 @@ bt_enable_hs(bt_private * priv)
        pCmd->ocf_ogf = (VENDOR_OGF << 10) | BT_CMD_HOST_SLEEP_ENABLE;
        pCmd->length = 0;
        bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
-       skb_put(skb, sizeof(BT_CMD));
+       skb_put(skb, BT_CMD_HEADER_SIZE + pCmd->length);
        skb->dev = (void *)(&(priv->bt_dev.m_dev[BT_SEQ]));
        skb_queue_head(&priv->adapter->tx_queue, skb);
        priv->bt_dev.sendcmdflag = TRUE;
@@ -997,8 +997,8 @@ bt_set_mac_address(bt_private * priv, u8 * mac)
        priv->bt_dev.sendcmdflag = TRUE;
        priv->bt_dev.send_cmd_ocf = BT_CMD_CONFIG_MAC_ADDR;
        priv->adapter->cmd_complete = FALSE;
-       PRINTM(CMD, "BT: Set mac addr %02x:%02x:%02x:%02x:%02x:%02x (0x%x)\n",
-              mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], pCmd->ocf_ogf);
+       PRINTM(CMD, "BT: Set mac addr " MACSTR " (0x%x)\n", MAC2STR(mac),
+              pCmd->ocf_ogf);
        wake_up_interruptible(&priv->MainThread.waitQ);
        if (!os_wait_interruptible_timeout
            (priv->adapter->cmd_wait_q, priv->adapter->cmd_complete,
@@ -1028,9 +1028,9 @@ bt_load_cal_data(bt_private * priv, u8 * config_data, u8 * mac)
        u8 ret = BT_STATUS_SUCCESS;
        BT_CMD *pCmd;
        int i = 0;
-       // u8 config_data[28] = {0x37 0x01 0x1c 0x00 0xFF 0xFF 0xFF 0xFF
-       // 0x01 0x7f 0x04 0x02 0x00 0x00 0xBA 0xCE
-       // 0xC0 0xC6 0x2D 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xF0};
+       /* u8 config_data[28] = {0x37 0x01 0x1c 0x00 0xFF 0xFF 0xFF 0xFF 0x01
+          0x7f 0x04 0x02 0x00 0x00 0xBA 0xCE 0xC0 0xC6 0x2D 0x00 0x00 0x00
+          0x00 0x00 0x00 0x00 0xF0}; */
 
        ENTER();
        skb = bt_skb_alloc(sizeof(BT_CMD), GFP_ATOMIC);
@@ -1046,17 +1046,17 @@ bt_load_cal_data(bt_private * priv, u8 * config_data, u8 * mac)
        pCmd->data[1] = 0x00;
        pCmd->data[2] = 0x00;
        pCmd->data[3] = 0x1C;
-       // swip cal-data byte
+       /* swip cal-data byte */
        for (i = 4; i < 32; i++) {
                pCmd->data[i] = config_data[(i / 4) * 8 - 1 - i];
        }
        if (mac != NULL) {
-               pCmd->data[2] = 0x01;   // skip checksum
+               pCmd->data[2] = 0x01;   /* skip checksum */
                for (i = 24; i < 30; i++)
                        pCmd->data[i] = mac[29 - i];
        }
        bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
-       skb_put(skb, sizeof(BT_CMD));
+       skb_put(skb, BT_CMD_HEADER_SIZE + pCmd->length);
        skb->dev = (void *)(&(priv->bt_dev.m_dev[BT_SEQ]));
        skb_queue_head(&priv->adapter->tx_queue, skb);
        priv->bt_dev.sendcmdflag = TRUE;
@@ -1143,7 +1143,8 @@ bt_restore_tx_queue(bt_private * priv)
        struct sk_buff *skb = NULL;
        while (!skb_queue_empty(&priv->adapter->pending_queue)) {
                skb = skb_dequeue(&priv->adapter->pending_queue);
-               skb_queue_tail(&priv->adapter->tx_queue, skb);
+               if (skb)
+                       skb_queue_tail(&priv->adapter->tx_queue, skb);
        }
        wake_up_interruptible(&priv->MainThread.waitQ);
 }
@@ -1629,6 +1630,75 @@ bt_interrupt(struct m_dev *m_dev)
        LEAVE();
 }
 
+static void
+char_dev_release_dynamic(struct kobject *kobj)
+{
+       struct char_dev *cdev = container_of(kobj, struct char_dev, kobj);
+       ENTER();
+       PRINTM(INFO, "free char_dev\n");
+       kfree(cdev);
+       LEAVE();
+}
+
+static struct kobj_type ktype_char_dev_dynamic = {
+       .release = char_dev_release_dynamic,
+};
+
+static struct char_dev *
+alloc_char_dev(void)
+{
+       struct char_dev *cdev;
+       ENTER();
+       cdev = kzalloc(sizeof(struct char_dev), GFP_KERNEL);
+       if (cdev) {
+               kobject_init(&cdev->kobj, &ktype_char_dev_dynamic);
+               PRINTM(INFO, "alloc char_dev\n");
+       }
+       return cdev;
+}
+
+static void
+bt_private_dynamic_release(struct kobject *kobj)
+{
+       bt_private *priv = container_of(kobj, bt_private, kobj);
+       ENTER();
+       PRINTM(INFO, "free bt priv\n");
+       kfree(priv);
+       LEAVE();
+}
+
+static struct kobj_type ktype_bt_private_dynamic = {
+       .release = bt_private_dynamic_release,
+};
+
+static bt_private *
+bt_alloc_priv(void)
+{
+       bt_private *priv;
+       ENTER();
+       priv = kzalloc(sizeof(bt_private), GFP_KERNEL);
+       if (priv) {
+               kobject_init(&priv->kobj, &ktype_bt_private_dynamic);
+               PRINTM(INFO, "alloc bt priv\n");
+       }
+       LEAVE();
+       return priv;
+}
+
+struct kobject *
+bt_priv_get(bt_private * priv)
+{
+       PRINTM(INFO, "bt priv get object");
+       return kobject_get(&priv->kobj);
+}
+
+void
+bt_priv_put(bt_private * priv)
+{
+       PRINTM(INFO, "bt priv put object");
+       kobject_put(&priv->kobj);
+}
+
 /**
  *  @brief Module configuration and register device
  *
@@ -1708,7 +1778,7 @@ sbi_register_conf_dpc(bt_private * priv)
                priv->bt_dev.m_dev[BT_SEQ].dev_type = BT_AMP_TYPE;
        }
        /* block all the packet from bluez */
-       if (init_cfg || cal_cfg)
+       if (init_cfg || cal_cfg || bt_mac)
                priv->adapter->tx_lock = TRUE;
 
        if (mbt_dev) {
@@ -1726,7 +1796,7 @@ sbi_register_conf_dpc(bt_private * priv)
                atomic_set(&mbt_dev->promisc, 0);
 
                /** alloc char dev node */
-               char_dev = kzalloc(sizeof(struct char_dev), GFP_KERNEL);
+               char_dev = alloc_char_dev();
                if (!char_dev) {
                        class_destroy(chardev_class);
                        ret = -ENOMEM;
@@ -1748,6 +1818,10 @@ sbi_register_conf_dpc(bt_private * priv)
                mbtchar_minor++;
                PRINTM(MSG, "BT: Create %s\n", dev_file);
 
+               /** register m_dev to BT char device */
+               priv->bt_dev.m_dev[BT_SEQ].index = char_dev->minor;
+               char_dev->m_dev = &(priv->bt_dev.m_dev[BT_SEQ]);
+
                /** create BT char device node */
                register_char_dev(char_dev, chardev_class, MODULE_NAME,
                                  mbt_dev->name);
@@ -1756,10 +1830,6 @@ sbi_register_conf_dpc(bt_private * priv)
                mbtchar_chown(dev_file, AID_SYSTEM, AID_BLUETOOTH);
                mbtchar_chmod(dev_file, 0666);
 
-               /** register m_dev to BT char device */
-               priv->bt_dev.m_dev[BT_SEQ].index = char_dev->minor;
-               char_dev->m_dev = &(priv->bt_dev.m_dev[BT_SEQ]);
-
                /** create proc device */
                snprintf(priv->bt_dev.m_dev[BT_SEQ].name,
                         sizeof(priv->bt_dev.m_dev[BT_SEQ].name),
@@ -1788,7 +1858,7 @@ sbi_register_conf_dpc(bt_private * priv)
                priv->bt_dev.m_dev[FM_SEQ].read_continue_flag = 0;
 
                /** create char device for FM */
-               char_dev = kzalloc(sizeof(struct char_dev), GFP_KERNEL);
+               char_dev = alloc_char_dev();
                if (!char_dev) {
                        class_destroy(chardev_class);
                        ret = -ENOMEM;
@@ -1807,6 +1877,10 @@ sbi_register_conf_dpc(bt_private * priv)
                PRINTM(MSG, "BT: Create %s\n", dev_file);
                fmchar_minor++;
 
+               /** register m_dev to FM char device */
+               priv->bt_dev.m_dev[FM_SEQ].index = char_dev->minor;
+               char_dev->m_dev = &(priv->bt_dev.m_dev[FM_SEQ]);
+
                /** register char dev */
                register_char_dev(char_dev, chardev_class,
                                  MODULE_NAME, fm_dev->name);
@@ -1814,10 +1888,6 @@ sbi_register_conf_dpc(bt_private * priv)
                /** chmod for FM char device */
                mbtchar_chmod(dev_file, 0666);
 
-               /** register m_dev to FM char device */
-               priv->bt_dev.m_dev[FM_SEQ].index = char_dev->minor;
-               char_dev->m_dev = &(priv->bt_dev.m_dev[FM_SEQ]);
-
                /** create proc device */
                snprintf(priv->bt_dev.m_dev[FM_SEQ].name,
                         sizeof(priv->bt_dev.m_dev[FM_SEQ].name), fm_dev->name);
@@ -1845,7 +1915,7 @@ sbi_register_conf_dpc(bt_private * priv)
                priv->bt_dev.m_dev[NFC_SEQ].read_continue_flag = 0;
 
                /** create char device for NFC */
-               char_dev = kzalloc(sizeof(struct char_dev), GFP_KERNEL);
+               char_dev = alloc_char_dev();
                if (!char_dev) {
                        class_destroy(chardev_class);
                        ret = -ENOMEM;
@@ -1863,6 +1933,10 @@ sbi_register_conf_dpc(bt_private * priv)
                PRINTM(MSG, "BT: Create %s\n", dev_file);
                nfcchar_minor++;
 
+               /** register m_dev to NFC char device */
+               priv->bt_dev.m_dev[NFC_SEQ].index = char_dev->minor;
+               char_dev->m_dev = &(priv->bt_dev.m_dev[NFC_SEQ]);
+
                /** register char dev */
                register_char_dev(char_dev, chardev_class, MODULE_NAME,
                                  nfc_dev->name);
@@ -1870,10 +1944,6 @@ sbi_register_conf_dpc(bt_private * priv)
                /** chmod for NFC char device */
                mbtchar_chmod(dev_file, 0666);
 
-               /** register m_dev to NFC char device */
-               priv->bt_dev.m_dev[NFC_SEQ].index = char_dev->minor;
-               char_dev->m_dev = &(priv->bt_dev.m_dev[NFC_SEQ]);
-
                /** create proc device */
                snprintf(priv->bt_dev.m_dev[NFC_SEQ].name,
                         sizeof(priv->bt_dev.m_dev[NFC_SEQ].name),
@@ -1900,7 +1970,7 @@ sbi_register_conf_dpc(bt_private * priv)
                priv->bt_dev.m_dev[DEBUG_SEQ].driver_data = priv;
 
                /** create char device for Debug */
-               char_dev = kzalloc(sizeof(struct char_dev), GFP_KERNEL);
+               char_dev = alloc_char_dev();
                if (!char_dev) {
                        class_destroy(chardev_class);
                        ret = -ENOMEM;
@@ -1919,16 +1989,14 @@ sbi_register_conf_dpc(bt_private * priv)
                debugchar_minor++;
 
                /** register char dev */
+               priv->bt_dev.m_dev[DEBUG_SEQ].index = char_dev->minor;
+               char_dev->m_dev = &(priv->bt_dev.m_dev[DEBUG_SEQ]);
                register_char_dev(char_dev, chardev_class, MODULE_NAME,
                                  debug_dev->name);
 
                /** chmod for debug char device */
                mbtchar_chmod(dev_file, 0666);
 
-               /** register m_dev to debug char device */
-               priv->bt_dev.m_dev[DEBUG_SEQ].index = char_dev->minor;
-               char_dev->m_dev = &(priv->bt_dev.m_dev[DEBUG_SEQ]);
-
                /** create proc device */
                snprintf(priv->bt_dev.m_dev[DEBUG_SEQ].name,
                         sizeof(priv->bt_dev.m_dev[DEBUG_SEQ].name),
@@ -1954,7 +2022,7 @@ sbi_register_conf_dpc(bt_private * priv)
                        goto done;
                }
 
-       if (cal_cfg)
+       if (cal_cfg) {
                if (BT_STATUS_SUCCESS != bt_cal_config(priv, cal_cfg, bt_mac)) {
                        PRINTM(FATAL, "BT: Set cal data failed\n");
                        if (mbt_dev) {
@@ -1970,7 +2038,18 @@ sbi_register_conf_dpc(bt_private * priv)
                        ret = BT_STATUS_FAILURE;
                        goto done;
                }
-       if (init_cfg || cal_cfg) {
+       } else if (bt_mac) {
+               PRINTM(INFO,
+                      "Set BT mac_addr from insmod parametre bt_mac = %s\n",
+                      bt_mac);
+               if (BT_STATUS_SUCCESS != bt_init_mac_address(priv, bt_mac)) {
+                       PRINTM(FATAL,
+                              "BT: Fail to set mac address from insmod parametre\n");
+                       ret = BT_STATUS_FAILURE;
+                       goto done;
+               }
+       }
+       if (init_cfg || cal_cfg || bt_mac) {
                priv->adapter->tx_lock = FALSE;
                bt_restore_tx_queue(priv);
        }
@@ -2007,7 +2086,7 @@ bt_add_card(void *card)
 
        ENTER();
 
-       priv = kzalloc(sizeof(bt_private), GFP_KERNEL);
+       priv = bt_alloc_priv();
        if (!priv) {
                PRINTM(FATAL, "Can not allocate priv\n");
                LEAVE();
@@ -2015,7 +2094,8 @@ bt_add_card(void *card)
        }
 
        /* allocate buffer for bt_adapter */
-       if (!(priv->adapter = kzalloc(sizeof(bt_adapter), GFP_KERNEL))) {
+       priv->adapter = kzalloc(sizeof(bt_adapter), GFP_KERNEL);
+       if (!priv->adapter) {
                PRINTM(FATAL, "Allocate buffer for bt_adapter failed!\n");
                goto err_kmalloc;
        }
@@ -2067,7 +2147,7 @@ err_registerdev:
 err_kmalloc:
        if (priv->adapter)
                bt_free_adapter(priv);
-       kfree(priv);
+       bt_priv_put(priv);
        LEAVE();
        return NULL;
 }
@@ -2157,7 +2237,7 @@ bt_remove_card(void *card)
        }
        PRINTM(INFO, "Free Adapter\n");
        bt_free_adapter(priv);
-       kfree(priv);
+       bt_priv_put(priv);
 
        LEAVE();
        return BT_STATUS_SUCCESS;
index 08ebd65..74007eb 100644 (file)
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
 #define PROC_DIR NULL
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
-#define PROC_DIR &proc_root
+#define PROC_DIR (&proc_root)
 #else
 #define PROC_DIR proc_net
 #endif
 
 /** Proc mbt directory entry */
-static struct proc_dir_entry *proc_mbt = NULL;
+static struct proc_dir_entry *proc_mbt;
 
 #define     CMD52_STR_LEN   50
-static bt_private *bpriv = NULL;
+static bt_private *bpriv;
 static char cmd52_string[CMD52_STR_LEN];
 
 struct proc_data {
@@ -71,12 +71,12 @@ struct proc_data {
 /** Device size */
 #define item_dev_size(n) (sizeof((bt_dev_t *)0)->n)
 /** Device address */
-#define item_dev_addr(n) ((t_ptr) &((bt_dev_t *)0)->n)
+#define item_dev_addr(n) ((t_ptr) & ((bt_dev_t *)0)->n)
 
 /** Adapter size */
 #define item_adapter_size(n) (sizeof((bt_adapter *)0)->n)
 /** Adapter address */
-#define item_adapter_addr(n) ((t_ptr) &((bt_adapter *)0)->n)
+#define item_adapter_addr(n) ((t_ptr) & ((bt_adapter *)0)->n)
 
 static struct item_data config_items[] = {
 #ifdef DEBUG_LEVEL1
@@ -178,7 +178,7 @@ string_to_number(char *s)
                        break;
        }
 
-       return (r * pn);
+       return r * pn;
 }
 
 /**
@@ -348,8 +348,11 @@ proc_write(struct file *file,
 static void
 proc_on_close(struct inode *inode, struct file *file)
 {
-       struct proc_dir_entry *entry = PDE(inode);
-       struct proc_private_data *priv = entry->data;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+       struct proc_private_data *priv = PDE_DATA(inode);
+#else
+       struct proc_private_data *priv = PDE(inode)->data;
+#endif
        struct proc_data *pdata = file->private_data;
        char *line;
        int i;
@@ -398,8 +401,11 @@ proc_on_close(struct inode *inode, struct file *file)
 static int
 proc_open(struct inode *inode, struct file *file)
 {
-       struct proc_dir_entry *entry = PDE(inode);
-       struct proc_private_data *priv = entry->data;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+       struct proc_private_data *priv = PDE_DATA(inode);
+#else
+       struct proc_private_data *priv = PDE(inode)->data;
+#endif
        struct proc_data *pdata;
        int i;
        char *p;
@@ -407,21 +413,23 @@ proc_open(struct inode *inode, struct file *file)
        ENTER();
        priv->pbt->adapter->skb_pending =
                skb_queue_len(&priv->pbt->adapter->tx_queue);
-       if ((file->private_data =
-            kzalloc(sizeof(struct proc_data), GFP_KERNEL)) == NULL) {
+       file->private_data = kzalloc(sizeof(struct proc_data), GFP_KERNEL);
+       if (file->private_data == NULL) {
                PRINTM(ERROR, "BT: Can not alloc mem for proc_data\n");
                LEAVE();
                return -ENOMEM;
        }
        pdata = (struct proc_data *)file->private_data;
-       if ((pdata->rdbuf = kmalloc(priv->bufsize, GFP_KERNEL)) == NULL) {
+       pdata->rdbuf = kmalloc(priv->bufsize, GFP_KERNEL);
+       if (pdata->rdbuf == NULL) {
                PRINTM(ERROR, "BT: Can not alloc mem for rdbuf\n");
                kfree(file->private_data);
                LEAVE();
                return -ENOMEM;
        }
        if (priv->fileflag == DEFAULT_FILE_PERM) {
-               if ((pdata->wrbuf = kzalloc(priv->bufsize, GFP_KERNEL)) == NULL) {
+               pdata->wrbuf = kzalloc(priv->bufsize, GFP_KERNEL);
+               if (pdata->wrbuf == NULL) {
                        PRINTM(ERROR, "BT: Can not alloc mem for wrbuf\n");
                        kfree(pdata->rdbuf);
                        kfree(file->private_data);
@@ -524,8 +532,7 @@ bt_proc_init(bt_private * priv, struct m_dev *m_dev, int seq)
                }
                memcpy((u8 *) priv->dev_proc[seq].pfiles, (u8 *) proc_files,
                       sizeof(proc_files));
-               priv->dev_proc[seq].num_proc_files =
-                       sizeof(proc_files) / sizeof(proc_files[0]);
+               priv->dev_proc[seq].num_proc_files = ARRAY_SIZE(proc_files);
                for (j = 0; j < priv->dev_proc[seq].num_proc_files; j++)
                        priv->dev_proc[seq].pfiles[j].pdata = NULL;
                for (j = 0; j < priv->dev_proc[seq].num_proc_files; j++) {
@@ -564,6 +571,16 @@ bt_proc_init(bt_private * priv, struct m_dev *m_dev, int seq)
                                                (t_ptr) priv->adapter;
                        }
                        priv->dev_proc[seq].pfiles[j].pbt = priv;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+                       entry = proc_create_data(proc_files[j].name,
+                                                S_IFREG | proc_files[j].
+                                                fileflag,
+                                                priv->dev_proc[seq].proc_entry,
+                                                proc_files[j].fops,
+                                                &priv->dev_proc[seq].
+                                                pfiles[j]);
+                       if (entry == NULL)
+#else
                        entry = create_proc_entry(proc_files[j].name,
                                                  S_IFREG | proc_files[j].
                                                  fileflag,
@@ -576,6 +593,7 @@ bt_proc_init(bt_private * priv, struct m_dev *m_dev, int seq)
 #endif
                                entry->proc_fops = proc_files[j].fops;
                        } else
+#endif
                                PRINTM(MSG, "BT: Fail to create proc %s\n",
                                       proc_files[j].name);
                }
@@ -619,17 +637,14 @@ bt_proc_remove(bt_private * priv)
                for (i = 0; i < MAX_RADIO_FUNC; i++) {
                        if (!priv->dev_proc[i].proc_entry)
                                continue;
-                       for (j = 0;
-                            j < sizeof(proc_files) / sizeof(proc_files[0]);
-                            j++) {
+                       for (j = 0; j < ARRAY_SIZE(proc_files); j++) {
                                remove_proc_entry(proc_files[j].name,
                                                  priv->dev_proc[i].proc_entry);
                        }
-                       if (priv->dev_proc[i].proc_entry) {
-                               remove_proc_entry(priv->bt_dev.m_dev[i].name,
-                                                 proc_mbt);
-                               priv->dev_proc[i].proc_entry = NULL;
-                       }
+
+                       remove_proc_entry(priv->bt_dev.m_dev[i].name, proc_mbt);
+                       priv->dev_proc[i].proc_entry = NULL;
+
                        if (priv->dev_proc[i].pfiles) {
                                for (j = 0;
                                     j < priv->dev_proc[i].num_proc_files;
index b1c95b0..01f84fb 100644 (file)
@@ -31,9 +31,9 @@
 /** Max retry number of CMD53 write */
 #define MAX_WRITE_IOMEM_RETRY  2
 /** Firmware name */
-static char *fw_name = NULL;
+static char *fw_name;
 /** request firmware nowait */
-static int req_fw_nowait = 0;
+static int req_fw_nowait;
 static int multi_fn = BIT(2);
 #define DEFAULT_FW_NAME "mrvl/sd8897_uapsta_a0.bin"
 
@@ -56,7 +56,7 @@ MODULE_DEVICE_TABLE(sdio, bt_ids);
                Global Variables
 ********************************************************/
 /** unregiser bus driver flag */
-static u8 unregister = 0;
+static u8 unregister;
 #ifdef SDIO_SUSPEND_RESUME
 /** PM keep power */
 extern int mbt_pm_keep_power;
@@ -342,7 +342,7 @@ sd_probe_card(struct sdio_func *func, const struct sdio_device_id *id)
                goto done;
        }
        card->func = func;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
        /* wait for chip fully wake up */
        if (!func->enable_timeout)
                func->enable_timeout = 200;
@@ -383,7 +383,7 @@ int
 sd_verify_fw_download(bt_private * priv, int pollnum)
 {
        int ret = BT_STATUS_FAILURE;
-       u16 firmwarestat;
+       u16 firmwarestat = 0;
        int tries;
 
        ENTER();
@@ -399,7 +399,10 @@ sd_verify_fw_download(bt_private * priv, int pollnum)
                }
                mdelay(100);
        }
-
+       if ((pollnum > 1) && (ret != BT_STATUS_SUCCESS))
+               PRINTM(ERROR,
+                      "Fail to poll firmware status: firmwarestat=0x%x\n",
+                      firmwarestat);
        LEAVE();
        return ret;
 }
@@ -654,7 +657,7 @@ sd_request_fw_dpc(const struct firmware *fw_firmware, void *context)
                goto done;
        }
        if (fw_firmware) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
                if (!req_fw_nowait)
 #endif
                        release_firmware(fw_firmware);
@@ -664,7 +667,7 @@ sd_request_fw_dpc(const struct firmware *fw_firmware, void *context)
 
 done:
        if (fw_firmware) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
                if (!req_fw_nowait)
 #endif
                        release_firmware(fw_firmware);
@@ -731,25 +734,24 @@ sd_download_firmware_w_helper(bt_private * priv)
        cur_fw_name = fw_name;
 
        if (req_fw_nowait) {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
-               if ((ret =
-                    request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
-                                            cur_fw_name, priv->hotplug_device,
-                                            GFP_KERNEL, priv,
-                                            sd_request_fw_callback)) < 0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
+               ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
+                                             cur_fw_name, priv->hotplug_device,
+                                             GFP_KERNEL, priv,
+                                             sd_request_fw_callback);
 #else
-               if ((ret =
-                    request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
-                                            cur_fw_name, priv->hotplug_device,
-                                            priv, sd_request_fw_callback)) < 0)
+               ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
+                                             cur_fw_name, priv->hotplug_device,
+                                             priv, sd_request_fw_callback);
 #endif
+               if (ret < 0)
                        PRINTM(FATAL,
                               "BT: request_firmware_nowait() failed, error code = %#x\n",
                               ret);
        } else {
-               if ((err =
-                    request_firmware(&priv->firmware, cur_fw_name,
-                                     priv->hotplug_device)) < 0) {
+               err = request_firmware(&priv->firmware, cur_fw_name,
+                                      priv->hotplug_device);
+               if (err < 0) {
                        PRINTM(FATAL,
                               "BT: request_firmware() failed, error code = %#x\n",
                               err);
@@ -988,7 +990,7 @@ sd_card_to_host(bt_private * priv)
                }
                break;
        case MRVL_VENDOR_PKT:
-               // Just think here need to back compatible FM
+               /* Just think here need to back compatible FM */
                bt_cb(skb)->pkt_type = HCI_VENDOR_PKT;
                skb_put(skb, buf_len);
                skb_pull(skb, BT_HEADER_LEN);
index 293234a..279bfa0 100644 (file)
 #include "bt_drv.h"
 #include "mbt_char.h"
 
-LIST_HEAD(char_dev_list);
+static LIST_HEAD(char_dev_list);
 
 static DEFINE_SPINLOCK(char_dev_list_lock);
 
 static int mbtchar_major = MBTCHAR_MAJOR_NUM;
 
+struct kobject *
+chardev_get(struct char_dev *dev)
+{
+       struct kobject *kobj;
+
+       kobj = bt_priv_get(dev->m_dev->driver_data);
+       if (!kobj)
+               return NULL;
+       PRINTM(INFO, "dev get kobj\n");
+       kobj = kobject_get(&dev->kobj);
+       if (!kobj)
+               bt_priv_put(dev->m_dev->driver_data);
+       return kobj;
+}
+
+void
+chardev_put(struct char_dev *dev)
+{
+       if (dev) {
+               struct m_dev *m_dev = dev->m_dev;
+               PRINTM(INFO, "dev put kobj\n");
+               kobject_put(&dev->kobj);
+               if (m_dev) {
+                       bt_priv_put(m_dev->driver_data);
+               }
+       }
+}
+
 /**
  *     @brief Changes permissions of the dev
  *
@@ -367,9 +395,9 @@ chardev_open(struct inode *inode, struct file *filp)
        ENTER();
 
        dev = container_of(inode->i_cdev, struct char_dev, cdev);
-       if (!dev->m_dev) {
-               ret = -ENXIO;
-               goto done;
+       if (!chardev_get(dev)) {
+               LEAVE();
+               return -ENXIO;
        }
        filp->private_data = dev;       /* for other methods */
        m_dev = dev->m_dev;
@@ -386,6 +414,8 @@ chardev_open(struct inode *inode, struct file *filp)
 
 done:
        mdev_req_unlock(m_dev);
+       if (ret)
+               chardev_put(dev);
        LEAVE();
        return ret;
 }
@@ -402,13 +432,17 @@ chardev_release(struct inode *inode, struct file *filp)
 {
        int ret = 0;
        struct char_dev *dev = (struct char_dev *)filp->private_data;
+       struct m_dev *m_dev = NULL;
        ENTER();
-       if (!dev || !dev->m_dev) {
+       if (!dev) {
                LEAVE();
                return -ENXIO;
        }
-       ret = dev->m_dev->close(dev->m_dev);
+       m_dev = dev->m_dev;
+       if (m_dev)
+               ret = dev->m_dev->close(dev->m_dev);
        filp->private_data = NULL;
+       chardev_put(dev);
        LEAVE();
        return ret;
 }
@@ -446,6 +480,7 @@ chardev_poll(struct file *filp, poll_table * wait)
 
 /* File ops for the Char driver */
 const struct file_operations chardev_fops = {
+       .owner = THIS_MODULE,
        .read = chardev_read,
        .write = chardev_write,
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
@@ -493,8 +528,7 @@ register_char_dev(struct char_dev *dev, struct class *char_class,
                mbtchar_major = MAJOR(dev_num);
        }
        cdev_init(&dev->cdev, &chardev_fops);
-       dev->cdev.owner = THIS_MODULE;
-       dev->cdev.ops = &chardev_fops;
+       dev->cdev.owner = chardev_fops.owner;
        dev_num = MKDEV(mbtchar_major, dev->minor);
 
        if (cdev_add(&dev->cdev, dev_num, 1)) {
@@ -596,7 +630,7 @@ chardev_cleanup(struct class *char_class)
                        list_del(p);
                        spin_unlock_irqrestore(&char_dev_list_lock, flags);
                        unregister_char_dev(dev, char_class, dev->m_dev->name);
-                       kfree(dev);
+                       kobject_put(&dev->kobj);
                        spin_lock_irqsave(&char_dev_list_lock, flags);
                        break;
                }
@@ -628,7 +662,7 @@ chardev_cleanup_one(struct m_dev *m_dev, struct class *char_class)
                        spin_unlock_irqrestore(&char_dev_list_lock, flags);
                        dev->m_dev = NULL;
                        unregister_char_dev(dev, char_class, m_dev->name);
-                       kfree(dev);
+                       kobject_put(&dev->kobj);
                        spin_lock_irqsave(&char_dev_list_lock, flags);
                        break;
                }
index 3d67202..7ac9922 100644 (file)
@@ -43,6 +43,7 @@ struct char_dev {
        int dev_type;
        struct cdev cdev;
        struct m_dev *m_dev;
+       struct kobject kobj;
 };
 
 /** Changes permissions of the dev */
index d0db901..27743d4 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file declares all APIs that will be called from MOAL module.
  *  It also defines the data structures used for APIs between MLAN and MOAL.
  *
- * Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- * This software file (the "File") is distributed by Marvell International
- * Ltd. under the terms of the GNU General Public License Version 2, June 1991
- * (the "License").  You may use, redistribute and/or modify this File in
- * accordance with the terms and conditions of the License, a copy of which
- * is available by writing to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- * this warranty disclaimer.
  */
 
 /******************************************************
index e65d171..763dc07 100644 (file)
@@ -1,21 +1,28 @@
 /** @file mlan_11ac.c
  *
- *  @brief This file contains the functions for station ioctl.
+ *  @brief This file defines the private and adapter data
+ *  structures and declares global function prototypes used
+ *  in MLAN module.
  *
- *  Copyright (C) 2011-2012, Marvell International Ltd.
+ *  (C) Copyright 2011-2012 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 #include "mlan.h"
@@ -171,8 +178,8 @@ wlan_11ac_ioctl_vhtcfg(IN pmlan_adapter pmadapter,
        ENTER();
 
 #define VHT_CAP_INFO_BIT_FIELDS   (MBIT(4)|MBIT(5)|MBIT(6)|MBIT(7)|\
-                                   MBIT(11)|MBIT(12)|MBIT(19)|MBIT(20)|\
-                                   MBIT(21)|MBIT(22)|MBIT(28)|MBIT(29))
+                                                                       MBIT(11)|MBIT(12)|MBIT(19)|MBIT(20)|\
+                                                                       MBIT(21)|MBIT(22)|MBIT(28)|MBIT(29))
 
        cfg = (mlan_ds_11ac_cfg *) pioctl_req->pbuf;
 
index e13e183..3ed600d 100644 (file)
@@ -1,21 +1,28 @@
 /** @file mlan_11ac.h
  *
- *  @brief This file contains the functions for station ioctl.
+ *  @brief This file defines the private and adapter data
+ *  structures and declares global function prototypes used
+ *  in MLAN module.
  *
- *  Copyright (C) 2011-2012, Marvell International Ltd.
+ *  (C) Copyright 2011-2012 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 #ifndef _MLAN_11AC_H_
index 3d9f82b..a68f4f3 100644 (file)
@@ -2,20 +2,24 @@
  *
  *  @brief This file contains functions for 802.11D.
  *
- *  Copyright (C) 2008-2012, Marvell International Ltd.
+ *  (C) Copyright 2008-2012 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
  */
 /********************************************************
@@ -145,12 +149,11 @@ static t_u8 *
 wlan_11d_code_2_region(pmlan_adapter pmadapter, t_u8 code)
 {
        t_u8 i;
-       t_u8 size = sizeof(region_code_mapping) / sizeof(region_code_mapping_t);
 
        ENTER();
 
        /* Look for code in mapping table */
-       for (i = 0; i < size; i++) {
+       for (i = 0; i < NELEMENTS(region_code_mapping); i++) {
                if (region_code_mapping[i].code == code) {
                        LEAVE();
                        return region_code_mapping[i].region;
@@ -441,12 +444,10 @@ wlan_11d_get_chan(pmlan_adapter pmadapter, t_u8 band, t_u8 first_chan,
        ENTER();
        if (band & (BAND_B | BAND_G | BAND_GN | BAND_GAC)) {
                cfp = channel_freq_power_UN_BG;
-               cfp_no = sizeof(channel_freq_power_UN_BG) /
-                       sizeof(chan_freq_power_t);
+               cfp_no = NELEMENTS(channel_freq_power_UN_BG);
        } else if (band & (BAND_A | BAND_AN | BAND_AAC)) {
                cfp = channel_freq_power_UN_AJ;
-               cfp_no = sizeof(channel_freq_power_UN_AJ) /
-                       sizeof(chan_freq_power_t);
+               cfp_no = NELEMENTS(channel_freq_power_UN_AJ);
        } else {
                PRINTM(MERROR, "11D: Wrong Band[%d]\n", band);
                LEAVE();
@@ -1065,12 +1066,10 @@ wlan_11d_chan_2_freq(pmlan_adapter pmadapter, t_u8 chan, t_u8 band)
        /* Get channel-frequency-power trios */
        if (band & (BAND_A | BAND_AN | BAND_AAC)) {
                cf = channel_freq_power_UN_AJ;
-               cnt = sizeof(channel_freq_power_UN_AJ) /
-                       sizeof(chan_freq_power_t);
+               cnt = NELEMENTS(channel_freq_power_UN_AJ);
        } else {
                cf = channel_freq_power_UN_BG;
-               cnt = sizeof(channel_freq_power_UN_BG) /
-                       sizeof(chan_freq_power_t);
+               cnt = NELEMENTS(channel_freq_power_UN_BG);
        }
 
        /* Locate channel and return corresponding frequency */
@@ -1095,7 +1094,6 @@ mlan_status
 wlan_11d_set_universaltable(mlan_private * pmpriv, t_u8 band)
 {
        mlan_adapter *pmadapter = pmpriv->adapter;
-       t_u16 size = sizeof(chan_freq_power_t);
        t_u16 i = 0;
 
        ENTER();
@@ -1108,7 +1106,7 @@ wlan_11d_set_universaltable(mlan_private * pmpriv, t_u8 band)
        {
                /* Set channel-frequency-power */
                pmadapter->universal_channel[i].num_cfp =
-                       (t_u8) (sizeof(channel_freq_power_UN_BG) / size);
+                       NELEMENTS(channel_freq_power_UN_BG);
                PRINTM(MINFO, "11D: BG-band num_cfp=%d\n",
                       pmadapter->universal_channel[i].num_cfp);
 
@@ -1132,7 +1130,7 @@ wlan_11d_set_universaltable(mlan_private * pmpriv, t_u8 band)
 
                /* Set channel-frequency-power */
                pmadapter->universal_channel[i].num_cfp =
-                       sizeof(channel_freq_power_UN_AJ) / size;
+                       NELEMENTS(channel_freq_power_UN_AJ);
                PRINTM(MINFO, "11D: AJ-band num_cfp=%d\n",
                       pmadapter->universal_channel[i].num_cfp);
 
index f2b22f5..c6a7d16 100644 (file)
@@ -2,20 +2,24 @@
  *
  *  @brief This file contains functions for 802.11H.
  *
- *  Copyright (C) 2008-2012, Marvell International Ltd.
- *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  (C) Copyright 2008-2012 Marvell International Ltd. All Rights Reserved
+ *
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
  */
 
index 3e8a2f1..da57532 100644 (file)
@@ -3,20 +3,24 @@
  *  @brief This header file contains data structures and
  *  function declarations of 802.11h
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
  */
 
index e40516c..a3ad3fa 100644 (file)
@@ -2,20 +2,24 @@
  *
  *  @brief This file contains functions for 11n handling.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
- *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
+ *
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
  */
 
index 4b08a98..270fd6e 100644 (file)
@@ -5,20 +5,24 @@
  *  Driver interface functions and type declarations for the 11n module
  *    implemented in mlan_11n.c.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
  */
 
index de6bb88..cdbd50a 100644 (file)
@@ -2,20 +2,24 @@
  *
  *  @brief This file contains functions for 11n Aggregation.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
  */
 
@@ -419,6 +423,11 @@ wlan_11n_aggregate_pkt(mlan_private * priv, raListTbl * pra_list,
                                                      priv->wmm.
                                                      ra_list_spinlock);
 
+               if (pmbuf_src->flags & MLAN_BUF_FLAG_TCP_ACK)
+                       pmadapter->callbacks.moal_tcp_ack_tx_ind(pmadapter->
+                                                                pmoal_handle,
+                                                                pmbuf_src);
+
                pkt_size += wlan_11n_form_amsdu_pkt(pmadapter,
                                                    (data + pkt_size),
                                                    pmbuf_src->pbuf +
@@ -512,7 +521,6 @@ wlan_11n_aggregate_pkt(mlan_private * priv, raListTbl * pra_list,
                wlan_write_data_complete(pmadapter, pmbuf_aggr, ret);
                goto exit;
        case MLAN_STATUS_PENDING:
-               pmadapter->data_sent = MFALSE;
                break;
        case MLAN_STATUS_SUCCESS:
                wlan_write_data_complete(pmadapter, pmbuf_aggr, ret);
index 859ccef..99e28f0 100644 (file)
@@ -3,20 +3,24 @@
  *  @brief This file contains related macros, enum, and struct
  *  of 11n aggregation functionalities
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
  */
 
index 06a8a74..58008af 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file contains the handling of RxReordering in wlan
  *  driver.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
@@ -131,7 +136,14 @@ static void
 mlan_11n_rxreorder_timer_restart(pmlan_adapter pmadapter,
                                 RxReorderTbl * rx_reor_tbl_ptr)
 {
+       t_u16 min_flush_time = 0;
        ENTER();
+
+       if (rx_reor_tbl_ptr->win_size >= 32)
+               min_flush_time = MIN_FLUSH_TIMER_15_MS;
+       else
+               min_flush_time = MIN_FLUSH_TIMER_MS;
+
        if (rx_reor_tbl_ptr->timer_context.timer_is_set)
                pmadapter->callbacks.moal_stop_timer(pmadapter->pmoal_handle,
                                                     rx_reor_tbl_ptr->
@@ -141,7 +153,7 @@ mlan_11n_rxreorder_timer_restart(pmlan_adapter pmadapter,
                                              rx_reor_tbl_ptr->timer_context.
                                              timer, MFALSE,
                                              (rx_reor_tbl_ptr->win_size *
-                                              MIN_FLUSH_TIMER_MS));
+                                              min_flush_time));
 
        rx_reor_tbl_ptr->timer_context.timer_is_set = MTRUE;
        LEAVE();
@@ -327,7 +339,7 @@ wlan_11n_delete_rxreorder_tbl_entry(mlan_private * priv,
                                                      pmadapter->prx_proc_lock);
                PRINTM(MEVENT, "wlan: wait rx work done...\n");
                wlan_recv_event(wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY),
-                               MLAN_EVENT_ID_FLUSH_RX_WORK, MNULL);
+                               MLAN_EVENT_ID_DRV_FLUSH_RX_WORK, MNULL);
        } else {
                pmadapter->callbacks.moal_spin_unlock(pmadapter->pmoal_handle,
                                                      pmadapter->prx_proc_lock);
@@ -662,7 +674,6 @@ wlan_cmd_11n_addba_rspgen(mlan_private * priv,
        tid = (padd_ba_rsp->block_ack_param_set & BLOCKACKPARAM_TID_MASK)
                >> BLOCKACKPARAM_TID_POS;
        if (priv->addba_reject[tid]
-           || (priv->port_ctrl_mode == MTRUE && priv->port_open == MFALSE)
 #ifdef STA_SUPPORT
            || ((GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA)
                && priv->wps.session_enable)
index 9e10d1b..4a54843 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file contains related macros, enum, and struct
  *  of 11n RxReordering functionalities
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
index 68e8cfe..db2a8b8 100644 (file)
@@ -4,20 +4,25 @@
  *  @brief This file contains WLAN client mode channel, frequency and power
  *  related code
  *
- *  Copyright (C) 2009-2012, Marvell International Ltd.
+ *  (C) Copyright 2009-2012 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /*************************************************************
@@ -235,60 +240,50 @@ static cfp_table_t cfp_table_BG[] = {
        {
         0x01,                  /* Brazil */
         channel_freq_power_BR_BG,
-        sizeof(channel_freq_power_BR_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_BR_BG),
+        },
        {0x10,                  /* US FCC */
         channel_freq_power_US_BG,
-        sizeof(channel_freq_power_US_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_US_BG),
+        },
        {0x20,                  /* CANADA IC */
         channel_freq_power_US_BG,
-        sizeof(channel_freq_power_US_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_US_BG),
+        },
        {0x30,                  /* EU */
         channel_freq_power_EU_BG,
-        sizeof(channel_freq_power_EU_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_EU_BG),
+        },
        {0x32,                  /* FRANCE */
         channel_freq_power_FR_BG,
-        sizeof(channel_freq_power_FR_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_FR_BG),
+        },
        {0x40,                  /* JAPAN */
         channel_freq_power_JPN40_BG,
-        sizeof(channel_freq_power_JPN40_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_JPN40_BG),
+        },
        {0x41,                  /* JAPAN */
         channel_freq_power_JPN41_BG,
-        sizeof(channel_freq_power_JPN41_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_JPN41_BG),
+        },
        {0x50,                  /* China */
         channel_freq_power_EU_BG,
-        sizeof(channel_freq_power_EU_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_EU_BG),
+        },
        {
         0xfe,                  /* JAPAN */
         channel_freq_power_JPNFE_BG,
-        sizeof(channel_freq_power_JPNFE_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_JPNFE_BG),
+        },
        {0xff,                  /* Special */
         channel_freq_power_SPECIAL_BG,
-        sizeof(channel_freq_power_SPECIAL_BG) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_SPECIAL_BG),
+        },
 /* Add new region here */
 };
 
 /** Number of the CFP tables for 2.4GHz */
-#define MLAN_CFP_TABLE_SIZE_BG  (sizeof(cfp_table_BG)/sizeof(cfp_table_t))
+#define MLAN_CFP_TABLE_SIZE_BG  (NELEMENTS(cfp_table_BG))
 
 /* Format { Channel, Frequency (MHz), MaxTxPower, DFS } */
 /** Band: 'A', Region: USA FCC, Spain, France */
@@ -572,127 +567,102 @@ static chan_freq_power_t channel_freq_power_low_high_band[] = {
 static cfp_table_t cfp_table_A[] = {
        {0x1,                   /* Low band (5150-5250 MHz) channels */
         channel_freq_power_low_band,
-        sizeof(channel_freq_power_low_band) / sizeof(chan_freq_power_t)
-        }
-       ,
+        NELEMENTS(channel_freq_power_low_band)
+        },
        {0x2,                   /* Lower middle band (5250-5350 MHz) channels */
         channel_freq_power_lower_middle_band,
-        sizeof(channel_freq_power_lower_middle_band) /
-        sizeof(chan_freq_power_t)
-        }
-       ,
+        NELEMENTS(channel_freq_power_lower_middle_band)
+        },
        {0x3,                   /* Upper middle band (5470-5725 MHz) channels */
         channel_freq_power_upper_middle_band,
-        sizeof(channel_freq_power_upper_middle_band) /
-        sizeof(chan_freq_power_t)
-        }
-       ,
+        NELEMENTS(channel_freq_power_upper_middle_band)
+        },
        {0x4,                   /* High band (5725-5850 MHz) channels */
         channel_freq_power_high_band,
-        sizeof(channel_freq_power_high_band) / sizeof(chan_freq_power_t)
-        }
-       ,
+        NELEMENTS(channel_freq_power_high_band)
+        },
        {0x5,                   /* Low band (5150-5250 MHz) and High band
                                   (5725-5850 MHz) channels */
         channel_freq_power_low_high_band,
-        sizeof(channel_freq_power_low_high_band) / sizeof(chan_freq_power_t)
-        }
-       ,
+        NELEMENTS(channel_freq_power_low_high_band)
+        },
        {0x06,                  /* GERMANY */
         channel_freq_power_GRM_A,
-        sizeof(channel_freq_power_GRM_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_GRM_A),
+        },
        {0x07,                  /* SPAIN */
         channel_freq_power_SPN0_A,
-        sizeof(channel_freq_power_SPN0_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_SPN0_A),
+        },
        {0x08,                  /* SPAIN */
         channel_freq_power_SPN1_A,
-        sizeof(channel_freq_power_SPN1_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_SPN1_A),
+        },
        {0x09,                  /* SPAIN/Austria/Brazil */
         channel_freq_power_SPN2_A,
-        sizeof(channel_freq_power_SPN2_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_SPN2_A),
+        },
        {0x0a,                  /* SPAIN/Austria */
         channel_freq_power_SPN3_A,
-        sizeof(channel_freq_power_SPN3_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_SPN3_A),
+        },
        {0x0b,                  /* Austria */
         channel_freq_power_AT_A,
-        sizeof(channel_freq_power_AT_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_AT_A),
+        },
        {0x0c,                  /* Brazil */
         channel_freq_power_BR1_A,
-        sizeof(channel_freq_power_BR1_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_BR1_A),
+        },
        {0x0e,                  /* Brazil */
         channel_freq_power_BR2_A,
-        sizeof(channel_freq_power_BR2_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_BR2_A),
+        },
        {0x0f,                  /* Russia */
         channel_freq_power_RU_A,
-        sizeof(channel_freq_power_RU_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_RU_A),
+        },
        {0x10,                  /* US FCC */
         channel_freq_power_A,
-        sizeof(channel_freq_power_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_A),
+        },
        {0x20,                  /* CANADA IC */
         channel_freq_power_CAN_A,
-        sizeof(channel_freq_power_CAN_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_CAN_A),
+        },
        {0x30,                  /* EU */
         channel_freq_power_EU_A,
-        sizeof(channel_freq_power_EU_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_EU_A),
+        },
        {0x32,                  /* FRANCE */
         channel_freq_power_A,
-        sizeof(channel_freq_power_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_A),
+        },
        {0x40,                  /* JAPAN */
         channel_freq_power_JPN_A,
-        sizeof(channel_freq_power_JPN_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_JPN_A),
+        },
        {0x41,                  /* JAPAN */
         channel_freq_power_JPN_A,
-        sizeof(channel_freq_power_JPN_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_JPN_A),
+        },
        {0x50,                  /* China */
         channel_freq_power_CN_A,
-        sizeof(channel_freq_power_CN_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_CN_A),
+        },
        {0xfe,                  /* JAPAN */
         channel_freq_power_NULL_A,
-        sizeof(channel_freq_power_NULL_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_NULL_A),
+        },
        {0xff,                  /* Special */
         channel_freq_power_JPN_A,
-        sizeof(channel_freq_power_JPN_A) / sizeof(chan_freq_power_t),
-        }
-       ,
+        NELEMENTS(channel_freq_power_JPN_A),
+        },
 /* Add new region here */
 };
 
 /** Number of the CFP tables for 5GHz */
-#define MLAN_CFP_TABLE_SIZE_A   (sizeof(cfp_table_A)/sizeof(cfp_table_t))
+#define MLAN_CFP_TABLE_SIZE_A   (NELEMENTS(cfp_table_A))
 
 /********************************************************
                        Global Variables
index 3084af7..1298528 100644 (file)
@@ -3,20 +3,25 @@
  *
  *  @brief This file contains the handling of CMD/EVENT in MLAN
  *
- *  Copyright (C) 2009-2011, Marvell International Ltd.
- *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  (C) Copyright 2009-2011 Marvell International Ltd. All Rights Reserved
+ *
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
+ *
  */
 
 /*************************************************************
@@ -135,6 +140,9 @@ wlan_dump_info(mlan_adapter * pmadapter, t_u8 reason)
        t_u32 sec = 0, usec = 0;
 #endif
        t_u8 i;
+#ifdef SDIO_MULTI_PORT_TX_AGGR
+       t_u8 j;
+#endif
        t_u16 cmd_id, cmd_act;
        mlan_private *pmpriv = MNULL;
 
@@ -266,6 +274,25 @@ wlan_dump_info(mlan_adapter * pmadapter, t_u8 reason)
               pmadapter->mp_rd_bitmap, pmadapter->curr_rd_port);
        PRINTM(MERROR, "mp_wr_bitmap=0x%x curr_wr_port=0x%x\n",
               pmadapter->mp_wr_bitmap, pmadapter->curr_wr_port);
+#ifdef SDIO_MULTI_PORT_TX_AGGR
+       PRINTM(MERROR, "last_recv_wr_bitmap=0x%x last_mp_index=%d\n",
+              pmadapter->last_recv_wr_bitmap, pmadapter->last_mp_index);
+       for (i = 0; i < SDIO_MP_DBG_NUM; i++) {
+               PRINTM(MERROR,
+                      "mp_wr_bitmap: 0x%x mp_wr_ports=0x%x len=%d curr_wr_port=0x%x\n",
+                      pmadapter->last_mp_wr_bitmap[i],
+                      pmadapter->last_mp_wr_ports[i],
+                      pmadapter->last_mp_wr_len[i],
+                      pmadapter->last_curr_wr_port[i]);
+               for (j = 0; j < SDIO_MP_AGGR_DEF_PKT_LIMIT; j++) {
+                       PRINTM(MERROR, "0x%02x ",
+                              pmadapter->last_mp_wr_info[i *
+                                                         SDIO_MP_AGGR_DEF_PKT_LIMIT
+                                                         + j]);
+               }
+               PRINTM(MERROR, "\n");
+       }
+#endif
        if (reason != REASON_CODE_CMD_TIMEOUT) {
                if ((pmadapter->dbg.num_no_cmd_node >= 5)
                    || (pmadapter->pm_wakeup_card_req &&
@@ -332,7 +359,7 @@ wlan_atox(t_u8 * a)
  *  @brief This function parse cal data from ASCII to hex
  *
  *  @param src          A pointer to source data
- *  @param len          Source dara length
+ *  @param len          Source data length
  *  @param dst          A pointer to a buf to store the parsed data
  *
  *  @return             The parsed hex data length
@@ -681,6 +708,7 @@ wlan_dnld_cmd_to_fw(IN mlan_private * pmpriv, IN cmd_ctrl_node * pcmd_node)
        mlan_ioctl_req *pioctl_buf = MNULL;
        t_u16 cmd_code;
        t_u16 cmd_size;
+       t_u32 age_ts_usec;
 #ifdef DEBUG_LEVEL1
        t_u32 sec = 0, usec = 0;
 #endif
@@ -785,6 +813,9 @@ wlan_dnld_cmd_to_fw(IN mlan_private * pmpriv, IN cmd_ctrl_node * pcmd_node)
                }
                goto done;
        }
+       pmadapter->callbacks.moal_get_system_time(pmadapter->pmoal_handle,
+                                                 &pmadapter->dnld_cmd_in_secs,
+                                                 &age_ts_usec);
 
        /* Setup the timer after transmit command */
        pcb->moal_start_timer(pmadapter->pmoal_handle,
@@ -811,7 +842,7 @@ static mlan_status
 wlan_dnld_sleep_confirm_cmd(mlan_adapter * pmadapter)
 {
        mlan_status ret = MLAN_STATUS_SUCCESS;
-       static t_u32 i = 0;
+       static t_u32 i;
        t_u16 cmd_len = 0;
        opt_sleep_confirm_buffer *sleep_cfm_buf =
                (opt_sleep_confirm_buffer *) (pmadapter->psleep_cfm->pbuf +
@@ -2877,43 +2908,32 @@ wlan_cmd_tx_rate_cfg(IN pmlan_private pmpriv,
                        wlan_cpu_to_le16(pbitmap_rates[0]);
                rate_scope->ofdm_rate_bitmap =
                        wlan_cpu_to_le16(pbitmap_rates[1]);
-               for (i = 0;
-                    i < sizeof(rate_scope->ht_mcs_rate_bitmap) / sizeof(t_u16);
-                    i++)
+               for (i = 0; i < NELEMENTS(rate_scope->ht_mcs_rate_bitmap); i++)
                        rate_scope->ht_mcs_rate_bitmap[i] =
                                wlan_cpu_to_le16(pbitmap_rates[2 + i]);
-               for (i = 0;
-                    i <
-                    sizeof(rate_scope->vht_mcs_rate_bitmap) / sizeof(t_u16);
-                    i++)
+               for (i = 0; i < NELEMENTS(rate_scope->vht_mcs_rate_bitmap); i++)
                        rate_scope->vht_mcs_rate_bitmap[i] =
                                wlan_cpu_to_le16(pbitmap_rates
                                                 [2 +
-                                                 sizeof(rate_scope->
-                                                        ht_mcs_rate_bitmap) /
-                                                 sizeof(t_u16) + i]);
+                                                 NELEMENTS(rate_scope->
+                                                           ht_mcs_rate_bitmap)
+                                                 + i]);
        } else {
                rate_scope->hr_dsss_rate_bitmap =
                        wlan_cpu_to_le16(pmpriv->bitmap_rates[0]);
                rate_scope->ofdm_rate_bitmap =
                        wlan_cpu_to_le16(pmpriv->bitmap_rates[1]);
-               for (i = 0;
-                    i < sizeof(rate_scope->ht_mcs_rate_bitmap) / sizeof(t_u16);
-                    i++)
+               for (i = 0; i < NELEMENTS(rate_scope->ht_mcs_rate_bitmap); i++)
                        rate_scope->ht_mcs_rate_bitmap[i] =
                                wlan_cpu_to_le16(pmpriv->bitmap_rates[2 + i]);
-               for (i = 0;
-                    i <
-                    sizeof(rate_scope->vht_mcs_rate_bitmap) / sizeof(t_u16);
-                    i++)
+               for (i = 0; i < NELEMENTS(rate_scope->vht_mcs_rate_bitmap); i++)
                        rate_scope->vht_mcs_rate_bitmap[i] =
                                wlan_cpu_to_le16(pmpriv->
                                                 bitmap_rates[2 +
-                                                             sizeof
+                                                             NELEMENTS
                                                              (rate_scope->
                                                               ht_mcs_rate_bitmap)
-                                                             / sizeof(t_u16) +
-                                                             i]);
+                                                             + i]);
        }
 
        rate_drop = (MrvlRateDropPattern_t *) ((t_u8 *) rate_scope +
@@ -2983,16 +3003,14 @@ wlan_ret_tx_rate_cfg(IN pmlan_private pmpriv,
                        pmpriv->bitmap_rates[1] =
                                wlan_le16_to_cpu(prate_scope->ofdm_rate_bitmap);
                        for (i = 0;
-                            i <
-                            sizeof(prate_scope->ht_mcs_rate_bitmap) /
-                            sizeof(t_u16); i++)
+                            i < NELEMENTS(prate_scope->ht_mcs_rate_bitmap);
+                            i++)
                                pmpriv->bitmap_rates[2 + i] =
                                        wlan_le16_to_cpu(prate_scope->
                                                         ht_mcs_rate_bitmap[i]);
                        for (i = 0;
-                            i <
-                            sizeof(prate_scope->vht_mcs_rate_bitmap) /
-                            sizeof(t_u16); i++)
+                            i < NELEMENTS(prate_scope->vht_mcs_rate_bitmap);
+                            i++)
                                pmpriv->bitmap_rates[2 +
                                                     sizeof(prate_scope->
                                                            ht_mcs_rate_bitmap)
@@ -3398,18 +3416,15 @@ wlan_cmd_multi_chan_policy(IN pmlan_private pmpriv,
 
        cmd->command = wlan_cpu_to_le16(HostCmd_CMD_MULTI_CHAN_POLICY);
        pmulti_chan_policy->action = wlan_cpu_to_le16(cmd_action);
+       cmd->size =
+               wlan_cpu_to_le16(S_DS_GEN +
+                                sizeof(HostCmd_DS_MULTI_CHAN_POLICY));
        if (cmd_action == HostCmd_ACT_GEN_SET) {
                policy = *((t_u16 *) pdata_buf);
                pmulti_chan_policy->policy = wlan_cpu_to_le16(policy);
                PRINTM(MCMND, "Set multi-channel policy: %d\n",
                       pmulti_chan_policy->policy);
-               cmd->size =
-                       wlan_cpu_to_le16(S_DS_GEN +
-                                        sizeof(HostCmd_DS_MULTI_CHAN_POLICY));
-       } else {
-               cmd->size = wlan_cpu_to_le16(S_DS_GEN + sizeof(cmd_action));
        }
-
        LEAVE();
        return MLAN_STATUS_SUCCESS;
 }
@@ -3945,6 +3960,186 @@ wlan_ret_wifi_direct_mode(IN pmlan_private pmpriv,
        LEAVE();
        return MLAN_STATUS_SUCCESS;
 }
+
+/**
+ *  @brief This function prepares command of p2p_params_config.
+ *
+ *  @param pmpriv       A pointer to mlan_private structure
+ *  @param cmd          A pointer to HostCmd_DS_COMMAND structure
+ *  @param cmd_action   The action: GET or SET
+ *  @param pdata_buf    A pointer to data buffer
+ *
+ *  @return             MLAN_STATUS_SUCCESS
+ */
+mlan_status
+wlan_cmd_p2p_params_config(IN pmlan_private pmpriv,
+                          IN HostCmd_DS_COMMAND * cmd,
+                          IN t_u16 cmd_action, IN t_void * pdata_buf)
+{
+       HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG *p2p_config =
+               &cmd->params.p2p_params_config;
+       mlan_ds_wifi_direct_config *cfg =
+               (mlan_ds_wifi_direct_config *) pdata_buf;
+       MrvlIEtypes_NoA_setting_t *pNoA_tlv = MNULL;
+       MrvlIEtypes_OPP_PS_setting_t *pOPP_PS_tlv = MNULL;
+       t_u8 *tlv = MNULL;
+       ENTER();
+
+       cmd->size = sizeof(HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG) + S_DS_GEN;
+       cmd->command = wlan_cpu_to_le16(HOST_CMD_P2P_PARAMS_CONFIG);
+       p2p_config->action = wlan_cpu_to_le16(cmd_action);
+       if (cmd_action == HostCmd_ACT_GEN_SET) {
+               tlv = (t_u8 *) p2p_config +
+                       sizeof(HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG);
+               if (cfg->flags & WIFI_DIRECT_NOA) {
+                       pNoA_tlv = (MrvlIEtypes_NoA_setting_t *) tlv;
+                       pNoA_tlv->header.type =
+                               wlan_cpu_to_le16(TLV_TYPE_WIFI_DIRECT_NOA);
+                       pNoA_tlv->header.len =
+                               wlan_cpu_to_le16(sizeof
+                                                (MrvlIEtypes_NoA_setting_t) -
+                                                sizeof(MrvlIEtypesHeader_t));
+                       pNoA_tlv->enable = cfg->noa_enable;
+                       pNoA_tlv->index = wlan_cpu_to_le16(cfg->index);
+                       pNoA_tlv->noa_count = cfg->noa_count;
+                       pNoA_tlv->noa_duration =
+                               wlan_cpu_to_le32(cfg->noa_duration);
+                       pNoA_tlv->noa_interval =
+                               wlan_cpu_to_le32(cfg->noa_interval);
+                       cmd->size += sizeof(MrvlIEtypes_NoA_setting_t);
+                       tlv += sizeof(MrvlIEtypes_NoA_setting_t);
+                       PRINTM(MCMND,
+                              "Set NOA: enable=%d index=%d, count=%d, duration=%d interval=%d\n",
+                              cfg->noa_enable, cfg->index, cfg->noa_count,
+                              (int)cfg->noa_duration, (int)cfg->noa_interval);
+               }
+               if (cfg->flags & WIFI_DIRECT_OPP_PS) {
+                       pOPP_PS_tlv = (MrvlIEtypes_OPP_PS_setting_t *) tlv;
+                       pOPP_PS_tlv->header.type =
+                               wlan_cpu_to_le16(TLV_TYPE_WIFI_DIRECT_OPP_PS);
+                       pOPP_PS_tlv->header.len =
+                               wlan_cpu_to_le16(sizeof
+                                                (MrvlIEtypes_OPP_PS_setting_t)
+                                                - sizeof(MrvlIEtypesHeader_t));
+                       pOPP_PS_tlv->enable = cfg->opp_ps_enable;
+                       pOPP_PS_tlv->ct_window = cfg->ct_window;
+                       cmd->size += sizeof(MrvlIEtypes_OPP_PS_setting_t);
+                       PRINTM(MCMND, "Set OPP_PS: enable=%d ct_win=%d\n",
+                              cfg->opp_ps_enable, cfg->ct_window);
+               }
+       }
+       cmd->size = wlan_cpu_to_le16(cmd->size);
+       LEAVE();
+       return MLAN_STATUS_SUCCESS;
+}
+
+/**
+ *  @brief This function handles the command response of p2p_params_config
+ *
+ *  @param pmpriv       A pointer to mlan_private structure
+ *  @param resp         A pointer to HostCmd_DS_COMMAND
+ *  @param pioctl_buf   A pointer to mlan_ioctl_req structure
+ *
+ *  @return             MLAN_STATUS_SUCCESS
+ */
+mlan_status
+wlan_ret_p2p_params_config(IN pmlan_private pmpriv,
+                          IN HostCmd_DS_COMMAND * resp,
+                          IN mlan_ioctl_req * pioctl_buf)
+{
+       HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG *p2p_config =
+               &resp->params.p2p_params_config;
+       mlan_ds_misc_cfg *cfg = MNULL;
+       MrvlIEtypes_NoA_setting_t *pNoA_tlv = MNULL;
+       MrvlIEtypes_OPP_PS_setting_t *pOPP_PS_tlv = MNULL;
+       MrvlIEtypesHeader_t *tlv = MNULL;
+       t_u16 tlv_buf_left = 0;
+       t_u16 tlv_type = 0;
+       t_u16 tlv_len = 0;
+
+       ENTER();
+       if (wlan_le16_to_cpu(p2p_config->action) == HostCmd_ACT_GEN_GET) {
+               if (pioctl_buf) {
+                       cfg = (mlan_ds_misc_cfg *) pioctl_buf->pbuf;
+                       tlv = (MrvlIEtypesHeader_t *) ((t_u8 *) p2p_config +
+                                                      sizeof
+                                                      (HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG));
+                       tlv_buf_left =
+                               resp->size -
+                               (sizeof(HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG) +
+                                S_DS_GEN);
+                       while (tlv_buf_left >= sizeof(MrvlIEtypesHeader_t)) {
+                               tlv_type = wlan_le16_to_cpu(tlv->type);
+                               tlv_len = wlan_le16_to_cpu(tlv->len);
+                               if (tlv_buf_left <
+                                   (tlv_len + sizeof(MrvlIEtypesHeader_t))) {
+                                       PRINTM(MERROR,
+                                              "Error processing p2p param config TLVs, bytes left < TLV length\n");
+                                       break;
+                               }
+                               switch (tlv_type) {
+                               case TLV_TYPE_WIFI_DIRECT_NOA:
+                                       pNoA_tlv =
+                                               (MrvlIEtypes_NoA_setting_t *)
+                                               tlv;
+                                       cfg->param.p2p_config.flags |=
+                                               WIFI_DIRECT_NOA;
+                                       cfg->param.p2p_config.noa_enable =
+                                               pNoA_tlv->enable;
+                                       cfg->param.p2p_config.index =
+                                               wlan_le16_to_cpu(pNoA_tlv->
+                                                                index);
+                                       cfg->param.p2p_config.noa_count =
+                                               pNoA_tlv->noa_count;
+                                       cfg->param.p2p_config.noa_duration =
+                                               wlan_le32_to_cpu(pNoA_tlv->
+                                                                noa_duration);
+                                       cfg->param.p2p_config.noa_interval =
+                                               wlan_le32_to_cpu(pNoA_tlv->
+                                                                noa_interval);
+                                       PRINTM(MCMND,
+                                              "Get NOA: enable=%d index=%d, count=%d, duration=%d interval=%d\n",
+                                              cfg->param.p2p_config.noa_enable,
+                                              cfg->param.p2p_config.index,
+                                              cfg->param.p2p_config.noa_count,
+                                              (int)cfg->param.p2p_config.
+                                              noa_duration,
+                                              (int)cfg->param.p2p_config.
+                                              noa_interval);
+                                       break;
+                               case TLV_TYPE_SSID:
+                                       pOPP_PS_tlv =
+                                               (MrvlIEtypes_OPP_PS_setting_t *)
+                                               tlv;
+                                       cfg->param.p2p_config.flags |=
+                                               WIFI_DIRECT_OPP_PS;
+                                       cfg->param.p2p_config.opp_ps_enable =
+                                               pOPP_PS_tlv->enable;
+                                       cfg->param.p2p_config.ct_window =
+                                               pOPP_PS_tlv->ct_window;
+                                       PRINTM(MCMND,
+                                              "Get OPP_PS: enable=%d ct_win=%d\n",
+                                              cfg->param.p2p_config.
+                                              opp_ps_enable,
+                                              cfg->param.p2p_config.ct_window);
+                                       break;
+                               default:
+                                       break;
+                               }
+                               tlv_buf_left -=
+                                       tlv_len + sizeof(MrvlIEtypesHeader_t);
+                               tlv = (MrvlIEtypesHeader_t *) ((t_u8 *) tlv +
+                                                              tlv_len +
+                                                              sizeof
+                                                              (MrvlIEtypesHeader_t));
+                       }
+                       pioctl_buf->data_read_written =
+                               sizeof(mlan_ds_wifi_direct_config);
+               }
+       }
+       LEAVE();
+       return MLAN_STATUS_SUCCESS;
+}
 #endif
 
 /**
index 1454adc..460215b 100644 (file)
@@ -2,20 +2,25 @@
  *
  *  @brief This file declares the generic data structures and APIs.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /******************************************************
@@ -27,7 +32,7 @@ Change log:
 #define _MLAN_DECL_H_
 
 /** MLAN release version */
-#define MLAN_RELEASE_VERSION           "413"
+#define MLAN_RELEASE_VERSION           "429"
 
 /** Re-define generic data types for MLAN/MOAL */
 /** Signed char (1-byte) */
@@ -241,6 +246,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
 
 /** define allocated buffer size */
 #define ALLOC_BUF_SIZE           (4 * 1024)
+/** SDIO MP aggr pkt limit */
+#define SDIO_MP_AGGR_DEF_PKT_LIMIT       (16)
 
 /** SDIO IO Port mask */
 #define MLAN_SDIO_IO_PORT_MASK         0xfffff
@@ -268,6 +275,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
 /** Buffer flag for bridge packet */
 #define MLAN_BUF_FLAG_BRIDGE_BUF        MBIT(3)
 
+#define MLAN_BUF_FLAG_TCP_ACK          MBIT(9)
+
 #ifdef DEBUG_LEVEL1
 /** Debug level bit definition */
 #define        MMSG        MBIT(0)
@@ -415,6 +424,8 @@ typedef enum _mlan_event_id {
        MLAN_EVENT_ID_UAP_FW_STA_DISCONNECT = 0x00000031,
 #endif
 
+       MLAN_EVENT_ID_FW_DUMP_INFO = 0x00000033,
+
        /* Event generated by MLAN driver (MSB=1) */
        MLAN_EVENT_ID_DRV_CONNECTED = 0x80000001,
        MLAN_EVENT_ID_DRV_DEFER_HANDLING = 0x80000002,
@@ -429,7 +440,8 @@ typedef enum _mlan_event_id {
        MLAN_EVENT_ID_DRV_REPORT_STRING = 0x8000000F,
        MLAN_EVENT_ID_DRV_DBG_DUMP = 0x80000012,
        MLAN_EVENT_ID_DRV_BGSCAN_RESULT = 0x80000013,
-       MLAN_EVENT_ID_FLUSH_RX_WORK = 0x80000015,
+       MLAN_EVENT_ID_DRV_FLUSH_RX_WORK = 0x80000015,
+       MLAN_EVENT_ID_DRV_DEFER_RX_WORK = 0x80000016,
 } mlan_event_id;
 
 /** Data Structures */
@@ -785,6 +797,10 @@ typedef struct _mlan_callbacks {
                                      IN t_u32 bss_index, IN t_u32 level);
     /** moal_assert */
         t_void(*moal_assert) (IN t_void * pmoal_handle, IN t_u32 cond);
+
+    /** moal_tcp_ack_tx_ind */
+        t_void(*moal_tcp_ack_tx_ind) (IN t_void * pmoal_handle,
+                                      IN pmlan_buffer pmbuf);
 } mlan_callbacks, *pmlan_callbacks;
 
 /** Interrupt Mode SDIO */
@@ -827,6 +843,12 @@ typedef struct _mlan_device {
     /** SDIO MPA Rx */
        t_u32 mpa_rx_cfg;
 #endif
+#if defined(SDIO_MULTI_PORT_TX_AGGR) || defined(SDIO_MULTI_PORT_RX_AGGR)
+       /* see blk_queue_max_segment_size */
+       t_u32 max_seg_size;
+       /* see blk_queue_max_segments */
+       t_u8 max_segs;
+#endif
     /** Auto deep sleep */
        t_u32 auto_ds;
     /** IEEE PS mode */
@@ -837,6 +859,9 @@ typedef struct _mlan_device {
     /** 802.11d configuration */
        t_u32 cfg_11d;
 #endif
+    /** enable/disable rx work */
+       t_u8 rx_work;
+
 } mlan_device, *pmlan_device;
 
 /** MLAN API function prototype */
index 8f8075f..504fb80 100644 (file)
@@ -4,20 +4,25 @@
  *  structures and declares global function prototypes used
  *  in MLAN module.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /******************************************************
@@ -102,7 +107,7 @@ typedef MLAN_PACK_START struct {
 #ifdef STA_SUPPORT
 /** Firmware multiple bands support */
 #define FW_MULTI_BANDS_SUPPORT  (MBIT(8)  | MBIT(9)  | MBIT(10) | MBIT(11) | \
-                                MBIT(12) | MBIT(13))
+                                                       MBIT(12) | MBIT(13))
 #else
 /** Firmware multiple bands support */
 #define FW_MULTI_BANDS_SUPPORT  (MBIT(8) | MBIT(9) | MBIT(10))
@@ -490,7 +495,7 @@ typedef enum _WLAN_802_11_WEP_STATUS {
 #define DEFAULT_11N_CAP_MASK_BG (HWSPEC_SHORTGI20_SUPP | HWSPEC_RXSTBC_SUPP)
 /** Default 11n capability mask for 5GHz */
 #define DEFAULT_11N_CAP_MASK_A  (HWSPEC_CHANBW40_SUPP | HWSPEC_SHORTGI20_SUPP | \
-                                HWSPEC_SHORTGI40_SUPP | HWSPEC_RXSTBC_SUPP)
+                                                       HWSPEC_SHORTGI40_SUPP | HWSPEC_RXSTBC_SUPP)
 /** Bits to ignore in hw_dev_cap as these bits are set in get_hw_spec */
 #define IGN_HW_DEV_CAP         (CAPINFO_40MHZ_INTOLARENT)
 
@@ -667,6 +672,12 @@ typedef enum _WLAN_802_11_WEP_STATUS {
 #define SET_EXTCAP_OPERMODENTF(ext_cap) (ext_cap.OperModeNtf = 1)
 /** ExtCap : Reset support Operation Mode Notification */
 #define RESET_EXTCAP_OPERMODENTF(ext_cap) (ext_cap.OperModeNtf = 0)
+/** ExtCap : Support for QosMap */
+#define ISSUPP_EXTCAP_QOS_MAP(ext_cap) (ext_cap.Qos_Map)
+/** ExtCap : Set Support QosMap */
+#define SET_EXTCAP_QOS_MAP(ext_cap) (ext_cap.Qos_Map = 1)
+/** ExtCap : Reset support QosMap */
+#define RESET_EXTCAP_QOS_MAP(ext_cap) (ext_cap.Qos_Map = 0)
 
 /** LLC/SNAP header len   */
 #define LLC_SNAP_LEN    8
@@ -1056,6 +1067,8 @@ typedef enum _WLAN_802_11_WEP_STATUS {
 #define HostCmd_CMD_CFG_TX_DATA_PAUSE           0x0103
 
 #ifdef WIFI_DIRECT_SUPPORT
+/** Host Command ID: P2P PARAMS CONFIG */
+#define HOST_CMD_P2P_PARAMS_CONFIG              0x00ea
 /** Host Command ID: WIFI_DIRECT_MODE_CONFIG */
 #define HOST_CMD_WIFI_DIRECT_MODE_CONFIG       0x00eb
 /** Host Command ID: Remain On Channel */
@@ -1349,6 +1362,7 @@ typedef enum _ENH_PS_MODES {
 /** Event ID: Multi Chan Info*/
 #define EVENT_MULTI_CHAN_INFO               0x0000006a
 
+#define EVENT_FW_DUMP_INFO             0x0000FFFE
 /** Event ID mask */
 #define EVENT_ID_MASK                   0xffff
 
@@ -2793,6 +2807,41 @@ typedef MLAN_PACK_START struct _HostCmd_DS_WIFI_DIRECT_MODE {
     /**0:disable 1:listen 2:GO 3:p2p client 4:find 5:stop find*/
        t_u16 mode;
 } MLAN_PACK_END HostCmd_DS_WIFI_DIRECT_MODE;
+
+/** MrvlIEtypes_NoA_setting_t */
+typedef MLAN_PACK_START struct _MrvlIEtypes_NoA_setting_t {
+    /** Header */
+       MrvlIEtypesHeader_t header;
+    /** enable/disable */
+       t_u8 enable;
+    /** index */
+       t_u16 index;
+    /** NoA count */
+       t_u8 noa_count;
+    /** NoA duration */
+       t_u32 noa_duration;
+    /** NoA interval */
+       t_u32 noa_interval;
+} MLAN_PACK_END MrvlIEtypes_NoA_setting_t;
+
+/** MrvlIEtypes_NoA_setting_t */
+typedef MLAN_PACK_START struct _MrvlIEtypes_OPP_PS_setting_t {
+    /** Header */
+       MrvlIEtypesHeader_t header;
+    /** enable/disable */
+       t_u8 enable;
+    /** CT window value */
+       t_u8 ct_window;
+} MLAN_PACK_END MrvlIEtypes_OPP_PS_setting_t;
+
+/** HostCmd_DS_REMAIN_ON_CHANNEL */
+typedef MLAN_PACK_START struct _HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG {
+    /** Action 0-GET, 1-SET */
+       t_u16 action;
+    /** MrvlIEtypes_NoA_setting_t
+     *  MrvlIEtypes_OPP_PS_setting_t
+     */
+} MLAN_PACK_END HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG;
 #endif
 
 #ifdef STA_SUPPORT
@@ -3967,6 +4016,10 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_MacAddr_t {
 #ifdef WIFI_DIRECT_SUPPORT
 /** TLV type : AP PSK */
 #define TLV_TYPE_UAP_PSK   (PROPRIETARY_TLV_BASE_ID + 0xa8)    /* 0x01a8 */
+/** TLV type : p2p NOA */
+#define TLV_TYPE_WIFI_DIRECT_NOA            (PROPRIETARY_TLV_BASE_ID + 0x83)
+/** TLV type : p2p opp ps */
+#define TLV_TYPE_WIFI_DIRECT_OPP_PS         (PROPRIETARY_TLV_BASE_ID + 0x84)
 #endif /* WIFI_DIRECT_SUPPORT */
 
 /** MrvlIEtypes_beacon_period_t */
@@ -4911,6 +4964,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
 #ifdef WIFI_DIRECT_SUPPORT
                HostCmd_DS_REMAIN_ON_CHANNEL remain_on_chan;
                HostCmd_DS_WIFI_DIRECT_MODE wifi_direct_mode;
+               HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG p2p_params_config;
 #endif
                HostCmd_DS_HS_WAKEUP_REASON hs_wakeup_reason;
                HostCmd_DS_MULTI_CHAN_CFG multi_chan_cfg;
index 7cbc042..07ff91e 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file contains IEEE information element related
  *  definitions used in MLAN and MOAL module.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /******************************************************
@@ -63,6 +68,9 @@ typedef enum _WLAN_802_11_NETWORK_TYPE {
 #pragma pack(push, 1)
 #endif
 
+/* Reason codes */
+#define  IEEE_80211_REASONCODE_UNSPECIFIED       1
+
 /** IEEE Type definitions  */
 typedef MLAN_PACK_START enum _IEEEtypes_ElementId_e {
        SSID = 0,
@@ -169,7 +177,7 @@ typedef MLAN_PACK_START struct _TLV_Generic_t {
 
 /** Capability information mask */
 #define CAPINFO_MASK    (~(MBIT(15) | MBIT(14) |            \
-                           MBIT(12) | MBIT(11) | MBIT(9)))
+                                                       MBIT(12) | MBIT(11) | MBIT(9)))
 
 /** Capability Bit Map*/
 #ifdef BIG_ENDIAN_SUPPORT
index 097c96a..dbff624 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file contains the initialization for FW
  *  and HW.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
@@ -292,13 +297,14 @@ wlan_init_priv(pmlan_private priv)
        priv->sec_info.wep_status = Wlan802_11WEPDisabled;
        priv->sec_info.authentication_mode = MLAN_AUTH_MODE_AUTO;
        priv->sec_info.encryption_mode = MLAN_ENCRYPTION_MODE_NONE;
-       for (i = 0; i < sizeof(priv->wep_key) / sizeof(priv->wep_key[0]); i++)
+       for (i = 0; i < MRVL_NUM_WEP_KEY; i++)
                memset(pmadapter, &priv->wep_key[i], 0, sizeof(mrvl_wep_key_t));
        priv->wep_key_curr_index = 0;
        priv->ewpa_query = MFALSE;
        priv->adhoc_aes_enabled = MFALSE;
        priv->curr_pkt_filter =
                HostCmd_ACT_MAC_STATIC_DYNAMIC_BW_ENABLE |
+               HostCmd_ACT_MAC_RTS_CTS_ENABLE |
                HostCmd_ACT_MAC_RX_ON | HostCmd_ACT_MAC_TX_ON |
                HostCmd_ACT_MAC_ETHERNETII_ENABLE;
 
@@ -380,6 +386,8 @@ wlan_init_priv(pmlan_private priv)
 
        for (i = 0; i < MAX_NUM_TID; i++)
                priv->addba_reject[i] = ADDBA_RSP_STATUS_ACCEPT;
+       priv->addba_reject[6] = ADDBA_RSP_STATUS_REJECT;
+       priv->addba_reject[7] = ADDBA_RSP_STATUS_REJECT;
        priv->max_amsdu = 0;
 
        if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA) {
@@ -833,8 +841,7 @@ wlan_free_lock_list(IN pmlan_adapter pmadapter)
                            &pmadapter->rx_data_queue, pcb->moal_free_lock);
 
        util_scalar_free((t_void *) pmadapter->pmoal_handle,
-                        &pmadapter->rx_pkts_queued,
-                        priv->adapter->callbacks.moal_free_lock);
+                        &pmadapter->rx_pkts_queued, pcb->moal_free_lock);
 
        util_free_list_head((t_void *) pmadapter->pmoal_handle,
                            &pmadapter->cmd_free_q,
index c5e444b..65ac015 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file defines the FW initialization data
  *  structures.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /******************************************************
index 4158bca..85d84ef 100644 (file)
@@ -2,20 +2,25 @@
  *
  *  @brief This file declares the IOCTL data structures and APIs.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /******************************************************
@@ -235,6 +240,9 @@ enum _mlan_ioctl_req_id {
 #endif
        MLAN_OID_MISC_MULTI_CHAN_CFG = 0x00200023,
        MLAN_OID_MISC_MULTI_CHAN_POLICY = 0x00200024,
+#ifdef WIFI_DIRECT_SUPPORT
+       MLAN_OID_MISC_WIFI_DIRECT_CONFIG = 0x00200025,
+#endif
 };
 
 /** Sub command size */
@@ -1321,6 +1329,11 @@ typedef struct {
 /** Debug command number */
 #define DBG_CMD_NUM    10
 
+#ifdef SDIO_MULTI_PORT_TX_AGGR
+/** sdio mp debug number */
+#define SDIO_MP_DBG_NUM                  6
+#endif
+
 /** mlan_debug_info data structure for MLAN_OID_GET_DEBUG_INFO */
 typedef struct _mlan_debug_info {
        /* WMM AC_BK count */
@@ -1391,6 +1404,32 @@ typedef struct _mlan_debug_info {
        t_u32 num_int_read_failure;
     /** Last interrupt status */
        t_u32 last_int_status;
+#ifdef SDIO_MULTI_PORT_TX_AGGR
+    /** Number of packets tx aggr */
+       t_u32 mpa_tx_count[SDIO_MP_AGGR_DEF_PKT_LIMIT];
+    /** no more packets count*/
+       t_u32 mpa_sent_last_pkt;
+    /** no write_ports count */
+       t_u32 mpa_sent_no_ports;
+       /** last recv wr_bitmap */
+       t_u32 last_recv_wr_bitmap;
+    /** last mp_wr_bitmap */
+       t_u32 last_mp_wr_bitmap[SDIO_MP_DBG_NUM];
+    /** last ports for cmd53 write data */
+       t_u32 last_mp_wr_ports[SDIO_MP_DBG_NUM];
+       /** last len for cmd53 write data */
+       t_u32 last_mp_wr_len[SDIO_MP_DBG_NUM];
+    /** last curr_wr_port */
+       t_u8 last_curr_wr_port[SDIO_MP_DBG_NUM];
+    /** length info for cmd53 write data */
+       t_u16 last_mp_wr_info[SDIO_MP_DBG_NUM * SDIO_MP_AGGR_DEF_PKT_LIMIT];
+    /** last mp_index */
+       t_u8 last_mp_index;
+#endif
+#ifdef SDIO_MULTI_PORT_RX_AGGR
+    /** Number of packets rx aggr */
+       t_u32 mpa_rx_count[SDIO_MP_AGGR_DEF_PKT_LIMIT];
+#endif
     /** Number of deauthentication events */
        t_u32 num_event_deauth;
     /** Number of disassosiation events */
@@ -1427,6 +1466,10 @@ typedef struct _mlan_debug_info {
        t_u16 last_event_index;
     /** Number of no free command node */
        t_u16 num_no_cmd_node;
+    /** pending command id */
+       t_u16 pending_cmd;
+    /** time stamp for dnld last cmd */
+       t_u32 dnld_cmd_in_secs;
     /** Corresponds to data_sent member of mlan_adapter */
        t_u8 data_sent;
     /** Corresponds to cmd_sent member of mlan_adapter */
@@ -1498,7 +1541,7 @@ typedef struct _mlan_ds_get_info {
        /** BSS information for MLAN_OID_GET_BSS_INFO */
                mlan_bss_info bss_info;
        /** Debug information for MLAN_OID_GET_DEBUG_INFO */
-               mlan_debug_info debug_info;
+               t_u8 debug_info[1];
 #ifdef UAP_SUPPORT
        /** UAP Statistics information for MLAN_OID_GET_STATS */
                mlan_ds_uap_stats ustats;
@@ -2248,7 +2291,7 @@ typedef struct _mlan_ds_wmm_addts {
     /** Dialog token */
        t_u8 dialog_tok;
     /** TSPEC data length */
-       t_u8 ie_data_len;
+       t_u32 ie_data_len;
     /** TSPEC to send in the ADDTS + buffering for any extra IEs */
        t_u8 ie_data[MLAN_WMM_TSPEC_SIZE + MLAN_WMM_ADDTS_EXTRA_IE_BYTES];
 } mlan_ds_wmm_addts, *pmlan_ds_wmm_addts;
@@ -3015,6 +3058,32 @@ typedef struct _mlan_ds_misc_otp_user_data {
        t_u8 user_data[MAX_OTP_USER_DATA_LEN];
 } mlan_ds_misc_otp_user_data;
 
+#ifdef WIFI_DIRECT_SUPPORT
+/** flag for NOA */
+#define WIFI_DIRECT_NOA         1
+/** flag for OPP_PS */
+#define WIFI_DIRECT_OPP_PS      2
+/** Type definition of mlan_ds_wifi_direct_config for MLAN_OID_MISC_WIFI_DIRECT_CONFIG */
+typedef struct _mlan_ds_wifi_direct_config {
+    /** flags for NOA/OPP_PS */
+       t_u8 flags;
+     /** NoA enable/disable */
+       t_u8 noa_enable;
+    /** index */
+       t_u16 index;
+    /** NoA count */
+       t_u8 noa_count;
+    /** NoA duration */
+       t_u32 noa_duration;
+    /** NoA interval */
+       t_u32 noa_interval;
+    /** opp ps enable/disable */
+       t_u8 opp_ps_enable;
+    /** CT window value */
+       t_u8 ct_window;
+} mlan_ds_wifi_direct_config;
+#endif
+
 #if defined(STA_SUPPORT)
 typedef struct _mlan_ds_misc_pmfcfg {
     /** Management Frame Protection Capable */
@@ -3096,6 +3165,9 @@ typedef struct _mlan_ds_misc_cfg {
                mlan_ds_multi_chan_cfg multi_chan_cfg;
        /** Multi-channel policy for MLAN_OID_MISC_MULTI_CHAN_POLICY */
                t_u16 multi_chan_policy;
+#ifdef WIFI_DIRECT_SUPPORT
+               mlan_ds_wifi_direct_config p2p_config;
+#endif
        } param;
 } mlan_ds_misc_cfg, *pmlan_ds_misc_cfg;
 
index 16ff951..3028f43 100644 (file)
@@ -6,20 +6,26 @@
  *  for sending adhoc start, adhoc join, and association commands
  *  to the firmware.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
+ *
+ *  @sa mlan_join.h
  */
 
 /******************************************************
@@ -419,7 +425,7 @@ wlan_cmd_append_wapi_ie(mlan_private * priv, t_u8 ** ppBuffer)
 }
 
 /********************************************************
-                Global Functions
+                               Global Functions
 ********************************************************/
 /**
  *  @brief This function updates RSN IE in the association request.
@@ -1356,9 +1362,10 @@ wlan_cmd_802_11_ad_hoc_start(IN mlan_private * pmpriv,
                }
        }
        /* Find the last non zero */
-       for (i = 0;
-            i < sizeof(padhoc_start->DataRate) && padhoc_start->DataRate[i];
-            i++) ;
+       for (i = 0; i < sizeof(padhoc_start->DataRate)
+            && padhoc_start->DataRate[i]; i++)
+               /* XXX Do not delete no-operation line */
+               ;
 
        pmpriv->curr_bss_params.num_of_rates = i;
 
@@ -1713,13 +1720,10 @@ wlan_cmd_802_11_ad_hoc_join(IN mlan_private * pmpriv,
               MAC2STR(padhoc_join->bss_descriptor.bssid),
               padhoc_join->bss_descriptor.ssid);
 
-       for (i = 0; i < WLAN_SUPPORTED_RATES && pbss_desc->supported_rates[i]; i++) ;   /* XXX
-                                                                                          Do
-                                                                                          not
-                                                                                          delete
-                                                                                          no-operation
-                                                                                          line
-                                                                                        */
+       for (i = 0; i < WLAN_SUPPORTED_RATES && pbss_desc->supported_rates[i];
+            i++)
+               /* XXX Do not delete no-operation line */
+               ;
        rates_size = i;
 
        /* Copy Data Rates from the Rates recorded in scan response */
index 2464109..8e7e492 100644 (file)
@@ -7,20 +7,26 @@
  *  implemented in mlan_join.c.  Process all start/join requests for
  *  both adhoc and infrastructure networks
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
+ *
+ *  @sa mlan_join.c
  */
 
 /******************************************************
index e49187b..7bbf862 100644 (file)
@@ -4,20 +4,25 @@
  *  structures and declares global function prototypes used
  *  in MLAN module.
  *
- *  Copyright (C) 2008-2012, Marvell International Ltd.
+ *  (C) Copyright 2008-2012 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /******************************************************
@@ -41,11 +46,11 @@ extern t_u32 mlan_drvdbg;
 
 #ifdef DEBUG_LEVEL2
 #define        PRINTM_MINFO(msg...)  do {if ((mlan_drvdbg & MINFO) && (print_callback)) \
-                                 print_callback(MNULL, MINFO, msg); } while(0)
+                                 print_callback(MNULL, MINFO, msg); } while (0)
 #define        PRINTM_MWARN(msg...)  do {if ((mlan_drvdbg & MWARN) && (print_callback)) \
-                                 print_callback(MNULL, MWARN, msg); } while(0)
+                                 print_callback(MNULL, MWARN, msg); } while (0)
 #define        PRINTM_MENTRY(msg...) do {if ((mlan_drvdbg & MENTRY) && (print_callback)) \
-                                 print_callback(MNULL, MENTRY, msg); } while(0)
+                                 print_callback(MNULL, MENTRY, msg); } while (0)
 #define PRINTM_GET_SYS_TIME(level, psec, pusec)              \
 do {                                                         \
        if ((level & mlan_drvdbg) && (get_sys_time_callback))\
@@ -68,7 +73,7 @@ do {                \
 #define PRINTM_GET_SYS_TIME(level, psec, pusec)         \
 do {                                                    \
        if ((level & mlan_drvdbg) && (get_sys_time_callback)     \
-               && (level != MINFO) && (level != MWARN))    \
+                       && (level != MINFO) && (level != MWARN))    \
            get_sys_time_callback(MNULL, psec, pusec);      \
 } while (0)
 
@@ -78,30 +83,30 @@ do {                                                    \
 #endif /* DEBUG_LEVEL2 */
 
 #define        PRINTM_MFW_D(msg...)  do {if ((mlan_drvdbg & MFW_D) && (print_callback)) \
-                                 print_callback(MNULL, MFW_D, msg); } while(0)
+                                 print_callback(MNULL, MFW_D, msg); } while (0)
 #define        PRINTM_MCMD_D(msg...) do {if ((mlan_drvdbg & MCMD_D) && (print_callback)) \
-                                 print_callback(MNULL, MCMD_D, msg); } while(0)
+                                 print_callback(MNULL, MCMD_D, msg); } while (0)
 #define        PRINTM_MDAT_D(msg...) do {if ((mlan_drvdbg & MDAT_D) && (print_callback)) \
-                                 print_callback(MNULL, MDAT_D, msg); } while(0)
+                                 print_callback(MNULL, MDAT_D, msg); } while (0)
 #define        PRINTM_MIF_D(msg...) do {if ((mlan_drvdbg & MIF_D) && (print_callback)) \
-                                 print_callback(MNULL, MIF_D, msg); } while(0)
+                                 print_callback(MNULL, MIF_D, msg); } while (0)
 
 #define        PRINTM_MIOCTL(msg...) do {if ((mlan_drvdbg & MIOCTL) && (print_callback)) \
-                                 print_callback(MNULL, MIOCTL, msg); } while(0)
+                                 print_callback(MNULL, MIOCTL, msg); } while (0)
 #define        PRINTM_MINTR(msg...)  do {if ((mlan_drvdbg & MINTR) && (print_callback)) \
-                                 print_callback(MNULL, MINTR, msg); } while(0)
+                                 print_callback(MNULL, MINTR, msg); } while (0)
 #define        PRINTM_MEVENT(msg...) do {if ((mlan_drvdbg & MEVENT) && (print_callback)) \
-                                 print_callback(MNULL, MEVENT, msg); } while(0)
+                                 print_callback(MNULL, MEVENT, msg); } while (0)
 #define        PRINTM_MCMND(msg...)  do {if ((mlan_drvdbg & MCMND) && (print_callback)) \
-                                 print_callback(MNULL, MCMND, msg); } while(0)
+                                 print_callback(MNULL, MCMND, msg); } while (0)
 #define        PRINTM_MDATA(msg...)  do {if ((mlan_drvdbg & MDATA) && (print_callback)) \
-                                 print_callback(MNULL, MDATA, msg); } while(0)
+                                 print_callback(MNULL, MDATA, msg); } while (0)
 #define        PRINTM_MERROR(msg...) do {if ((mlan_drvdbg & MERROR) && (print_callback)) \
-                                 print_callback(MNULL, MERROR, msg); } while(0)
+                                 print_callback(MNULL, MERROR, msg); } while (0)
 #define        PRINTM_MFATAL(msg...) do {if ((mlan_drvdbg & MFATAL) && (print_callback)) \
-                                 print_callback(MNULL, MFATAL, msg); } while(0)
+                                 print_callback(MNULL, MFATAL, msg); } while (0)
 #define        PRINTM_MMSG(msg...)   do {if ((mlan_drvdbg & MMSG) && (print_callback)) \
-                                 print_callback(MNULL, MMSG, msg); } while(0)
+                                 print_callback(MNULL, MMSG, msg); } while (0)
 
 #define        PRINTM(level, msg...) PRINTM_##level((char *)msg)
 
@@ -110,7 +115,7 @@ do {                                                    \
 #define PRINTM_NETINTF(level, pmpriv)   \
 do {                                    \
        if ((mlan_drvdbg & level) && pmpriv      \
-               && pmpriv->adapter->callbacks.moal_print_netintf) \
+                       && pmpriv->adapter->callbacks.moal_print_netintf) \
            pmpriv->adapter->callbacks.moal_print_netintf( \
                    pmpriv->adapter->pmoal_handle, \
                    pmpriv->bss_index, level); \
@@ -139,7 +144,7 @@ do {                \
 /** Hexdump for debugging */
 #define HEXDUMP(x, y, z) do {} while (0)
 
-#define PRINTM_GET_SYS_TIME(level, psec, pusec) do { } while(0)
+#define PRINTM_GET_SYS_TIME(level, psec, pusec) do { } while (0)
 
 #endif /* DEBUG_LEVEL1 */
 
@@ -306,12 +311,12 @@ do {                                    \
        if (!(cond)) {                      \
            PRINTM(MFATAL, "ASSERT: %s: %i\n", __FUNCTION__, __LINE__); \
            if (assert_callback) {          \
-               assert_callback(MNULL, (t_ptr)(cond)); \
+                       assert_callback(MNULL, (t_ptr)(cond)); \
            } else {                        \
-               do {} while(1);             \
+                       do {} while (1);             \
            }                               \
        }                                   \
-} while(0)
+} while (0)
 
 /** Upload size */
 #define WLAN_UPLD_SIZE                  (2312)
@@ -432,8 +437,8 @@ do {                                    \
 
 /** Is cmd_resp, event or data packet received? */
 #define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \
-                                 adapter->event_received || \
-                                 adapter->data_received)
+                                                               adapter->event_received || \
+                                                               adapter->data_received)
 /** Type command */
 #define MLAN_TYPE_CMD                  1
 /** Type data */
@@ -447,12 +452,10 @@ do {                                    \
 
 /** Maximum port */
 #define MAX_PORT                       32
-/** Multi port aggregation packet limit */
-#define SDIO_MP_AGGR_DEF_PKT_LIMIT       (16)
 
 #ifdef SDIO_MULTI_PORT_TX_AGGR
 /** Multi port TX aggregation buffer size */
-#define SDIO_MP_TX_AGGR_DEF_BUF_SIZE        (16384)    /* 16K */
+#define SDIO_MP_TX_AGGR_DEF_BUF_SIZE        (32768)    /* 32K */
 #endif /* SDIO_MULTI_PORT_TX_AGGR */
 
 #ifdef SDIO_MULTI_PORT_RX_AGGR
@@ -554,6 +557,9 @@ typedef enum _PS_STATE {
 
 /** Minimum flush timer for win size of 1 is 50 ms */
 #define MIN_FLUSH_TIMER_MS 50
+/** Minimum flush timer for win size of 1 is 15 ms */
+#define MIN_FLUSH_TIMER_15_MS 15
+
 /** Tx BA stream table */
 typedef struct _TxBAStreamTbl TxBAStreamTbl;
 
@@ -1386,6 +1392,26 @@ typedef struct {
 
 } wlan_meas_state_t;
 
+#if defined(SDIO_MULTI_PORT_TX_AGGR) || defined(SDIO_MULTI_PORT_RX_AGGR)
+/**
+ *  @brief Link buffer into aggregate head buffer
+ *
+ *  @param pmbuf_aggr  Pointer to aggregation buffer
+ *  @param pmbuf               Pointer to buffer to copy
+ */
+static inline t_void
+wlan_link_buf_to_aggr(pmlan_buffer pmbuf_aggr, pmlan_buffer pmbuf)
+{
+       /* link new buf at end of list */
+       pmbuf->pnext = pmbuf_aggr;
+       pmbuf->pprev = pmbuf_aggr->pprev;
+       pmbuf->pparent = pmbuf_aggr;
+       pmbuf_aggr->pprev->pnext = pmbuf;
+       pmbuf_aggr->pprev = pmbuf;
+       pmbuf_aggr->use_count++;
+}
+#endif
+
 #ifdef SDIO_MULTI_PORT_TX_AGGR
 /** data structure for SDIO MPA TX */
 typedef struct _sdio_mpa_tx {
@@ -1407,6 +1433,10 @@ typedef struct _sdio_mpa_tx {
        t_u32 buf_size;
        /** multiport tx aggregation pkt aggr limit */
        t_u32 pkt_aggr_limit;
+    /** multiport write info */
+       t_u16 mp_wr_info[SDIO_MP_AGGR_DEF_PKT_LIMIT];
+    /** multiport rx aggregation mbuf array */
+       pmlan_buffer mbuf_arr[SDIO_MP_AGGR_DEF_PKT_LIMIT];
 } sdio_mpa_tx;
 #endif
 
@@ -1497,6 +1527,8 @@ typedef struct _mlan_adapter {
        t_u32 mlan_rx_processing;
     /** rx_proc_lock for main_rx_process */
        t_void *prx_proc_lock;
+    /** rx work enable flag */
+       t_u8 rx_work_flag;
        /* number of rx pkts queued */
        mlan_scalar rx_pkts_queued;
     /** more task flag */
@@ -1544,19 +1576,49 @@ typedef struct _mlan_adapter {
        t_u8 curr_rd_port;
     /** Current available port for write */
        t_u8 curr_wr_port;
+    /** last SDIO multiple port group registers */
+       t_u8 last_mp_regs[MAX_MP_REGS];
     /** Array to store values of SDIO multiple port group registers */
        t_u8 *mp_regs;
     /** allocated buf to read SDIO multiple port group registers */
        t_u8 *mp_regs_buf;
+#if defined(SDIO_MULTI_PORT_TX_AGGR) || defined(SDIO_MULTI_PORT_RX_AGGR)
+       /* see blk_queue_max_segment_size */
+       t_u32 max_seg_size;
+       /* see blk_queue_max_segments */
+       t_u8 max_segs;
+#endif
 
 #ifdef SDIO_MULTI_PORT_TX_AGGR
        /** data structure for SDIO MPA TX */
        sdio_mpa_tx mpa_tx;
+    /** packet number for tx aggr */
+       t_u32 mpa_tx_count[SDIO_MP_AGGR_DEF_PKT_LIMIT];
+    /** no more packets count*/
+       t_u32 mpa_sent_last_pkt;
+    /** no write_ports count */
+       t_u32 mpa_sent_no_ports;
+    /** last wr_bitmap from FW */
+       t_u32 last_recv_wr_bitmap;
+    /** last mp_wr_bitmap */
+       t_u32 last_mp_wr_bitmap[SDIO_MP_DBG_NUM];
+    /** last ports for cmd53 write data */
+       t_u32 last_mp_wr_ports[SDIO_MP_DBG_NUM];
+    /** last length for cmd53 write data */
+       t_u32 last_mp_wr_len[SDIO_MP_DBG_NUM];
+    /** length info for cmd53 write data */
+       t_u16 last_mp_wr_info[SDIO_MP_DBG_NUM * SDIO_MP_AGGR_DEF_PKT_LIMIT];
+    /** last curr_wr_port */
+       t_u8 last_curr_wr_port[SDIO_MP_DBG_NUM];
+    /** last mp_index */
+       t_u8 last_mp_index;
 #endif                         /* SDIO_MULTI_PORT_TX_AGGR */
 
 #ifdef SDIO_MULTI_PORT_RX_AGGR
        /** data structure for SDIO MPA RX */
        sdio_mpa_rx mpa_rx;
+    /** packet number for tx aggr */
+       t_u32 mpa_rx_count[SDIO_MP_AGGR_DEF_PKT_LIMIT];
 #endif                         /* SDIO_MULTI_PORT_RX_AGGR */
 
     /** SDIO interrupt mode (0: INT_MODE_SDIO, 1: INT_MODE_GPIO) */
@@ -1616,6 +1678,8 @@ typedef struct _mlan_adapter {
        t_void *pmlan_cmd_timer;
     /** Command timer set flag */
        t_u8 cmd_timer_is_set;
+    /** time stamp for command dnld */
+       t_u32 dnld_cmd_in_secs;
 
     /** Command Queues */
     /** Free command buffers */
@@ -2050,6 +2114,15 @@ mlan_status wlan_cmd_remain_on_channel(IN pmlan_private pmpriv,
 mlan_status wlan_ret_remain_on_channel(IN pmlan_private pmpriv,
                                       IN HostCmd_DS_COMMAND * resp,
                                       IN mlan_ioctl_req * pioctl_buf);
+mlan_status wlan_cmd_p2p_params_config(IN pmlan_private pmpriv,
+                                      IN HostCmd_DS_COMMAND * cmd,
+                                      IN t_u16 cmd_action,
+                                      IN t_void * pdata_buf);
+mlan_status wlan_ret_p2p_params_config(IN pmlan_private pmpriv,
+                                      IN HostCmd_DS_COMMAND * resp,
+                                      IN mlan_ioctl_req * pioctl_buf);
+mlan_status wlan_misc_p2p_config(IN pmlan_adapter pmadapter,
+                                IN pmlan_ioctl_req pioctl_req);
 #endif
 
 /** get pm info */
@@ -2640,9 +2713,9 @@ t_void wlan_delay_func(mlan_adapter * pmadapter, t_u32 delay, t_delay_unit u);
 
 /** Function to check if any command is pending in the queue */
 #define IS_COMMAND_PENDING(pmadapter) ((cmd_ctrl_node *)util_peek_list(pmadapter->pmoal_handle, \
-                                          &pmadapter->cmd_pending_q,\
-                                          pmadapter->callbacks.moal_spin_lock,\
-                                          pmadapter->callbacks.moal_spin_unlock))
+                                                                               &pmadapter->cmd_pending_q,\
+                                                                               pmadapter->callbacks.moal_spin_lock,\
+                                                                               pmadapter->callbacks.moal_spin_unlock))
 
 /** Get BSS number from priv */
 #define GET_BSS_NUM(priv)   ((priv)->bss_num)
index 53caeaa..019eea0 100644 (file)
  *  Requires use of the following preprocessor define:
  *    - ENABLE_MEAS
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
- *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
+ *
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
+ *
  */
 
 /*************************************************************
@@ -348,7 +353,7 @@ wlan_meas_util_send_req(mlan_private * pmpriv,
                        t_u32 wait_for_resp_timeout, pmlan_ioctl_req pioctl_req,
                        HostCmd_DS_MEASUREMENT_REPORT * pmeas_rpt)
 {
-       static t_u8 auto_dialog_tok = 0;
+       static t_u8 auto_dialog_tok;
        wlan_meas_state_t *pmeas_state = &pmpriv->adapter->state_meas;
        int ret;
 
index fea172c..c39ccc3 100644 (file)
@@ -8,20 +8,24 @@
  *
  *  @sa mlan_meas.c
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
  */
 
index 7f20b46..a72fcb7 100644 (file)
@@ -1,22 +1,27 @@
 /**
  * @file mlan_misc.c
  *
- *  @brief This file include miscellaneous functions for MLAN module
- *
- *  Copyright (C) 2009-2011, Marvell International Ltd.
- *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  @brief This file include Miscellaneous functions for MLAN module
+ *
+ *  (C) Copyright 2009-2011 Marvell International Ltd. All Rights Reserved
+ *
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
+ *
  */
 
 /*************************************************************
@@ -373,246 +378,233 @@ wlan_get_info_debug_info(IN pmlan_adapter pmadapter,
        pmlan_private pmpriv = pmadapter->priv[pioctl_req->bss_index];
        mlan_status ret = MLAN_STATUS_SUCCESS;
        mlan_ds_get_info *info;
+       mlan_debug_info *debug_info = MNULL;
        t_u8 *ptid;
 
        ENTER();
 
        info = (mlan_ds_get_info *) pioctl_req->pbuf;
+       debug_info = (mlan_debug_info *) info->param.debug_info;
 
        if (pioctl_req->action == MLAN_ACT_SET) {
                pmadapter->max_tx_buf_size =
-                       (t_u16) info->param.debug_info.max_tx_buf_size;
-               pmadapter->tx_buf_size =
-                       (t_u16) info->param.debug_info.tx_buf_size;
+                       (t_u16) debug_info->max_tx_buf_size;
+               pmadapter->tx_buf_size = (t_u16) debug_info->tx_buf_size;
                pmadapter->curr_tx_buf_size =
-                       (t_u16) info->param.debug_info.curr_tx_buf_size;
-               pmadapter->ps_mode = info->param.debug_info.ps_mode;
-               pmadapter->ps_state = info->param.debug_info.ps_state;
+                       (t_u16) debug_info->curr_tx_buf_size;
+               pmadapter->ps_mode = debug_info->ps_mode;
+               pmadapter->ps_state = debug_info->ps_state;
 #ifdef STA_SUPPORT
-               pmadapter->is_deep_sleep = info->param.debug_info.is_deep_sleep;
+               pmadapter->is_deep_sleep = debug_info->is_deep_sleep;
 #endif /* STA_SUPPORT */
-               pmadapter->pm_wakeup_card_req =
-                       info->param.debug_info.pm_wakeup_card_req;
-               pmadapter->pm_wakeup_fw_try =
-                       info->param.debug_info.pm_wakeup_fw_try;
-               pmadapter->pm_wakeup_in_secs =
-                       info->param.debug_info.pm_wakeup_in_secs;
-               pmadapter->is_hs_configured =
-                       info->param.debug_info.is_hs_configured;
-               pmadapter->hs_activated = info->param.debug_info.hs_activated;
-               pmadapter->pps_uapsd_mode =
-                       info->param.debug_info.pps_uapsd_mode;
-               pmadapter->sleep_period.period =
-                       info->param.debug_info.sleep_pd;
-               pmpriv->wmm_qosinfo = info->param.debug_info.qos_cfg;
-               pmadapter->tx_lock_flag = info->param.debug_info.tx_lock_flag;
-               pmpriv->port_open = info->param.debug_info.port_open;
-               pmadapter->bypass_pkt_count =
-                       info->param.debug_info.bypass_pkt_count;
-               pmadapter->scan_processing =
-                       info->param.debug_info.scan_processing;
+               pmadapter->pm_wakeup_card_req = debug_info->pm_wakeup_card_req;
+               pmadapter->pm_wakeup_fw_try = debug_info->pm_wakeup_fw_try;
+               pmadapter->pm_wakeup_in_secs = debug_info->pm_wakeup_in_secs;
+               pmadapter->is_hs_configured = debug_info->is_hs_configured;
+               pmadapter->hs_activated = debug_info->hs_activated;
+               pmadapter->pps_uapsd_mode = debug_info->pps_uapsd_mode;
+               pmadapter->sleep_period.period = debug_info->sleep_pd;
+               pmpriv->wmm_qosinfo = debug_info->qos_cfg;
+               pmadapter->tx_lock_flag = debug_info->tx_lock_flag;
+               pmpriv->port_open = debug_info->port_open;
+               pmadapter->bypass_pkt_count = debug_info->bypass_pkt_count;
+               pmadapter->scan_processing = debug_info->scan_processing;
                pmadapter->dbg.num_cmd_host_to_card_failure =
-                       info->param.debug_info.num_cmd_host_to_card_failure;
+                       debug_info->num_cmd_host_to_card_failure;
                pmadapter->dbg.num_cmd_sleep_cfm_host_to_card_failure =
-                       info->param.debug_info.
-                       num_cmd_sleep_cfm_host_to_card_failure;
+                       debug_info->num_cmd_sleep_cfm_host_to_card_failure;
                pmadapter->dbg.num_tx_host_to_card_failure =
-                       info->param.debug_info.num_tx_host_to_card_failure;
+                       debug_info->num_tx_host_to_card_failure;
                pmadapter->dbg.num_cmdevt_card_to_host_failure =
-                       info->param.debug_info.num_cmdevt_card_to_host_failure;
+                       debug_info->num_cmdevt_card_to_host_failure;
                pmadapter->dbg.num_rx_card_to_host_failure =
-                       info->param.debug_info.num_rx_card_to_host_failure;
+                       debug_info->num_rx_card_to_host_failure;
                pmadapter->dbg.num_int_read_failure =
-                       info->param.debug_info.num_int_read_failure;
-               pmadapter->dbg.last_int_status =
-                       info->param.debug_info.last_int_status;
-               pmadapter->dbg.num_event_deauth =
-                       info->param.debug_info.num_event_deauth;
+                       debug_info->num_int_read_failure;
+               pmadapter->dbg.last_int_status = debug_info->last_int_status;
+               pmadapter->dbg.num_event_deauth = debug_info->num_event_deauth;
                pmadapter->dbg.num_event_disassoc =
-                       info->param.debug_info.num_event_disassoc;
+                       debug_info->num_event_disassoc;
                pmadapter->dbg.num_event_link_lost =
-                       info->param.debug_info.num_event_link_lost;
-               pmadapter->dbg.num_cmd_deauth =
-                       info->param.debug_info.num_cmd_deauth;
+                       debug_info->num_event_link_lost;
+               pmadapter->dbg.num_cmd_deauth = debug_info->num_cmd_deauth;
                pmadapter->dbg.num_cmd_assoc_success =
-                       info->param.debug_info.num_cmd_assoc_success;
+                       debug_info->num_cmd_assoc_success;
                pmadapter->dbg.num_cmd_assoc_failure =
-                       info->param.debug_info.num_cmd_assoc_failure;
-               pmadapter->dbg.num_tx_timeout =
-                       info->param.debug_info.num_tx_timeout;
-               pmadapter->dbg.num_cmd_timeout =
-                       info->param.debug_info.num_cmd_timeout;
-               pmadapter->dbg.timeout_cmd_id =
-                       info->param.debug_info.timeout_cmd_id;
-               pmadapter->dbg.timeout_cmd_act =
-                       info->param.debug_info.timeout_cmd_act;
+                       debug_info->num_cmd_assoc_failure;
+               pmadapter->dbg.num_tx_timeout = debug_info->num_tx_timeout;
+               pmadapter->dbg.num_cmd_timeout = debug_info->num_cmd_timeout;
+               pmadapter->dbg.timeout_cmd_id = debug_info->timeout_cmd_id;
+               pmadapter->dbg.timeout_cmd_act = debug_info->timeout_cmd_act;
                memcpy(pmadapter, pmadapter->dbg.last_cmd_id,
-                      info->param.debug_info.last_cmd_id,
+                      debug_info->last_cmd_id,
                       sizeof(pmadapter->dbg.last_cmd_id));
                memcpy(pmadapter, pmadapter->dbg.last_cmd_act,
-                      info->param.debug_info.last_cmd_act,
+                      debug_info->last_cmd_act,
                       sizeof(pmadapter->dbg.last_cmd_act));
-               pmadapter->dbg.last_cmd_index =
-                       info->param.debug_info.last_cmd_index;
+               pmadapter->dbg.last_cmd_index = debug_info->last_cmd_index;
                memcpy(pmadapter, pmadapter->dbg.last_cmd_resp_id,
-                      info->param.debug_info.last_cmd_resp_id,
+                      debug_info->last_cmd_resp_id,
                       sizeof(pmadapter->dbg.last_cmd_resp_id));
                pmadapter->dbg.last_cmd_resp_index =
-                       info->param.debug_info.last_cmd_resp_index;
+                       debug_info->last_cmd_resp_index;
                memcpy(pmadapter, pmadapter->dbg.last_event,
-                      info->param.debug_info.last_event,
+                      debug_info->last_event,
                       sizeof(pmadapter->dbg.last_event));
-               pmadapter->dbg.last_event_index =
-                       info->param.debug_info.last_event_index;
-               pmadapter->dbg.num_no_cmd_node =
-                       info->param.debug_info.num_no_cmd_node;
-
-               pmadapter->data_sent = info->param.debug_info.data_sent;
-               pmadapter->cmd_sent = info->param.debug_info.cmd_sent;
-               pmadapter->mp_rd_bitmap = info->param.debug_info.mp_rd_bitmap;
-               pmadapter->mp_wr_bitmap = info->param.debug_info.mp_wr_bitmap;
-               pmadapter->curr_rd_port = info->param.debug_info.curr_rd_port;
-               pmadapter->curr_wr_port = info->param.debug_info.curr_wr_port;
-               pmadapter->cmd_resp_received =
-                       info->param.debug_info.cmd_resp_received;
+               pmadapter->dbg.last_event_index = debug_info->last_event_index;
+               pmadapter->dbg.num_no_cmd_node = debug_info->num_no_cmd_node;
+               pmadapter->dnld_cmd_in_secs = debug_info->dnld_cmd_in_secs;
+               pmadapter->data_sent = debug_info->data_sent;
+               pmadapter->cmd_sent = debug_info->cmd_sent;
+               pmadapter->mp_rd_bitmap = debug_info->mp_rd_bitmap;
+               pmadapter->mp_wr_bitmap = debug_info->mp_wr_bitmap;
+               pmadapter->curr_rd_port = debug_info->curr_rd_port;
+               pmadapter->curr_wr_port = debug_info->curr_wr_port;
+               pmadapter->cmd_resp_received = debug_info->cmd_resp_received;
 #ifdef UAP_SUPPORT
-               pmadapter->pending_bridge_pkts =
-                       info->param.debug_info.num_bridge_pkts;
-               pmpriv->num_drop_pkts = info->param.debug_info.num_drop_pkts;
+               pmadapter->pending_bridge_pkts = debug_info->num_bridge_pkts;
+               pmpriv->num_drop_pkts = debug_info->num_drop_pkts;
 #endif
-               pmadapter->mlan_processing =
-                       info->param.debug_info.mlan_processing;
-               pmadapter->mlan_rx_processing =
-                       info->param.debug_info.mlan_rx_processing;
+               pmadapter->mlan_processing = debug_info->mlan_processing;
+               pmadapter->mlan_rx_processing = debug_info->mlan_rx_processing;
        } else {                /* MLAN_ACT_GET */
                ptid = ac_to_tid[WMM_AC_BK];
-               info->param.debug_info.wmm_ac_bk =
+               debug_info->wmm_ac_bk =
                        pmpriv->wmm.packets_out[ptid[0]] +
                        pmpriv->wmm.packets_out[ptid[1]];
                ptid = ac_to_tid[WMM_AC_BE];
-               info->param.debug_info.wmm_ac_be =
+               debug_info->wmm_ac_be =
                        pmpriv->wmm.packets_out[ptid[0]] +
                        pmpriv->wmm.packets_out[ptid[1]];
                ptid = ac_to_tid[WMM_AC_VI];
-               info->param.debug_info.wmm_ac_vi =
+               debug_info->wmm_ac_vi =
                        pmpriv->wmm.packets_out[ptid[0]] +
                        pmpriv->wmm.packets_out[ptid[1]];
                ptid = ac_to_tid[WMM_AC_VO];
-               info->param.debug_info.wmm_ac_vo =
+               debug_info->wmm_ac_vo =
                        pmpriv->wmm.packets_out[ptid[0]] +
                        pmpriv->wmm.packets_out[ptid[1]];
-               info->param.debug_info.max_tx_buf_size =
+               debug_info->max_tx_buf_size =
                        (t_u32) pmadapter->max_tx_buf_size;
-               info->param.debug_info.tx_buf_size =
-                       (t_u32) pmadapter->tx_buf_size;
-               info->param.debug_info.curr_tx_buf_size =
+               debug_info->tx_buf_size = (t_u32) pmadapter->tx_buf_size;
+               debug_info->curr_tx_buf_size =
                        (t_u32) pmadapter->curr_tx_buf_size;
-               info->param.debug_info.rx_tbl_num =
-                       wlan_get_rxreorder_tbl(pmpriv,
-                                              info->param.debug_info.rx_tbl);
-               info->param.debug_info.tx_tbl_num =
-                       wlan_get_txbastream_tbl(pmpriv,
-                                               info->param.debug_info.tx_tbl);
-               info->param.debug_info.ps_mode = pmadapter->ps_mode;
-               info->param.debug_info.ps_state = pmadapter->ps_state;
+               debug_info->rx_tbl_num =
+                       wlan_get_rxreorder_tbl(pmpriv, debug_info->rx_tbl);
+               debug_info->tx_tbl_num =
+                       wlan_get_txbastream_tbl(pmpriv, debug_info->tx_tbl);
+               debug_info->ps_mode = pmadapter->ps_mode;
+               debug_info->ps_state = pmadapter->ps_state;
 #ifdef STA_SUPPORT
-               info->param.debug_info.is_deep_sleep = pmadapter->is_deep_sleep;
+               debug_info->is_deep_sleep = pmadapter->is_deep_sleep;
 #endif /* STA_SUPPORT */
-               info->param.debug_info.pm_wakeup_card_req =
-                       pmadapter->pm_wakeup_card_req;
-               info->param.debug_info.pm_wakeup_fw_try =
-                       pmadapter->pm_wakeup_fw_try;
-               info->param.debug_info.pm_wakeup_in_secs =
-                       pmadapter->pm_wakeup_in_secs;
-               info->param.debug_info.is_hs_configured =
-                       pmadapter->is_hs_configured;
-               info->param.debug_info.hs_activated = pmadapter->hs_activated;
-               info->param.debug_info.pps_uapsd_mode =
-                       pmadapter->pps_uapsd_mode;
-               info->param.debug_info.sleep_pd =
-                       pmadapter->sleep_period.period;
-               info->param.debug_info.qos_cfg = pmpriv->wmm_qosinfo;
-               info->param.debug_info.tx_lock_flag = pmadapter->tx_lock_flag;
-               info->param.debug_info.port_open = pmpriv->port_open;
-               info->param.debug_info.bypass_pkt_count =
-                       pmadapter->bypass_pkt_count;
-               info->param.debug_info.scan_processing =
-                       pmadapter->scan_processing;
-               info->param.debug_info.num_cmd_host_to_card_failure =
-                       pmadapter->dbg.num_cmd_host_to_card_failure;
-               info->param.debug_info.num_cmd_sleep_cfm_host_to_card_failure =
-                       pmadapter->dbg.num_cmd_sleep_cfm_host_to_card_failure;
-               info->param.debug_info.num_tx_host_to_card_failure =
-                       pmadapter->dbg.num_tx_host_to_card_failure;
-               info->param.debug_info.num_cmdevt_card_to_host_failure =
-                       pmadapter->dbg.num_cmdevt_card_to_host_failure;
-               info->param.debug_info.num_rx_card_to_host_failure =
-                       pmadapter->dbg.num_rx_card_to_host_failure;
-               info->param.debug_info.num_int_read_failure =
+               debug_info->pm_wakeup_card_req = pmadapter->pm_wakeup_card_req;
+               debug_info->pm_wakeup_fw_try = pmadapter->pm_wakeup_fw_try;
+               debug_info->pm_wakeup_in_secs = pmadapter->pm_wakeup_in_secs;
+               debug_info->is_hs_configured = pmadapter->is_hs_configured;
+               debug_info->hs_activated = pmadapter->hs_activated;
+               debug_info->pps_uapsd_mode = pmadapter->pps_uapsd_mode;
+               debug_info->sleep_pd = pmadapter->sleep_period.period;
+               debug_info->qos_cfg = pmpriv->wmm_qosinfo;
+               debug_info->tx_lock_flag = pmadapter->tx_lock_flag;
+               debug_info->port_open = pmpriv->port_open;
+               debug_info->bypass_pkt_count = pmadapter->bypass_pkt_count;
+               debug_info->scan_processing = pmadapter->scan_processing;
+               debug_info->num_cmd_host_to_card_failure
+                       = pmadapter->dbg.num_cmd_host_to_card_failure;
+               debug_info->num_cmd_sleep_cfm_host_to_card_failure
+                       = pmadapter->dbg.num_cmd_sleep_cfm_host_to_card_failure;
+               debug_info->num_tx_host_to_card_failure
+                       = pmadapter->dbg.num_tx_host_to_card_failure;
+               debug_info->num_cmdevt_card_to_host_failure
+                       = pmadapter->dbg.num_cmdevt_card_to_host_failure;
+               debug_info->num_rx_card_to_host_failure
+                       = pmadapter->dbg.num_rx_card_to_host_failure;
+               debug_info->num_int_read_failure =
                        pmadapter->dbg.num_int_read_failure;
-               info->param.debug_info.last_int_status =
-                       pmadapter->dbg.last_int_status;
-               info->param.debug_info.num_event_deauth =
-                       pmadapter->dbg.num_event_deauth;
-               info->param.debug_info.num_event_disassoc =
+               debug_info->last_int_status = pmadapter->dbg.last_int_status;
+               debug_info->num_event_deauth = pmadapter->dbg.num_event_deauth;
+               debug_info->num_event_disassoc =
                        pmadapter->dbg.num_event_disassoc;
-               info->param.debug_info.num_event_link_lost =
+               debug_info->num_event_link_lost =
                        pmadapter->dbg.num_event_link_lost;
-               info->param.debug_info.num_cmd_deauth =
-                       pmadapter->dbg.num_cmd_deauth;
-               info->param.debug_info.num_cmd_assoc_success =
+               debug_info->num_cmd_deauth = pmadapter->dbg.num_cmd_deauth;
+               debug_info->num_cmd_assoc_success =
                        pmadapter->dbg.num_cmd_assoc_success;
-               info->param.debug_info.num_cmd_assoc_failure =
+               debug_info->num_cmd_assoc_failure =
                        pmadapter->dbg.num_cmd_assoc_failure;
-               info->param.debug_info.num_tx_timeout =
-                       pmadapter->dbg.num_tx_timeout;
-               info->param.debug_info.num_cmd_timeout =
-                       pmadapter->dbg.num_cmd_timeout;
-               info->param.debug_info.timeout_cmd_id =
-                       pmadapter->dbg.timeout_cmd_id;
-               info->param.debug_info.timeout_cmd_act =
-                       pmadapter->dbg.timeout_cmd_act;
-               memcpy(pmadapter, info->param.debug_info.last_cmd_id,
+               debug_info->num_tx_timeout = pmadapter->dbg.num_tx_timeout;
+               debug_info->num_cmd_timeout = pmadapter->dbg.num_cmd_timeout;
+               debug_info->timeout_cmd_id = pmadapter->dbg.timeout_cmd_id;
+               debug_info->timeout_cmd_act = pmadapter->dbg.timeout_cmd_act;
+               memcpy(pmadapter, debug_info->last_cmd_id,
                       pmadapter->dbg.last_cmd_id,
                       sizeof(pmadapter->dbg.last_cmd_id));
-               memcpy(pmadapter, info->param.debug_info.last_cmd_act,
+               memcpy(pmadapter, debug_info->last_cmd_act,
                       pmadapter->dbg.last_cmd_act,
                       sizeof(pmadapter->dbg.last_cmd_act));
-               info->param.debug_info.last_cmd_index =
-                       pmadapter->dbg.last_cmd_index;
-               memcpy(pmadapter, info->param.debug_info.last_cmd_resp_id,
+               debug_info->last_cmd_index = pmadapter->dbg.last_cmd_index;
+               memcpy(pmadapter, debug_info->last_cmd_resp_id,
                       pmadapter->dbg.last_cmd_resp_id,
                       sizeof(pmadapter->dbg.last_cmd_resp_id));
-               info->param.debug_info.last_cmd_resp_index =
+               debug_info->last_cmd_resp_index =
                        pmadapter->dbg.last_cmd_resp_index;
-               memcpy(pmadapter, info->param.debug_info.last_event,
+               memcpy(pmadapter, debug_info->last_event,
                       pmadapter->dbg.last_event,
                       sizeof(pmadapter->dbg.last_event));
-               info->param.debug_info.last_event_index =
-                       pmadapter->dbg.last_event_index;
-               info->param.debug_info.num_no_cmd_node =
-                       pmadapter->dbg.num_no_cmd_node;
-               info->param.debug_info.mp_rd_bitmap = pmadapter->mp_rd_bitmap;
-               info->param.debug_info.mp_wr_bitmap = pmadapter->mp_wr_bitmap;
-               info->param.debug_info.curr_rd_port = pmadapter->curr_rd_port;
-               info->param.debug_info.curr_wr_port = pmadapter->curr_wr_port;
-               info->param.debug_info.data_sent = pmadapter->data_sent;
-               info->param.debug_info.cmd_sent = pmadapter->cmd_sent;
-               info->param.debug_info.cmd_resp_received =
-                       pmadapter->cmd_resp_received;
-               info->param.debug_info.tx_pkts_queued =
+               debug_info->last_event_index = pmadapter->dbg.last_event_index;
+               debug_info->num_no_cmd_node = pmadapter->dbg.num_no_cmd_node;
+               debug_info->pending_cmd =
+                       (pmadapter->curr_cmd) ? pmadapter->dbg.
+                       last_cmd_id[pmadapter->dbg.last_cmd_index] : 0;
+               debug_info->dnld_cmd_in_secs = pmadapter->dnld_cmd_in_secs;
+               debug_info->mp_rd_bitmap = pmadapter->mp_rd_bitmap;
+               debug_info->mp_wr_bitmap = pmadapter->mp_wr_bitmap;
+               debug_info->curr_rd_port = pmadapter->curr_rd_port;
+               debug_info->curr_wr_port = pmadapter->curr_wr_port;
+#ifdef SDIO_MULTI_PORT_TX_AGGR
+               memcpy(pmadapter, debug_info->mpa_tx_count,
+                      pmadapter->mpa_tx_count,
+                      sizeof(pmadapter->mpa_tx_count));
+               debug_info->mpa_sent_last_pkt = pmadapter->mpa_sent_last_pkt;
+               debug_info->mpa_sent_no_ports = pmadapter->mpa_sent_no_ports;
+               debug_info->last_recv_wr_bitmap =
+                       pmadapter->last_recv_wr_bitmap;
+               debug_info->last_mp_index = pmadapter->last_mp_index;
+               memcpy(pmadapter, debug_info->last_mp_wr_bitmap,
+                      pmadapter->last_mp_wr_bitmap,
+                      sizeof(pmadapter->last_mp_wr_bitmap));
+               memcpy(pmadapter, debug_info->last_mp_wr_ports,
+                      pmadapter->last_mp_wr_ports,
+                      sizeof(pmadapter->last_mp_wr_ports));
+               memcpy(pmadapter, debug_info->last_mp_wr_len,
+                      pmadapter->last_mp_wr_len,
+                      sizeof(pmadapter->last_mp_wr_len));
+               memcpy(pmadapter, debug_info->last_mp_wr_info,
+                      pmadapter->last_mp_wr_info,
+                      sizeof(pmadapter->last_mp_wr_info));
+               memcpy(pmadapter, debug_info->last_curr_wr_port,
+                      pmadapter->last_curr_wr_port,
+                      sizeof(pmadapter->last_curr_wr_port));
+#endif
+#ifdef SDIO_MULTI_PORT_RX_AGGR
+               memcpy(pmadapter, debug_info->mpa_rx_count,
+                      pmadapter->mpa_rx_count,
+                      sizeof(pmadapter->mpa_rx_count));
+#endif
+               debug_info->data_sent = pmadapter->data_sent;
+               debug_info->cmd_sent = pmadapter->cmd_sent;
+               debug_info->cmd_resp_received = pmadapter->cmd_resp_received;
+               debug_info->tx_pkts_queued =
                        util_scalar_read(pmadapter->pmoal_handle,
                                         &pmpriv->wmm.tx_pkts_queued, MNULL,
                                         MNULL);
 #ifdef UAP_SUPPORT
-               info->param.debug_info.num_bridge_pkts =
-                       pmadapter->pending_bridge_pkts;
-               info->param.debug_info.num_drop_pkts = pmpriv->num_drop_pkts;
+               debug_info->num_bridge_pkts = pmadapter->pending_bridge_pkts;
+               debug_info->num_drop_pkts = pmpriv->num_drop_pkts;
 #endif
-               info->param.debug_info.mlan_processing =
-                       pmadapter->mlan_processing;
-               info->param.debug_info.mlan_rx_processing =
-                       pmadapter->mlan_rx_processing;
+               debug_info->mlan_processing = pmadapter->mlan_processing;
+               debug_info->mlan_rx_processing = pmadapter->mlan_rx_processing;
        }
 
        pioctl_req->data_read_written =
@@ -2837,6 +2829,45 @@ wlan_radio_ioctl_remain_chan_cfg(IN pmlan_adapter pmadapter,
        LEAVE();
        return ret;
 }
+
+/**
+ *  @brief Set/Get p2p config
+ *
+ *  @param pmadapter   A pointer to mlan_adapter structure
+ *  @param pioctl_req  A pointer to ioctl request buffer
+ *
+ *  @return            MLAN_STATUS_SUCCESS --success, otherwise fail
+ */
+mlan_status
+wlan_misc_p2p_config(IN pmlan_adapter pmadapter, IN pmlan_ioctl_req pioctl_req)
+{
+       mlan_status ret = MLAN_STATUS_SUCCESS;
+       mlan_ds_misc_cfg *misc_cfg = MNULL;
+       t_u16 cmd_action = 0;
+       mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
+
+       ENTER();
+
+       misc_cfg = (mlan_ds_misc_cfg *) pioctl_req->pbuf;
+       if (pioctl_req->action == MLAN_ACT_SET)
+               cmd_action = HostCmd_ACT_GEN_SET;
+       else
+               cmd_action = HostCmd_ACT_GEN_GET;
+
+       /* Send request to firmware */
+       ret = wlan_prepare_cmd(pmpriv,
+                              HOST_CMD_P2P_PARAMS_CONFIG,
+                              cmd_action,
+                              0,
+                              (t_void *) pioctl_req,
+                              &misc_cfg->param.p2p_config);
+
+       if (ret == MLAN_STATUS_SUCCESS)
+               ret = MLAN_STATUS_PENDING;
+
+       LEAVE();
+       return ret;
+}
 #endif
 
 /**
index c73d8d7..cce1d02 100644 (file)
@@ -2,20 +2,25 @@
  *
  *  @brief This file declares the exported symbols from MLAN.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /******************************************************
@@ -44,5 +49,5 @@ EXPORT_SYMBOL(mlan_interrupt);
 MODULE_DESCRIPTION("M-WLAN MLAN Driver");
 MODULE_AUTHOR("Marvell International Ltd.");
 MODULE_VERSION(MLAN_RELEASE_VERSION);
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("Marvell Proprietary");
 #endif /* LINUX */
index ff2ec0d..7cd25aa 100644 (file)
@@ -5,20 +5,25 @@
  *  IOCTL handlers as well as command preparation and response routines
  *  for sending scan commands to the firmware.
  *
- *  Copyright (C) 2008-2012, Marvell International Ltd.
+ *  (C) Copyright 2008-2012 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /******************************************************
@@ -439,6 +444,9 @@ wlan_scan_create_channel_list(IN mlan_private * pmpriv,
                                                scan_type =
                                                        MLAN_SCAN_TYPE_PASSIVE;
                                        }
+                               pscan_chan_list[chan_idx].radio_type =
+                                       HostCmd_SCAN_RADIO_TYPE_BG;
+                               break;
                        default:
                                pscan_chan_list[chan_idx].radio_type =
                                        HostCmd_SCAN_RADIO_TYPE_BG;
@@ -1866,6 +1874,8 @@ wlan_interpret_bss_desc_with_ie(IN pmlan_adapter pmadapter,
                                (*(pbss_entry->poper_mode)).ieee_hdr.len +
                                sizeof(IEEEtypes_Header_t));
                        break;
+               default:
+                       break;
                }
 
                pcurrent_ptr += element_len + 2;
@@ -3595,6 +3605,10 @@ wlan_ret_802_11_scan(IN mlan_private * pmpriv,
                                         + sizeof(pscan_rsp->bss_descript_size)
                                         + sizeof(pscan_rsp->number_of_sets)
                                         + S_DS_GEN);
+       if (is_bgscan_resp)
+               tlv_buf_size -=
+                       sizeof(resp->params.bg_scan_query_resp.
+                              report_condition);
 
        ptlv = (MrvlIEtypes_Data_t *) (pscan_rsp->bss_desc_and_tlv_buffer +
                                       bytes_left);
@@ -4004,6 +4018,9 @@ wlan_bgscan_create_channel_list(IN mlan_private * pmpriv,
                                            (pmpriv, (t_u8) cfp->channel))
                                                scan_type =
                                                        MLAN_SCAN_TYPE_PASSIVE;
+                               tlv_chan_list->chan_scan_param[chan_idx].
+                                       radio_type = HostCmd_SCAN_RADIO_TYPE_BG;
+                               break;
                        default:
                                tlv_chan_list->chan_scan_param[chan_idx].
                                        radio_type = HostCmd_SCAN_RADIO_TYPE_BG;
index ef143d8..2658e3b 100644 (file)
@@ -2,20 +2,25 @@
  *
  *  @brief This file contains SDIO specific code
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
@@ -677,15 +682,23 @@ wlan_decode_rx_packet(mlan_adapter * pmadapter, mlan_buffer * pmbuf,
                PRINTM(MINFO, "--- Rx: Data packet ---\n");
                pmbuf->data_len = (pmadapter->upld_len - INTF_HEADER_LEN);
                pmbuf->data_offset += INTF_HEADER_LEN;
-               util_enqueue_list_tail(pmadapter->pmoal_handle,
-                                      &pmadapter->rx_data_queue,
-                                      (pmlan_linked_list) pmbuf,
-                                      pmadapter->callbacks.moal_spin_lock,
-                                      pmadapter->callbacks.moal_spin_unlock);
-               util_scalar_increment(pmadapter->pmoal_handle,
-                                     &pmadapter->rx_pkts_queued,
-                                     pmadapter->callbacks.moal_spin_lock,
-                                     pmadapter->callbacks.moal_spin_unlock);
+               if (pmadapter->rx_work_flag) {
+                       util_enqueue_list_tail(pmadapter->pmoal_handle,
+                                              &pmadapter->rx_data_queue,
+                                              (pmlan_linked_list) pmbuf,
+                                              pmadapter->callbacks.
+                                              moal_spin_lock,
+                                              pmadapter->callbacks.
+                                              moal_spin_unlock);
+                       util_scalar_increment(pmadapter->pmoal_handle,
+                                             &pmadapter->rx_pkts_queued,
+                                             pmadapter->callbacks.
+                                             moal_spin_lock,
+                                             pmadapter->callbacks.
+                                             moal_spin_unlock);
+               } else {
+                       wlan_handle_rx_packet(pmadapter, pmbuf);
+               }
                pmadapter->data_received = MTRUE;
                break;
 
@@ -759,6 +772,117 @@ wlan_decode_rx_packet(mlan_adapter * pmadapter, mlan_buffer * pmbuf,
  *  @brief This function receives data from the card in aggregate mode.
  *
  *  @param pmadapter A pointer to mlan_adapter structure
+ *  @return         MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
+ */
+mlan_status
+wlan_receive_mp_aggr_buf(mlan_adapter * pmadapter)
+{
+       mlan_status ret = MLAN_STATUS_SUCCESS;
+       pmlan_callbacks pcb = &pmadapter->callbacks;
+       mlan_buffer mbuf_aggr;
+       mlan_buffer *mbuf_deaggr;
+       t_u32 pind = 0;
+       t_u32 pkt_len, pkt_type = 0;
+       t_u8 *curr_ptr;
+       t_u32 cmd53_port = 0;
+       t_u32 port_count = 0;
+
+       /* do aggr RX now */
+       PRINTM(MINFO, "do_rx_aggr: num of packets: %d\n",
+              pmadapter->mpa_rx.pkt_cnt);
+
+       memset(pmadapter, &mbuf_aggr, 0, sizeof(mlan_buffer));
+
+       if (pmadapter->max_segs >= SDIO_MP_AGGR_DEF_PKT_LIMIT &&
+           pmadapter->mpa_rx.pkt_cnt > 1) {
+               mbuf_aggr.data_len = pmadapter->mpa_rx.buf_len;
+               mbuf_aggr.pnext = mbuf_aggr.pprev = &mbuf_aggr;
+               mbuf_aggr.use_count = 0;
+               for (pind = 0; pind < pmadapter->mpa_rx.pkt_cnt; pind++) {
+                       pmadapter->mpa_rx.mbuf_arr[pind]->data_len =
+                               pmadapter->mpa_rx.len_arr[pind];
+                       wlan_link_buf_to_aggr(&mbuf_aggr,
+                                             pmadapter->mpa_rx.mbuf_arr[pind]);
+               }
+       } else {
+               mbuf_aggr.pbuf = (t_u8 *) pmadapter->mpa_rx.buf;
+               mbuf_aggr.data_len = pmadapter->mpa_rx.buf_len;
+       }
+
+       port_count = bitcount(pmadapter->mpa_rx.ports) - 1;
+       /* port_count = pmadapter->mpa_rx.pkt_cnt - 1; */
+       cmd53_port =
+               (pmadapter->ioport | SDIO_MPA_ADDR_BASE | (port_count << 8))
+               + pmadapter->mpa_rx.start_port;
+       if (MLAN_STATUS_SUCCESS !=
+           pcb->moal_read_data_sync(pmadapter->pmoal_handle, &mbuf_aggr,
+                                    cmd53_port, 0)) {
+               ret = MLAN_STATUS_FAILURE;
+               goto done;
+       }
+       if (pmadapter->max_segs >= SDIO_MP_AGGR_DEF_PKT_LIMIT &&
+           pmadapter->mpa_rx.pkt_cnt > 1) {
+               for (pind = 0; pind < pmadapter->mpa_rx.pkt_cnt; pind++) {
+                       mbuf_deaggr = pmadapter->mpa_rx.mbuf_arr[pind];
+                       pkt_len =
+                               wlan_le16_to_cpu(*(t_u16 *)
+                                                (mbuf_deaggr->pbuf +
+                                                 mbuf_deaggr->data_offset));
+                       pkt_type =
+                               wlan_le16_to_cpu(*(t_u16 *)
+                                                (mbuf_deaggr->pbuf +
+                                                 mbuf_deaggr->data_offset +
+                                                 2));
+                       pmadapter->upld_len = pkt_len;
+                       wlan_decode_rx_packet(pmadapter, mbuf_deaggr, pkt_type);
+               }
+       } else {
+               DBG_HEXDUMP(MIF_D, "SDIO MP-A Blk Rd", pmadapter->mpa_rx.buf,
+                           MIN(pmadapter->mpa_rx.buf_len, MAX_DATA_DUMP_LEN));
+
+               curr_ptr = pmadapter->mpa_rx.buf;
+
+               for (pind = 0; pind < pmadapter->mpa_rx.pkt_cnt; pind++) {
+
+                       /* get curr PKT len & type */
+                       pkt_len = wlan_le16_to_cpu(*(t_u16 *) & curr_ptr[0]);
+                       pkt_type = wlan_le16_to_cpu(*(t_u16 *) & curr_ptr[2]);
+
+                       PRINTM(MINFO, "RX: [%d] pktlen: %d pkt_type: 0x%x\n",
+                              pind, pkt_len, pkt_type);
+
+                       /* copy pkt to deaggr buf */
+                       mbuf_deaggr = pmadapter->mpa_rx.mbuf_arr[pind];
+                       if ((pkt_type == MLAN_TYPE_DATA) &&
+                           (pkt_len <= pmadapter->mpa_rx.len_arr[pind])) {
+                               memcpy(pmadapter,
+                                      mbuf_deaggr->pbuf +
+                                      mbuf_deaggr->data_offset, curr_ptr,
+                                      pkt_len);
+                               pmadapter->upld_len = pkt_len;
+                               /* Process de-aggr packet */
+                               wlan_decode_rx_packet(pmadapter, mbuf_deaggr,
+                                                     pkt_type);
+                       } else {
+                               PRINTM(MERROR,
+                                      "Wrong aggr packet: type=%d, len=%d, max_len=%d\n",
+                                      pkt_type, pkt_len,
+                                      pmadapter->mpa_rx.len_arr[pind]);
+                               wlan_free_mlan_buffer(pmadapter, mbuf_deaggr);
+                       }
+                       curr_ptr += pmadapter->mpa_rx.len_arr[pind];
+               }
+       }
+       pmadapter->mpa_rx_count[pmadapter->mpa_rx.pkt_cnt - 1]++;
+       MP_RX_AGGR_BUF_RESET(pmadapter);
+done:
+       return ret;
+}
+
+/**
+ *  @brief This function receives data from the card in aggregate mode.
+ *
+ *  @param pmadapter A pointer to mlan_adapter structure
  *  @param pmbuf      A pointer to the SDIO data/cmd buffer
  *  @param port      Current port on which packet needs to be rxed
  *  @param rx_len    Length of received packet
@@ -769,17 +893,11 @@ wlan_sdio_card_to_host_mp_aggr(mlan_adapter * pmadapter, mlan_buffer
                               * pmbuf, t_u8 port, t_u16 rx_len)
 {
        mlan_status ret = MLAN_STATUS_SUCCESS;
-       pmlan_callbacks pcb = &pmadapter->callbacks;
        t_s32 f_do_rx_aggr = 0;
        t_s32 f_do_rx_cur = 0;
        t_s32 f_aggr_cur = 0;
-       mlan_buffer mbuf_aggr;
-       mlan_buffer *mbuf_deaggr;
        t_u32 pind = 0;
-       t_u32 pkt_len, pkt_type = 0;
-       t_u8 *curr_ptr;
-       t_u32 cmd53_port = 0;
-       t_u32 port_count = 0;
+       t_u32 pkt_type = 0;
 
        ENTER();
 
@@ -842,65 +960,11 @@ wlan_sdio_card_to_host_mp_aggr(mlan_adapter * pmadapter, mlan_buffer
 
        if (f_do_rx_aggr) {
                /* do aggr RX now */
-               PRINTM(MINFO, "do_rx_aggr: num of packets: %d\n",
-                      pmadapter->mpa_rx.pkt_cnt);
-
-               memset(pmadapter, &mbuf_aggr, 0, sizeof(mlan_buffer));
-
-               mbuf_aggr.pbuf = (t_u8 *) pmadapter->mpa_rx.buf;
-               mbuf_aggr.data_len = pmadapter->mpa_rx.buf_len;
-               port_count = bitcount(pmadapter->mpa_rx.ports) - 1;
-/*        port_count = pmadapter->mpa_rx.pkt_cnt - 1; */
-               cmd53_port =
-                       (pmadapter->
-                        ioport | SDIO_MPA_ADDR_BASE | (port_count << 8))
-                       + pmadapter->mpa_rx.start_port;
-               if (MLAN_STATUS_SUCCESS !=
-                   pcb->moal_read_data_sync(pmadapter->pmoal_handle,
-                                            &mbuf_aggr, cmd53_port, 0)) {
-                       pmbuf->status_code = MLAN_ERROR_DATA_RX_FAIL;
+               if (MLAN_STATUS_SUCCESS != wlan_receive_mp_aggr_buf(pmadapter)) {
                        ret = MLAN_STATUS_FAILURE;
                        goto done;
                }
-
-               DBG_HEXDUMP(MIF_D, "SDIO MP-A Blk Rd", pmadapter->mpa_rx.buf,
-                           MIN(pmadapter->mpa_rx.buf_len, MAX_DATA_DUMP_LEN));
-
-               curr_ptr = pmadapter->mpa_rx.buf;
-
-               for (pind = 0; pind < pmadapter->mpa_rx.pkt_cnt; pind++) {
-
-                       /* get curr PKT len & type */
-                       pkt_len = wlan_le16_to_cpu(*(t_u16 *) & curr_ptr[0]);
-                       pkt_type = wlan_le16_to_cpu(*(t_u16 *) & curr_ptr[2]);
-
-                       PRINTM(MINFO, "RX: [%d] pktlen: %d pkt_type: 0x%x\n",
-                              pind, pkt_len, pkt_type);
-
-                       /* copy pkt to deaggr buf */
-                       mbuf_deaggr = pmadapter->mpa_rx.mbuf_arr[pind];
-                       if ((pkt_type == MLAN_TYPE_DATA) &&
-                           (pkt_len <= pmadapter->mpa_rx.len_arr[pind])) {
-                               memcpy(pmadapter,
-                                      mbuf_deaggr->pbuf +
-                                      mbuf_deaggr->data_offset, curr_ptr,
-                                      pkt_len);
-                               pmadapter->upld_len = pkt_len;
-                               /* Process de-aggr packet */
-                               wlan_decode_rx_packet(pmadapter, mbuf_deaggr,
-                                                     pkt_type);
-                       } else {
-                               PRINTM(MERROR,
-                                      "Wrong aggr packet: type=%d, len=%d, max_len=%d\n",
-                                      pkt_type, pkt_len,
-                                      pmadapter->mpa_rx.len_arr[pind]);
-                               wlan_free_mlan_buffer(pmadapter, mbuf_deaggr);
-                       }
-                       curr_ptr += pmadapter->mpa_rx.len_arr[pind];
-               }
-               MP_RX_AGGR_BUF_RESET(pmadapter);
        }
-
 rx_curr_single:
        if (f_do_rx_cur) {
                PRINTM(MINFO, "RX: f_do_rx_cur: port: %d rx_len: %d\n", port,
@@ -922,6 +986,9 @@ rx_curr_single:
                        ret = MLAN_STATUS_FAILURE;
                        goto done;
                }
+
+               pmadapter->mpa_rx_count[0]++;
+
                wlan_decode_rx_packet(pmadapter, pmbuf, pkt_type);
        }
 
@@ -952,6 +1019,94 @@ done:
 
 #ifdef SDIO_MULTI_PORT_TX_AGGR
 /**
+ *  @brief This function sends aggr buf
+ *
+ *  @param pmadapter A pointer to mlan_adapter structure
+ *  @return         MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
+ */
+mlan_status
+wlan_send_mp_aggr_buf(mlan_adapter * pmadapter)
+{
+       mlan_status ret = MLAN_STATUS_SUCCESS;
+       t_u32 cmd53_port = 0;
+       t_u32 port_count = 0;
+       mlan_buffer mbuf_aggr;
+       t_u8 i = 0;
+
+       ENTER();
+       PRINTM(MINFO, "host_2_card_mp_aggr: Send aggregation buffer."
+              "%d %d\n", pmadapter->mpa_tx.start_port,
+              pmadapter->mpa_tx.ports);
+
+       memset(pmadapter, &mbuf_aggr, 0, sizeof(mlan_buffer));
+
+       if (pmadapter->max_segs >= SDIO_MP_AGGR_DEF_PKT_LIMIT &&
+           pmadapter->mpa_tx.pkt_cnt > 1) {
+               mbuf_aggr.data_len = pmadapter->mpa_tx.buf_len;
+               mbuf_aggr.pnext = mbuf_aggr.pprev = &mbuf_aggr;
+               mbuf_aggr.use_count = 0;
+               for (i = 0; i < pmadapter->mpa_tx.pkt_cnt; i++) {
+                       wlan_link_buf_to_aggr(&mbuf_aggr,
+                                             pmadapter->mpa_tx.mbuf_arr[i]);
+                       if (pmadapter->mpa_tx.mbuf_arr[i]->
+                           flags & MLAN_BUF_FLAG_TCP_ACK)
+                               pmadapter->callbacks.
+                                       moal_tcp_ack_tx_ind(pmadapter->
+                                                           pmoal_handle,
+                                                           pmadapter->mpa_tx.
+                                                           mbuf_arr[i]);
+               }
+       } else {
+               mbuf_aggr.pbuf = (t_u8 *) pmadapter->mpa_tx.buf;
+               mbuf_aggr.data_len = pmadapter->mpa_tx.buf_len;
+       }
+
+       port_count = bitcount(pmadapter->mpa_tx.ports) - 1;
+       cmd53_port =
+               (pmadapter->ioport | SDIO_MPA_ADDR_BASE | (port_count << 8))
+               + pmadapter->mpa_tx.start_port;
+
+    /** only one packet */
+       if (pmadapter->max_segs >= SDIO_MP_AGGR_DEF_PKT_LIMIT &&
+           pmadapter->mpa_tx.pkt_cnt == 1)
+               ret = wlan_write_data_sync(pmadapter,
+                                          pmadapter->mpa_tx.mbuf_arr[0],
+                                          cmd53_port);
+       else
+               ret = wlan_write_data_sync(pmadapter, &mbuf_aggr, cmd53_port);
+       if (pmadapter->max_segs >= SDIO_MP_AGGR_DEF_PKT_LIMIT) {
+       /** free mlan buffer */
+               for (i = 0; i < pmadapter->mpa_tx.pkt_cnt; i++) {
+                       wlan_write_data_complete(pmadapter,
+                                                pmadapter->mpa_tx.mbuf_arr[i],
+                                                MLAN_STATUS_SUCCESS);
+               }
+       }
+       if (!(pmadapter->mp_wr_bitmap & (1 << pmadapter->curr_wr_port))
+           && (pmadapter->mpa_tx.pkt_cnt < SDIO_MP_AGGR_DEF_PKT_LIMIT))
+               pmadapter->mpa_sent_no_ports++;
+       pmadapter->mpa_tx_count[pmadapter->mpa_tx.pkt_cnt - 1]++;
+       pmadapter->last_mp_wr_bitmap[pmadapter->last_mp_index] =
+               pmadapter->mp_wr_bitmap;
+       pmadapter->last_mp_wr_ports[pmadapter->last_mp_index] = cmd53_port;
+       pmadapter->last_mp_wr_len[pmadapter->last_mp_index] =
+               pmadapter->mpa_tx.buf_len;
+       pmadapter->last_curr_wr_port[pmadapter->last_mp_index] =
+               pmadapter->curr_wr_port;
+       memcpy(pmadapter,
+              (t_u8 *) & pmadapter->last_mp_wr_info[pmadapter->last_mp_index *
+                                                    SDIO_MP_AGGR_DEF_PKT_LIMIT],
+              (t_u8 *) pmadapter->mpa_tx.mp_wr_info,
+              sizeof(pmadapter->mpa_tx.mp_wr_info));
+       pmadapter->last_mp_index++;
+       if (pmadapter->last_mp_index >= SDIO_MP_DBG_NUM)
+               pmadapter->last_mp_index = 0;
+       MP_TX_AGGR_BUF_RESET(pmadapter);
+       LEAVE();
+       return ret;
+}
+
+/**
  *  @brief This function sends data to the card in SDIO aggregated mode.
  *
  *  @param pmadapter A pointer to mlan_adapter structure
@@ -969,9 +1124,7 @@ wlan_host_to_card_mp_aggr(mlan_adapter * pmadapter, mlan_buffer * mbuf,
        t_s32 f_send_cur_buf = 0;
        t_s32 f_precopy_cur_buf = 0;
        t_s32 f_postcopy_cur_buf = 0;
-       t_u32 cmd53_port = 0;
-       t_u32 port_count = 0;
-       mlan_buffer mbuf_aggr;
+       t_u8 aggr_sg = 0;
 
        ENTER();
 
@@ -981,7 +1134,6 @@ wlan_host_to_card_mp_aggr(mlan_adapter * pmadapter, mlan_buffer * mbuf,
        if (!pmadapter->mpa_tx.enabled) {
                PRINTM(MINFO,
                       "host_2_card_mp_aggr: tx aggregation disabled !\n");
-
                f_send_cur_buf = 1;
                goto tx_curr_single;
        }
@@ -991,9 +1143,8 @@ wlan_host_to_card_mp_aggr(mlan_adapter * pmadapter, mlan_buffer * mbuf,
                PRINTM(MINFO, "host_2_card_mp_aggr: More packets in Queue.\n");
 
                if (MP_TX_AGGR_IN_PROGRESS(pmadapter)) {
-                       if (!MP_TX_AGGR_PORT_LIMIT_REACHED(pmadapter) &&
-                           MP_TX_AGGR_BUF_HAS_ROOM(pmadapter, mbuf,
-                                                   mbuf->data_len)) {
+                       if (MP_TX_AGGR_BUF_HAS_ROOM
+                           (pmadapter, mbuf, mbuf->data_len)) {
                                f_precopy_cur_buf = 1;
 
                                if (!
@@ -1009,10 +1160,10 @@ wlan_host_to_card_mp_aggr(mlan_adapter * pmadapter, mlan_buffer * mbuf,
                                /* No room in Aggr buf, send it */
                                f_send_aggr_buf = 1;
 
-                               if (MP_TX_AGGR_PORT_LIMIT_REACHED(pmadapter) ||
-                                   !(pmadapter->
-                                     mp_wr_bitmap & (1 << pmadapter->
-                                                     curr_wr_port))) {
+                               if (!
+                                   (pmadapter->
+                                    mp_wr_bitmap & (1 << pmadapter->
+                                                    curr_wr_port))) {
                                        f_send_cur_buf = 1;
                                } else {
                                        f_postcopy_cur_buf = 1;
@@ -1046,12 +1197,21 @@ wlan_host_to_card_mp_aggr(mlan_adapter * pmadapter, mlan_buffer * mbuf,
                } else {
                        f_send_cur_buf = 1;
                }
+               pmadapter->mpa_sent_last_pkt++;
        }
 
        if (f_precopy_cur_buf) {
                PRINTM(MINFO, "host_2_card_mp_aggr: Precopy current buffer\n");
-               MP_TX_AGGR_BUF_PUT(pmadapter, mbuf, port);
-
+               if (pmadapter->max_segs >= SDIO_MP_AGGR_DEF_PKT_LIMIT) {
+                       MP_TX_AGGR_BUF_PUT_SG(pmadapter, mbuf, port);
+                       aggr_sg = MTRUE;
+               } else {
+                       if (mbuf->flags & MLAN_BUF_FLAG_TCP_ACK)
+                               pmadapter->callbacks.
+                                       moal_tcp_ack_tx_ind(pmadapter->
+                                                           pmoal_handle, mbuf);
+                       MP_TX_AGGR_BUF_PUT(pmadapter, mbuf, port);
+               }
                if (MP_TX_AGGR_PKT_LIMIT_REACHED(pmadapter) ||
                    MP_TX_AGGR_PORT_LIMIT_REACHED(pmadapter)) {
                        PRINTM(MIF_D,
@@ -1061,35 +1221,58 @@ wlan_host_to_card_mp_aggr(mlan_adapter * pmadapter, mlan_buffer * mbuf,
                }
        }
 
-       if (f_send_aggr_buf) {
-               PRINTM(MINFO, "host_2_card_mp_aggr: Send aggregation buffer."
-                      "%d %d\n", pmadapter->mpa_tx.start_port,
-                      pmadapter->mpa_tx.ports);
-
-               memset(pmadapter, &mbuf_aggr, 0, sizeof(mlan_buffer));
-
-               mbuf_aggr.pbuf = (t_u8 *) pmadapter->mpa_tx.buf;
-               mbuf_aggr.data_len = pmadapter->mpa_tx.buf_len;
-               port_count = bitcount(pmadapter->mpa_tx.ports) - 1;
-               cmd53_port =
-                       (pmadapter->
-                        ioport | SDIO_MPA_ADDR_BASE | (port_count << 8))
-                       + pmadapter->mpa_tx.start_port;
-               ret = wlan_write_data_sync(pmadapter, &mbuf_aggr, cmd53_port);
-               MP_TX_AGGR_BUF_RESET(pmadapter);
-       }
+       if (f_send_aggr_buf)
+               ret = wlan_send_mp_aggr_buf(pmadapter);
 
 tx_curr_single:
        if (f_send_cur_buf) {
                PRINTM(MINFO, "host_2_card_mp_aggr: writing to port #%d\n",
                       port);
+               if (mbuf->flags & MLAN_BUF_FLAG_TCP_ACK)
+                       pmadapter->callbacks.moal_tcp_ack_tx_ind(pmadapter->
+                                                                pmoal_handle,
+                                                                mbuf);
                ret = wlan_write_data_sync(pmadapter, mbuf,
                                           pmadapter->ioport + port);
+               if (!(pmadapter->mp_wr_bitmap & (1 << pmadapter->curr_wr_port)))
+                       pmadapter->mpa_sent_no_ports++;
+               pmadapter->last_mp_wr_bitmap[pmadapter->last_mp_index] =
+                       pmadapter->mp_wr_bitmap;
+               pmadapter->last_mp_wr_ports[pmadapter->last_mp_index] =
+                       pmadapter->ioport + port;
+               pmadapter->last_mp_wr_len[pmadapter->last_mp_index] =
+                       mbuf->data_len;
+               memset(pmadapter,
+                      (t_u8 *) & pmadapter->last_mp_wr_info[pmadapter->
+                                                            last_mp_index *
+                                                            SDIO_MP_AGGR_DEF_PKT_LIMIT],
+                      0, sizeof(t_u16) * SDIO_MP_AGGR_DEF_PKT_LIMIT);
+               pmadapter->last_mp_wr_info[pmadapter->last_mp_index *
+                                          SDIO_MP_AGGR_DEF_PKT_LIMIT] =
+                       *(t_u16 *) (mbuf->pbuf + mbuf->data_offset);
+               pmadapter->last_curr_wr_port[pmadapter->last_mp_index] =
+                       pmadapter->curr_wr_port;
+               pmadapter->last_mp_index++;
+               if (pmadapter->last_mp_index >= SDIO_MP_DBG_NUM)
+                       pmadapter->last_mp_index = 0;
+               pmadapter->mpa_tx_count[0]++;
        }
        if (f_postcopy_cur_buf) {
                PRINTM(MINFO, "host_2_card_mp_aggr: Postcopy current buffer\n");
-               MP_TX_AGGR_BUF_PUT(pmadapter, mbuf, port);
+               if (pmadapter->max_segs >= SDIO_MP_AGGR_DEF_PKT_LIMIT) {
+                       MP_TX_AGGR_BUF_PUT_SG(pmadapter, mbuf, port);
+                       aggr_sg = MTRUE;
+               } else {
+                       if (mbuf->flags & MLAN_BUF_FLAG_TCP_ACK)
+                               pmadapter->callbacks.
+                                       moal_tcp_ack_tx_ind(pmadapter->
+                                                           pmoal_handle, mbuf);
+                       MP_TX_AGGR_BUF_PUT(pmadapter, mbuf, port);
+               }
        }
+       /* Always return PENDING in SG mode */
+       if (aggr_sg)
+               ret = MLAN_STATUS_PENDING;
 
        LEAVE();
        return ret;
@@ -1143,7 +1326,7 @@ mlan_status
 wlan_check_fw_status(mlan_adapter * pmadapter, t_u32 pollnum)
 {
        mlan_status ret = MLAN_STATUS_SUCCESS;
-       t_u16 firmwarestat;
+       t_u16 firmwarestat = 0;
        t_u32 tries;
 
        ENTER();
@@ -1162,8 +1345,13 @@ wlan_check_fw_status(mlan_adapter * pmadapter, t_u32 pollnum)
                }
        }
 
-       if (ret != MLAN_STATUS_SUCCESS)
+       if (ret != MLAN_STATUS_SUCCESS) {
+               if (pollnum > 1)
+                       PRINTM(MERROR,
+                              "Fail to poll firmware status: firmwarestat=0x%x\n",
+                              firmwarestat);
                goto done;
+       }
 
 done:
        LEAVE();
@@ -1224,7 +1412,6 @@ wlan_sdio_probe(pmlan_adapter pmadapter)
                LEAVE();
                return MLAN_STATUS_FAILURE;
        }
-
        /* Get SDIO ioport */
        ret = wlan_sdio_init_ioport(pmadapter);
        LEAVE();
@@ -1278,6 +1465,8 @@ wlan_interrupt(pmlan_adapter pmadapter)
                pcb->moal_spin_lock(pmadapter->pmoal_handle,
                                    pmadapter->pint_lock);
                pmadapter->sdio_ireg |= sdio_ireg;
+               memcpy(pmadapter, pmadapter->last_mp_regs, pmadapter->mp_regs,
+                      sizeof(pmadapter->last_mp_regs));
                pcb->moal_spin_unlock(pmadapter->pmoal_handle,
                                      pmadapter->pint_lock);
        } else {
@@ -1317,9 +1506,11 @@ wlan_process_int_status(mlan_adapter * pmadapter)
        pmlan_callbacks pcb = &pmadapter->callbacks;
        t_u8 sdio_ireg;
        mlan_buffer *pmbuf = MNULL;
+       t_u8 mp_regs[MAX_MP_REGS];
        t_u8 port = 0;
        t_u32 len_reg_l, len_reg_u;
        t_u32 rx_blocks;
+       t_u32 mp_wr_bitmap;
        t_u32 ps_state = pmadapter->ps_state;
        t_u16 rx_len;
        t_u32 upld_typ = 0;
@@ -1330,6 +1521,7 @@ wlan_process_int_status(mlan_adapter * pmadapter)
        pcb->moal_spin_lock(pmadapter->pmoal_handle, pmadapter->pint_lock);
        sdio_ireg = pmadapter->sdio_ireg;
        pmadapter->sdio_ireg = 0;
+       memcpy(pmadapter, mp_regs, pmadapter->last_mp_regs, sizeof(mp_regs));
        pcb->moal_spin_unlock(pmadapter->pmoal_handle, pmadapter->pint_lock);
 
        if (!sdio_ireg)
@@ -1343,8 +1535,8 @@ wlan_process_int_status(mlan_adapter * pmadapter)
 
        if (sdio_ireg & UP_LD_CMD_PORT_HOST_INT_STATUS) {
                /* read the len of control packet */
-               rx_len = ((t_u16) pmadapter->mp_regs[CMD_RD_LEN_1]) << 8;
-               rx_len |= (t_u16) pmadapter->mp_regs[CMD_RD_LEN_0];
+               rx_len = ((t_u16) mp_regs[CMD_RD_LEN_1]) << 8;
+               rx_len |= (t_u16) mp_regs[CMD_RD_LEN_0];
                PRINTM(MINFO, "RX: cmd port rx_len=%u\n", rx_len);
                rx_blocks =
                        (rx_len + MLAN_SDIO_BLOCK_SIZE -
@@ -1396,32 +1588,43 @@ wlan_process_int_status(mlan_adapter * pmadapter)
        }
 
        if (sdio_ireg & DN_LD_HOST_INT_STATUS) {
-               pmadapter->mp_wr_bitmap =
-                       (t_u32) pmadapter->mp_regs[WR_BITMAP_L];
-               pmadapter->mp_wr_bitmap |=
-                       ((t_u32) pmadapter->mp_regs[WR_BITMAP_U]) << 8;
+               mp_wr_bitmap = pmadapter->mp_wr_bitmap;
+               pmadapter->mp_wr_bitmap = (t_u32) mp_regs[WR_BITMAP_L];
+               pmadapter->mp_wr_bitmap |= ((t_u32) mp_regs[WR_BITMAP_U]) << 8;
                pmadapter->mp_wr_bitmap |=
-                       ((t_u32) pmadapter->mp_regs[WR_BITMAP_1L]) << 16;
+                       ((t_u32) mp_regs[WR_BITMAP_1L]) << 16;
                pmadapter->mp_wr_bitmap |=
-                       ((t_u32) pmadapter->mp_regs[WR_BITMAP_1U]) << 24;
+                       ((t_u32) mp_regs[WR_BITMAP_1U]) << 24;
+               if ((mp_wr_bitmap & pmadapter->mp_data_port_mask) &&
+                   (mp_wr_bitmap != pmadapter->mp_wr_bitmap)) {
+                       PRINTM(MINTR,
+                              "wlan: Unexpected TxDn, old mp_wr_bitmap=0x%08x, new mp_wr_bitmap=0x%08x\n",
+                              mp_wr_bitmap, pmadapter->mp_wr_bitmap);
+               }
+               pmadapter->last_recv_wr_bitmap = pmadapter->mp_wr_bitmap;
                PRINTM(MINTR, "DNLD: wr_bitmap=0x%08x\n",
                       pmadapter->mp_wr_bitmap);
+               if (!(pmadapter->mp_wr_bitmap & (1 << pmadapter->curr_wr_port))
+                   && pmadapter->data_sent)
+                       PRINTM(MINTR,
+                              "wlan: TxDn without port: wr_bitmap=0x%08x curr_wr_port=%d\n",
+                              pmadapter->mp_wr_bitmap,
+                              pmadapter->curr_wr_port);
                if (pmadapter->data_sent &&
-                   (pmadapter->mp_wr_bitmap & pmadapter->mp_data_port_mask)) {
+                   (pmadapter->
+                    mp_wr_bitmap & (1 << pmadapter->curr_wr_port))) {
                        PRINTM(MINFO, " <--- Tx DONE Interrupt --->\n");
                        pmadapter->data_sent = MFALSE;
                }
        }
 
        if (sdio_ireg & UP_LD_HOST_INT_STATUS) {
-               pmadapter->mp_rd_bitmap =
-                       (t_u32) pmadapter->mp_regs[RD_BITMAP_L];
-               pmadapter->mp_rd_bitmap |=
-                       ((t_u32) pmadapter->mp_regs[RD_BITMAP_U]) << 8;
+               pmadapter->mp_rd_bitmap = (t_u32) mp_regs[RD_BITMAP_L];
+               pmadapter->mp_rd_bitmap |= ((t_u32) mp_regs[RD_BITMAP_U]) << 8;
                pmadapter->mp_rd_bitmap |=
-                       ((t_u32) pmadapter->mp_regs[RD_BITMAP_1L]) << 16;
+                       ((t_u32) mp_regs[RD_BITMAP_1L]) << 16;
                pmadapter->mp_rd_bitmap |=
-                       ((t_u32) pmadapter->mp_regs[RD_BITMAP_1U]) << 24;
+                       ((t_u32) mp_regs[RD_BITMAP_1U]) << 24;
                PRINTM(MINTR, "UPLD: rd_bitmap=0x%08x\n",
                       pmadapter->mp_rd_bitmap);
 
@@ -1434,8 +1637,8 @@ wlan_process_int_status(mlan_adapter * pmadapter)
                        }
                        len_reg_l = RD_LEN_P0_L + (port << 1);
                        len_reg_u = RD_LEN_P0_U + (port << 1);
-                       rx_len = ((t_u16) pmadapter->mp_regs[len_reg_u]) << 8;
-                       rx_len |= (t_u16) pmadapter->mp_regs[len_reg_l];
+                       rx_len = ((t_u16) mp_regs[len_reg_u]) << 8;
+                       rx_len |= (t_u16) mp_regs[len_reg_l];
                        PRINTM(MINFO, "RX: port=%d rx_len=%u\n", port, rx_len);
                        rx_blocks =
                                (rx_len + MLAN_SDIO_BLOCK_SIZE -
@@ -1555,7 +1758,10 @@ wlan_sdio_host_to_card(mlan_adapter * pmadapter, t_u8 type, mlan_buffer * pmbuf,
        if (type == MLAN_TYPE_DATA) {
                ret = wlan_get_wr_port_data(pmadapter, &port);
                if (ret != MLAN_STATUS_SUCCESS) {
-                       PRINTM(MERROR, "no wr_port available: %d\n", ret);
+                       PRINTM(MERROR,
+                              "no wr_port available: wr_bitmap=0x%08x curr_wr_port=%d\n",
+                              pmadapter->mp_wr_bitmap,
+                              pmadapter->curr_wr_port);
                        goto exit;
                }
                /* Transfer data to card */
@@ -1569,6 +1775,10 @@ wlan_sdio_host_to_card(mlan_adapter * pmadapter, t_u8 type, mlan_buffer * pmbuf,
                        ret = wlan_host_to_card_mp_aggr(pmadapter, pmbuf, port,
                                                        0);
 #else
+               if (pmbuf->flags & MLAN_BUF_FLAG_TCP_ACK)
+                       pmadapter->callbacks.moal_tcp_ack_tx_ind(pmadapter->
+                                                                pmoal_handle,
+                                                                pmbuf);
                ret = wlan_write_data_sync(pmadapter, pmbuf,
                                           pmadapter->ioport + port);
 #endif /* SDIO_MULTI_PORT_TX_AGGR */
@@ -1587,7 +1797,7 @@ wlan_sdio_host_to_card(mlan_adapter * pmadapter, t_u8 type, mlan_buffer * pmbuf,
                ret = wlan_write_data_sync(pmadapter, pmbuf, cmd53_port);
        }
 
-       if (ret != MLAN_STATUS_SUCCESS) {
+       if (ret == MLAN_STATUS_FAILURE) {
                if (type == MLAN_TYPE_CMD)
                        pmadapter->cmd_sent = MFALSE;
                if (type == MLAN_TYPE_DATA)
index 76f29b8..99b1686 100644 (file)
@@ -1,24 +1,27 @@
 /** @file mlan_sdio.h
-  *
-  * @brief This file contains definitions for SDIO interface.
-  * driver.
-  *
-  * Copyright (C) 2008-2011, Marvell International Ltd.
-  *
-  * This software file (the "File") is distributed by Marvell International
-  * Ltd. under the terms of the GNU General Public License Version 2, June 1991
-  * (the "License").  You may use, redistribute and/or modify this File in
-  * accordance with the terms and conditions of the License, a copy of which
-  * is available by writing to the Free Software Foundation, Inc.,
-  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
-  * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-  *
-  * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
-  * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
-  * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
-  * this warranty disclaimer.
-  *
-  */
+ *
+ *  @brief This file contains definitions for SDIO interface.
+ *
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
+ *
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
+ *
+ */
 /****************************************************
 Change log:
 ****************************************************/
@@ -278,6 +281,18 @@ Change log:
 #define MP_TX_AGGR_BUF_PUT(a, mbuf, port) do {                  \
        pmadapter->callbacks.moal_memmove(a->pmoal_handle, &a->mpa_tx.buf[a->mpa_tx.buf_len], mbuf->pbuf+mbuf->data_offset, mbuf->data_len);\
        a->mpa_tx.buf_len += mbuf->data_len;                        \
+    a->mpa_tx.mp_wr_info[a->mpa_tx.pkt_cnt] = *(t_u16 *)(mbuf->pbuf+mbuf->data_offset); \
+       if (!a->mpa_tx.pkt_cnt) {                                   \
+           a->mpa_tx.start_port = port;                            \
+       }                                                           \
+       a->mpa_tx.ports |= (1 << port);                             \
+       a->mpa_tx.pkt_cnt++;                                        \
+} while (0);
+
+#define MP_TX_AGGR_BUF_PUT_SG(a, mbuf, port) do {               \
+       a->mpa_tx.buf_len += mbuf->data_len;                        \
+    a->mpa_tx.mp_wr_info[a->mpa_tx.pkt_cnt] = *(t_u16 *)(mbuf->pbuf+mbuf->data_offset); \
+    a->mpa_tx.mbuf_arr[a->mpa_tx.pkt_cnt] = mbuf;               \
        if (!a->mpa_tx.pkt_cnt) {                                   \
            a->mpa_tx.start_port = port;                            \
        }                                                           \
@@ -303,6 +318,7 @@ Change log:
 
 /** Reset SDIO Tx aggregation buffer parameters */
 #define MP_TX_AGGR_BUF_RESET(a) do {         \
+    memset(a, a->mpa_tx.mp_wr_info, 0, sizeof(a->mpa_tx.mp_wr_info)); \
        a->mpa_tx.pkt_cnt = 0;                   \
        a->mpa_tx.buf_len = 0;                   \
        a->mpa_tx.ports = 0;                     \
index c4adeb3..c49a032 100644 (file)
@@ -2,20 +2,56 @@
  *
  *  @brief This file contains APIs to MOAL module.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
+ *
+ */
+
+/**
+ *  @mainpage MLAN Driver
+ *
+ *  @section overview_sec Overview
+ *
+ *  The MLAN is an OS independent WLAN driver for Marvell 802.11
+ *  embedded chipset.
+ *
+ *  @section copyright_sec Copyright
+ *
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
+ *
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
@@ -228,6 +264,7 @@ mlan_register(IN pmlan_device pmdevice, OUT t_void ** ppmlan_adapter)
        MASSERT(pcb->moal_free_lock);
        MASSERT(pcb->moal_spin_lock);
        MASSERT(pcb->moal_spin_unlock);
+       MASSERT(pcb->moal_tcp_ack_tx_ind);
 
        /* Save pmoal_handle */
        pmadapter->pmoal_handle = pmdevice->pmoal_handle;
@@ -252,6 +289,11 @@ mlan_register(IN pmlan_device pmdevice, OUT t_void ** ppmlan_adapter)
 #ifdef MFG_CMD_SUPPORT
        pmadapter->init_para.mfg_mode = pmdevice->mfg_mode;
 #endif
+#if defined(SDIO_MULTI_PORT_TX_AGGR) || defined(SDIO_MULTI_PORT_RX_AGGR)
+       pmadapter->max_segs = pmdevice->max_segs;
+       pmadapter->max_seg_size = pmdevice->max_seg_size;
+#endif
+
 #ifdef SDIO_MULTI_PORT_TX_AGGR
        pmadapter->init_para.mpa_tx_cfg = pmdevice->mpa_tx_cfg;
 #endif
@@ -273,6 +315,7 @@ mlan_register(IN pmlan_device pmdevice, OUT t_void ** ppmlan_adapter)
        pmadapter->init_para.dfs_master_radar_det_en =
                DFS_MASTER_RADAR_DETECT_EN;
        pmadapter->init_para.dfs_slave_radar_det_en = DFS_SLAVE_RADAR_DETECT_EN;
+       pmadapter->rx_work_flag = pmdevice->rx_work;
 
        pmadapter->priv_num = 0;
        for (i = 0; i < MLAN_MAX_BSS_NUM; i++) {
@@ -783,8 +826,12 @@ process_start:
                        if (pmadapter->hs_activated == MTRUE)
                                wlan_process_hs_config(pmadapter);
                        wlan_process_int_status(pmadapter);
+                       if (pmadapter->data_received && pmadapter->rx_work_flag)
+                               wlan_recv_event(wlan_get_priv
+                                               (pmadapter, MLAN_BSS_ROLE_ANY),
+                                               MLAN_EVENT_ID_DRV_DEFER_RX_WORK,
+                                               MNULL);
                }
-
                /* Need to wake up the card ? */
                if ((pmadapter->ps_state == PS_STATE_SLEEP) &&
                    (pmadapter->pm_wakeup_card_req &&
@@ -795,8 +842,8 @@ process_start:
                     || !wlan_bypass_tx_list_empty(pmadapter)
                     || !wlan_wmm_lists_empty(pmadapter)
                    )) {
-                       pmadapter->pm_wakeup_fw_try = MTRUE;
                        wlan_pm_wakeup_card(pmadapter);
+                       pmadapter->pm_wakeup_fw_try = MTRUE;
                        continue;
                }
                if (IS_CARD_RX_RCVD(pmadapter)) {
@@ -965,7 +1012,7 @@ mlan_send_packet(IN t_void * pmlan_adapter, IN pmlan_buffer pmbuf)
        MASSERT(pmlan_adapter && pmbuf);
 
        MASSERT(pmbuf->bss_index < pmadapter->priv_num);
-       pmbuf->flags = MLAN_BUF_FLAG_MOAL_TX_BUF;
+       pmbuf->flags |= MLAN_BUF_FLAG_MOAL_TX_BUF;
 
        if (((pmadapter->priv[pmbuf->bss_index]->port_ctrl_mode == MTRUE) &&
             ((mlan_ntohs(*(t_u16 *) & pmbuf->pbuf[pmbuf->data_offset +
index 9dfbc79..9c8d5c5 100644 (file)
@@ -4,20 +4,24 @@
  *  it prepares command and sends it to firmware when
  *  it is ready.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
  */
 
@@ -888,21 +892,23 @@ wlan_cmd_802_11_key_material(IN pmlan_private pmpriv,
                        wlan_cpu_to_le16(KEY_TYPE_ID_AES);
                if (cmd_oid == KEY_INFO_ENABLED)
                        pkey_material->key_param_set.key_info =
-                               wlan_cpu_to_le16(KEY_INFO_AES_ENABLED);
+                               KEY_INFO_AES_ENABLED;
                else
-                       pkey_material->key_param_set.key_info =
-                               !(wlan_cpu_to_le16(KEY_INFO_AES_ENABLED));
+                       pkey_material->key_param_set.key_info = 0;
 
                if (pkey->key_index & MLAN_KEY_INDEX_UNICAST)   /* AES pairwise
                                                                   key: unicast
                                                                 */
                        pkey_material->key_param_set.key_info |=
-                               wlan_cpu_to_le16(KEY_INFO_AES_UNICAST);
-               else {          /* AES group key: multicast */
-
+                               KEY_INFO_AES_UNICAST;
+               else            /* AES group key: multicast */
                        pkey_material->key_param_set.key_info |=
-                               wlan_cpu_to_le16(KEY_INFO_AES_MCAST);
-               }
+                               KEY_INFO_AES_MCAST;
+               /** pass key index to BIT(6) and BIT(7) */
+               pkey_material->key_param_set.key_info |=
+                       (pkey->key_index & 0x03) << 6;
+               pkey_material->key_param_set.key_info =
+                       wlan_cpu_to_le16(pkey_material->key_param_set.key_info);
        } else if ((pkey->key_flags & KEY_FLAG_AES_MCAST_IGTK) &&
                   pkey->key_len == WPA_IGTK_KEY_LEN) {
                PRINTM(MCMND, "WPA_AES_CMAC\n");
@@ -921,18 +927,21 @@ wlan_cmd_802_11_key_material(IN pmlan_private pmpriv,
                PRINTM(MCMND, "WPA_TKIP\n");
                pkey_material->key_param_set.key_type_id =
                        wlan_cpu_to_le16(KEY_TYPE_ID_TKIP);
-               pkey_material->key_param_set.key_info =
-                       wlan_cpu_to_le16(KEY_INFO_TKIP_ENABLED);
-
+               pkey_material->key_param_set.key_info = KEY_INFO_TKIP_ENABLED;
                if (pkey->key_index & MLAN_KEY_INDEX_UNICAST)   /* TKIP
                                                                   pairwise
                                                                   key: unicast
                                                                 */
                        pkey_material->key_param_set.key_info |=
-                               wlan_cpu_to_le16(KEY_INFO_TKIP_UNICAST);
+                               KEY_INFO_TKIP_UNICAST;
                else            /* TKIP group key: multicast */
                        pkey_material->key_param_set.key_info |=
-                               wlan_cpu_to_le16(KEY_INFO_TKIP_MCAST);
+                               KEY_INFO_TKIP_MCAST;
+               /** pass key index to BIT(6) and BIT(7) */
+               pkey_material->key_param_set.key_info |=
+                       (pkey->key_index & 0x03) << 6;
+               pkey_material->key_param_set.key_info =
+                       wlan_cpu_to_le16(pkey_material->key_param_set.key_info);
        }
 
        if (pkey_material->key_param_set.key_type_id) {
index eed6b5d..3b3c396 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file contains the handling of command
  *  responses generated by firmware.
  *
- *  Copyright (C) 2008-2012, Marvell International Ltd.
+ *  (C) Copyright 2008-2012 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /******************************************************
@@ -47,6 +52,7 @@ Change log:
 /********************************************************
                        Local Functions
 ********************************************************/
+
 /**
  *  @brief This function handles the command response error
  *
index ea5df8f..47e106e 100644 (file)
@@ -2,20 +2,25 @@
  *
  *  @brief This file contains MLAN event handling.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
@@ -671,7 +676,7 @@ wlan_ops_sta_process_event(IN t_void * priv)
        case EVENT_REMAIN_ON_CHANNEL_EXPIRED:
                PRINTM(MEVENT, "EVENT: REMAIN_ON_CHANNEL_EXPIRED reason=%d\n",
                       *(t_u16 *) pmadapter->event_body);
-               wlan_recv_event(pmpriv, MLAN_EVENT_ID_FLUSH_RX_WORK, MNULL);
+               wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_FLUSH_RX_WORK, MNULL);
                wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_REMAIN_ON_CHAN_EXPIRED,
                                MNULL);
                break;
@@ -693,6 +698,23 @@ wlan_ops_sta_process_event(IN t_void * priv)
                wlan_handle_event_multi_chan_info(pmpriv, pmbuf);
                break;
 
+       case EVENT_FW_DUMP_INFO:
+               PRINTM(MEVENT, "EVENT: Dump FW info\n");
+               /* Allocate memory for event buffer */
+               ret = pcb->moal_malloc(pmadapter->pmoal_handle, MAX_EVENT_SIZE,
+                                      MLAN_MEM_DEF, &evt_buf);
+               if ((ret == MLAN_STATUS_SUCCESS) && evt_buf) {
+                       pevent = (pmlan_event) evt_buf;
+                       pevent->bss_index = pmpriv->bss_index;
+                       pevent->event_id = MLAN_EVENT_ID_FW_DUMP_INFO;
+                       pevent->event_len = pmbuf->data_len;
+                       memcpy(pmadapter, (t_u8 *) pevent->event_buf,
+                              pmbuf->pbuf + pmbuf->data_offset,
+                              pevent->event_len);
+                       wlan_recv_event(pmpriv, pevent->event_id, pevent);
+                       pcb->moal_mfree(pmadapter->pmoal_handle, evt_buf);
+               }
+               break;
        default:
                PRINTM(MEVENT, "EVENT: unknown event id: %#x\n", eventcause);
                wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_UNKNOWN, MNULL);
index 465db35..7189933 100644 (file)
@@ -2,20 +2,25 @@
  *
  *  @brief This file contains the functions for station ioctl.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
- *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
+ *
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
+ *
  */
 
 /******************************************************
@@ -2548,9 +2553,6 @@ wlan_sec_ioctl_auth_mode(IN pmlan_adapter pmadapter,
                sec->param.auth_mode = pmpriv->sec_info.authentication_mode;
        else {
                pmpriv->sec_info.authentication_mode = sec->param.auth_mode;
-               if (pmpriv->sec_info.authentication_mode ==
-                   MLAN_AUTH_MODE_NETWORKEAP)
-                       wlan_set_wpa_ie_helper(pmpriv, MNULL, 0);
        }
        pioctl_req->data_read_written = sizeof(t_u32) + MLAN_SUB_COMMAND_SIZE;
        LEAVE();
@@ -2826,6 +2828,7 @@ wlan_sec_ioctl_set_wpa_key(IN pmlan_adapter pmadapter,
                ret = MLAN_STATUS_FAILURE;
                goto exit;
        }
+
        if ((pmpriv->bss_mode == MLAN_BSS_MODE_IBSS) &&
            pmpriv->sec_info.wpa_enabled) {
                /*
@@ -2882,7 +2885,7 @@ wlan_sec_ioctl_set_wpa_key(IN pmlan_adapter pmadapter,
        if (memcmp
            (pmadapter, sec->param.encrypt_key.mac_addr, broadcast_mac_addr,
             MLAN_MAC_ADDR_LENGTH))
-               sec->param.encrypt_key.key_index = MLAN_KEY_INDEX_UNICAST;
+               sec->param.encrypt_key.key_index |= MLAN_KEY_INDEX_UNICAST;
 
        if (remove_key == MTRUE) {
                /* Send request to firmware */
@@ -4937,6 +4940,7 @@ wlan_misc_cfg_ioctl(IN pmlan_adapter pmadapter, IN pmlan_ioctl_req pioctl_req)
                status = wlan_misc_ioctl_custom_ie_list(pmadapter, pioctl_req,
                                                        MTRUE);
                break;
+
        case MLAN_OID_MISC_MAC_CONTROL:
                status = wlan_misc_ioctl_mac_control(pmadapter, pioctl_req);
                break;
index 147061b..0fe4a9b 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file contains the handling of RX in MLAN
  *  module.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
@@ -155,7 +160,6 @@ wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
                HEXDUMP("RX Data: LLC/SNAP",
                        (t_u8 *) & prx_pkt->rfc1042_hdr,
                        sizeof(prx_pkt->rfc1042_hdr));
-
                /* Chop off the RxPD */
                hdr_chop =
                        (t_u32) ((t_ptr) & prx_pkt->eth803_hdr -
@@ -173,7 +177,6 @@ wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
        DBG_HEXDUMP(MDAT_D, "Rx Payload",
                    ((t_u8 *) prx_pd + prx_pd->rx_pkt_offset),
                    MIN(prx_pd->rx_pkt_length, MAX_DATA_DUMP_LEN));
-
        priv->rxpd_rate = prx_pd->rx_rate;
        priv->rxpd_rate_info = prx_pd->rate_info;
 
@@ -290,6 +293,15 @@ wlan_ops_sta_process_rx_packet(IN t_void * adapter, IN pmlan_buffer pmbuf)
                       MLAN_MAC_ADDR_LENGTH);
        }
 
+       if ((priv->port_ctrl_mode == MTRUE && priv->port_open == MFALSE) &&
+           (rx_pkt_type != PKT_TYPE_BAR)) {
+               mlan_11n_rxreorder_pkt(priv, prx_pd->seq_num, prx_pd->priority,
+                                      ta, (t_u8) prx_pd->rx_pkt_type,
+                                      (t_void *) RX_PKT_DROPPED_IN_FW);
+               wlan_process_rx_packet(pmadapter, pmbuf);
+               goto done;
+       }
+
        /* Reorder and send to OS */
        ret = mlan_11n_rxreorder_pkt(priv, prx_pd->seq_num,
                                     prx_pd->priority, ta,
index 64ecddc..0033310 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file contains the handling of data packet
  *  transmission in MLAN module.
  *
- *  Copyright (C) 2008-2011, Marvell International Ltd.
+ *  (C) Copyright 2008-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
@@ -85,8 +90,10 @@ wlan_ops_sta_process_txpd(IN t_void * priv, IN pmlan_buffer pmbuf)
 
        if (pmbuf->data_offset < (sizeof(TxPD) + INTF_HEADER_LEN +
                                  DMA_ALIGNMENT)) {
-               PRINTM(MERROR, "not enough space for TxPD: %d\n",
-                      pmbuf->data_len);
+               PRINTM(MERROR,
+                      "not enough space for TxPD: headroom=%d pkt_len=%d, required=%d\n",
+                      pmbuf->data_offset, pmbuf->data_len,
+                      sizeof(TxPD) + INTF_HEADER_LEN + DMA_ALIGNMENT);
                pmbuf->status_code = MLAN_ERROR_PKT_SIZE_INVALID;
                goto done;
        }
@@ -126,7 +133,6 @@ wlan_ops_sta_process_txpd(IN t_void * priv, IN pmlan_buffer pmbuf)
                                MRVDRV_TxPD_POWER_MGMT_LAST_PACKET;
                }
        }
-
        /* Offset of actual data */
        plocal_tx_pd->tx_pkt_offset =
                (t_u16) ((t_ptr) pmbuf->pbuf + pmbuf->data_offset -
@@ -236,7 +242,6 @@ wlan_send_null_packet(pmlan_private priv, t_u8 flags)
                pmadapter->tx_lock_flag = MTRUE;
                break;
        case MLAN_STATUS_PENDING:
-               pmadapter->data_sent = MFALSE;
                pmadapter->tx_lock_flag = MTRUE;
                break;
        default:
index 52553a2..736710d 100644 (file)
@@ -3,20 +3,25 @@
  *
  *  @brief This file contains the handling of TX/RX in MLAN
  *
- *  Copyright (C) 2009-2011, Marvell International Ltd.
+ *  (C) Copyright 2009-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /*************************************************************
@@ -142,8 +147,6 @@ done:
                wlan_write_data_complete(pmadapter, pmbuf, ret);
                break;
        case MLAN_STATUS_PENDING:
-
-               pmadapter->data_sent = MFALSE;
                DBG_HEXDUMP(MDAT_D, "Tx", head_ptr + INTF_HEADER_LEN,
                            MIN(pmbuf->data_len + sizeof(TxPD),
                                MAX_DATA_DUMP_LEN));
index 080ecd7..bec39fa 100644 (file)
@@ -3,20 +3,25 @@
  *  @brief This file contains related macros, enum, and struct
  *  of uap functionalities
  *
- *  Copyright (C) 2009-2011, Marvell International Ltd.
+ *  (C) Copyright 2009-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
index 73f945a..23cfcda 100644 (file)
@@ -2,20 +2,25 @@
  *
  *  @brief This file contains the handling of AP mode command and event
  *
- *  Copyright (C) 2009-2011, Marvell International Ltd.
+ *  (C) Copyright 2009-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
@@ -3082,6 +3087,10 @@ wlan_ops_uap_prepare_cmd(IN t_void * priv,
                ret = wlan_cmd_wifi_direct_mode(pmpriv, cmd_ptr, cmd_action,
                                                pdata_buf);
                break;
+       case HOST_CMD_P2P_PARAMS_CONFIG:
+               ret = wlan_cmd_p2p_params_config(pmpriv, cmd_ptr, cmd_action,
+                                                pdata_buf);
+               break;
 #endif
        case HostCmd_CMD_802_11_RF_ANTENNA:
                ret = wlan_cmd_802_11_rf_antenna(pmpriv, cmd_ptr, cmd_action,
@@ -3280,6 +3289,9 @@ wlan_ops_uap_process_cmdresp(IN t_void * priv,
        case HOST_CMD_WIFI_DIRECT_MODE_CONFIG:
                ret = wlan_ret_wifi_direct_mode(pmpriv, resp, pioctl_buf);
                break;
+       case HOST_CMD_P2P_PARAMS_CONFIG:
+               ret = wlan_ret_p2p_params_config(pmpriv, resp, pioctl_buf);
+               break;
 #endif
        case HostCmd_CMD_802_11_RF_ANTENNA:
                ret = wlan_ret_802_11_rf_antenna(pmpriv, resp, pioctl_buf);
@@ -3555,7 +3567,7 @@ wlan_ops_uap_process_event(IN t_void * priv)
        case EVENT_REMAIN_ON_CHANNEL_EXPIRED:
                PRINTM(MEVENT, "EVENT: REMAIN_ON_CHANNEL_EXPIRED reason=%d\n",
                       *(t_u16 *) pmadapter->event_body);
-               wlan_recv_event(pmpriv, MLAN_EVENT_ID_FLUSH_RX_WORK, MNULL);
+               wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_FLUSH_RX_WORK, MNULL);
                pevent->event_id = MLAN_EVENT_ID_FW_REMAIN_ON_CHAN_EXPIRED;
                break;
 #endif
index 204439b..88d89e2 100644 (file)
@@ -2,20 +2,25 @@
  *
  *  @brief This file contains the handling of AP mode ioctls
  *
- *  Copyright (C) 2009-2011, Marvell International Ltd.
+ *  (C) Copyright 2009-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *  MARVELL CONFIDENTIAL
+ *  The source code contained or described herein and all documents related to
+ *  the source code ("Material") are owned by Marvell International Ltd or its
+ *  suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ *  or its suppliers and licensors. The Material contains trade secrets and
+ *  proprietary and confidential information of Marvell or its suppliers and
+ *  licensors. The Material is protected by worldwide copyright and trade secret
+ *  laws and treaty provisions. No part of the Material may be used, copied,
+ *  reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ *  or disclosed in any way without Marvell's prior express written permission.
+ *
+ *  No license under any patent, copyright, trade secret or other intellectual
+ *  property right is granted to or conferred upon you by disclosure or delivery
+ *  of the Materials, either expressly, by implication, inducement, estoppel or
+ *  otherwise. Any license under such intellectual property rights must be
+ *  express and approved by Marvell in writing.
  *
- *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
- *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
- *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
- *  this warranty disclaimer.
  */
 
 /********************************************************
@@ -1395,6 +1400,10 @@ wlan_ops_uap_ioctl(t_void * adapter, pmlan_ioctl_req pioctl_req)
                if (misc->sub_command == MLAN_OID_MISC_MULTI_CHAN_POLICY)
                        status = wlan_misc_ioctl_multi_chan_policy(pmadapter,
                                                                   pioctl_req);
+#ifdef WIFI_DIRECT_SUPPORT
+               if (misc->sub_command == MLAN_OID_MISC_WIFI_DIRECT_CONFIG)
+                       status = wlan_misc_p2p_config(pmadapter, pioctl_req);
+#endif
                break;
        case MLAN_IOCTL_PM_CFG:
                pm = (mlan_ds_pm_cfg *) pioctl_req->pbuf;
index 879d5b9..161762e 100644 (file)
@@ -2,20 +2,25 @@
  *
  *  @brief This file contains AP mode transmit and receive functions
  *
- *  Copyright (C) 2009-2011, Marvell International Ltd.
+ *  (C) Copyright 2009-2011 Marvell International Ltd. All Rights Reserved
  *
- *  This software file (the "File") is distributed by Marvell International
- *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
- *  (the "License").  You may use, redistribute and/or modify this File in
- *  accordance with the terms and conditions of the License, a copy of which
- *  is available by writing to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
- *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *&nbs