module_param(gpio_wakeup, int, 0644);
MODULE_PARM_DESC(gpio_wakeup, "gpio number for wakeup. -1 for none.");
-static char *slk_key;
-module_param(slk_key, charp, 0600);
-MODULE_PARM_DESC(slk_key, "secret key for secure link (expect 64 hexadecimal digits).");
-
#define RATETAB_ENT(_rate, _rateid, _flags) { \
.bitrate = (_rate), \
.hw_value = (_rateid), \
return ret;
}
-static void wfx_fill_sl_key(struct device *dev, struct wfx_platform_data *pdata)
-{
- const char *ascii_key = NULL;
- int ret = 0;
-
- if (slk_key)
- ascii_key = slk_key;
- if (!ascii_key)
- ret = of_property_read_string(dev->of_node, "slk_key", &ascii_key);
- if (ret == -EILSEQ || ret == -ENODATA)
- dev_err(dev, "ignoring malformatted key from DT\n");
- if (!ascii_key)
- return;
-
- ret = hex2bin(pdata->slk_key, ascii_key, sizeof(pdata->slk_key));
- if (ret) {
- dev_err(dev, "ignoring malformatted key: %s\n", ascii_key);
- memset(pdata->slk_key, 0, sizeof(pdata->slk_key));
- return;
- }
- dev_err(dev, "secure link is not supported by this driver, ignoring provided key\n");
-}
-
/* NOTE: wfx_send_pds() destroy buf */
int wfx_send_pds(struct wfx_dev *wdev, unsigned char *buf, size_t len)
{
memcpy(&wdev->pdata, pdata, sizeof(*pdata));
of_property_read_string(dev->of_node, "config-file", &wdev->pdata.file_pds);
wdev->pdata.gpio_wakeup = wfx_get_gpio(dev, gpio_wakeup, "wakeup");
- wfx_fill_sl_key(dev, &wdev->pdata);
+ wfx_sl_fill_pdata(dev, &wdev->pdata);
mutex_init(&wdev->conf_mutex);
mutex_init(&wdev->rx_stats_lock);
#ifndef WFX_SECURE_LINK_H
#define WFX_SECURE_LINK_H
+#include <linux/of.h>
+
#include "hif_api_general.h"
struct wfx_dev;
return -EIO;
}
+static inline void wfx_sl_fill_pdata(struct device *dev,
+ struct wfx_platform_data *pdata)
+{
+ if (of_find_property(dev->of_node, "slk_key", NULL))
+ dev_err(dev, "secure link is not supported by this driver, ignoring provided key\n");
+}
+
static inline int wfx_sl_init(struct wfx_dev *wdev)
{
return -EIO;