{
struct mwifiex_adapter *adapter = priv->adapter;
struct property *prop = data_buf;
- u32 len;
+ u32 len = 0;
u8 *data = (u8 *)cmd + S_DS_GEN;
int ret;
+ const struct firmware *cal_data = adapter->cal_data;
if (prop) {
len = prop->length;
mwifiex_dbg(adapter, INFO,
"download cfg_data from device tree: %s\n",
prop->name);
- } else if (adapter->cal_data->data && adapter->cal_data->size > 0) {
- len = mwifiex_parse_cal_cfg((u8 *)adapter->cal_data->data,
- adapter->cal_data->size, data);
- mwifiex_dbg(adapter, INFO,
- "download cfg_data from config file\n");
+ } else if (cal_data) {
+ if (cal_data->data && cal_data->size > 0) {
+ len = mwifiex_parse_cal_cfg((u8 *)cal_data->data,
+ cal_data->size, data);
+ mwifiex_dbg(adapter, INFO,
+ "download cfg_data from config file\n");
+ } else {
+ return -1;
+ }
+ } else if (adapter->cfg_data && adapter->cfg_len > 0) {
+ len = mwifiex_parse_cal_cfg(adapter->cfg_data,
+ adapter->cfg_len, data);
+ mwifiex_dbg(adapter, INFO, "download cfg_data from iw vendor command\n");
} else {
return -1;
}
--- /dev/null
+/* Marvell Wireless LAN device driver: TDLS handling
+ *
+ * Copyright (C) 2014, 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 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.
+ */
+
+#include <net/mac80211.h>
+#include <net/netlink.h>
+#include "vendor.h"
+#include "main.h"
+
+static int
+marvell_vendor_cmd_set_turbo_mode(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ const void *data, int data_len)
+{
+ struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
+ u8 mode = *(u8 *)data;
+ int ret;
+
+ ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_SNMP_MIB,
+ HostCmd_ACT_GEN_SET, TURBO_MODE_I, &mode, true);
+
+ return 0;
+}
+
+static int
+mwifiex_vendor_cmd_set_cfg_data(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ const void *data, int data_len)
+{
+ struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
+ int ret;
+
+ priv->adapter->cfg_data = (u8 *)data;
+ priv->adapter->cfg_len = data_len;
+
+ ret = mwifiex_send_cmd(priv, HostCmd_CMD_CFG_DATA,
+ HostCmd_ACT_GEN_SET, 0, NULL, true);
+
+ priv->adapter->cfg_data = NULL;
+ priv->adapter->cfg_len = 0;
+
+ return 0;
+}
+
+static const struct wiphy_vendor_command marvell_vendor_commands[] = {
+ {
+ .info = {
+ .vendor_id = MARVELL_OUI,
+ .subcmd = MARVELL_VENDOR_CMD_SET_TURBO_MODE,
+ },
+ .flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
+ WIPHY_VENDOR_CMD_NEED_RUNNING,
+ .doit = marvell_vendor_cmd_set_turbo_mode,
+ },
+ {
+ .info = {
+ .vendor_id = MARVELL_OUI,
+ .subcmd = MARVELL_VENDOR_CMD_SET_CONF_DATA,
+ },
+ .flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
+ WIPHY_VENDOR_CMD_NEED_RUNNING,
+ .doit = mwifiex_vendor_cmd_set_cfg_data,
+ },
+};
+
+void marvell_set_vendor_commands(struct wiphy *wiphy)
+{
+ wiphy->vendor_commands = marvell_vendor_commands;
+ wiphy->n_vendor_commands = ARRAY_SIZE(marvell_vendor_commands);
+}
--- /dev/null
+/* Marvell Wireless LAN device driver: TDLS handling
+ *
+ * Copyright (C) 2014, 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 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.
+ */
+
+#ifndef __MARVELL_VENDOR_H__
+#define __MARVELL_VENDOR_H__
+
+#define MARVELL_OUI 0x005043
+
+enum marvell_vendor_commands {
+ MARVELL_VENDOR_CMD_SET_TURBO_MODE,
+ MARVELL_VENDOR_CMD_SET_CONF_DATA,
+};
+
+#endif /* __MARVELL_VENDOR_H__ */