Commit 54fdb318 authored by Siva Rebbagondla's avatar Siva Rebbagondla Committed by Kalle Valo

rsi: add new device model for 9116

9116 device id entry is added in both SDIO and USB interfaces.
New enumberation value taken for the device model. Based on the
device model detected run time, few device specific operations
needs to be performed.

adding rsi_dev_model to get device type in run time, as we can use
same driver for 9113 and 9116 except few firmware load changes.
Signed-off-by: default avatarSiva Rebbagondla <siva8118@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 9ea3812f
...@@ -949,7 +949,7 @@ static int rsi_probe(struct sdio_func *pfunction, ...@@ -949,7 +949,7 @@ static int rsi_probe(struct sdio_func *pfunction,
{ {
struct rsi_hw *adapter; struct rsi_hw *adapter;
struct rsi_91x_sdiodev *sdev; struct rsi_91x_sdiodev *sdev;
int status; int status = -EINVAL;
rsi_dbg(INIT_ZONE, "%s: Init function called\n", __func__); rsi_dbg(INIT_ZONE, "%s: Init function called\n", __func__);
...@@ -968,6 +968,20 @@ static int rsi_probe(struct sdio_func *pfunction, ...@@ -968,6 +968,20 @@ static int rsi_probe(struct sdio_func *pfunction,
status = -EIO; status = -EIO;
goto fail_free_adapter; goto fail_free_adapter;
} }
if (pfunction->device == RSI_SDIO_PID_9113) {
rsi_dbg(ERR_ZONE, "%s: 9113 module detected\n", __func__);
adapter->device_model = RSI_DEV_9113;
} else if (pfunction->device == RSI_SDIO_PID_9116) {
rsi_dbg(ERR_ZONE, "%s: 9116 module detected\n", __func__);
adapter->device_model = RSI_DEV_9116;
} else {
rsi_dbg(ERR_ZONE,
"%s: Unsupported RSI device id 0x%x\n", __func__,
pfunction->device);
goto fail_free_adapter;
}
sdev = (struct rsi_91x_sdiodev *)adapter->rsi_dev; sdev = (struct rsi_91x_sdiodev *)adapter->rsi_dev;
rsi_init_event(&sdev->rx_thread.event); rsi_init_event(&sdev->rx_thread.event);
status = rsi_create_kthread(adapter->priv, &sdev->rx_thread, status = rsi_create_kthread(adapter->priv, &sdev->rx_thread,
...@@ -1415,7 +1429,8 @@ static const struct dev_pm_ops rsi_pm_ops = { ...@@ -1415,7 +1429,8 @@ static const struct dev_pm_ops rsi_pm_ops = {
#endif #endif
static const struct sdio_device_id rsi_dev_table[] = { static const struct sdio_device_id rsi_dev_table[] = {
{ SDIO_DEVICE(RSI_SDIO_VID_9113, RSI_SDIO_PID_9113) }, { SDIO_DEVICE(RSI_SDIO_VENDOR_ID, RSI_SDIO_PID_9113) },
{ SDIO_DEVICE(RSI_SDIO_VENDOR_ID, RSI_SDIO_PID_9116) },
{ /* Blank */}, { /* Blank */},
}; };
......
...@@ -763,6 +763,18 @@ static int rsi_probe(struct usb_interface *pfunction, ...@@ -763,6 +763,18 @@ static int rsi_probe(struct usb_interface *pfunction,
rsi_dbg(ERR_ZONE, "%s: Initialized os intf ops\n", __func__); rsi_dbg(ERR_ZONE, "%s: Initialized os intf ops\n", __func__);
if (id && id->idProduct == RSI_USB_PID_9113) {
rsi_dbg(INIT_ZONE, "%s: 9113 module detected\n", __func__);
adapter->device_model = RSI_DEV_9113;
} else if (id && id->idProduct == RSI_USB_PID_9116) {
rsi_dbg(INIT_ZONE, "%s: 9116 module detected\n", __func__);
adapter->device_model = RSI_DEV_9116;
} else {
rsi_dbg(ERR_ZONE, "%s: Unsupported RSI device id 0x%x\n",
__func__, id->idProduct);
goto err1;
}
dev = (struct rsi_91x_usbdev *)adapter->rsi_dev; dev = (struct rsi_91x_usbdev *)adapter->rsi_dev;
status = rsi_usb_reg_read(dev->usbdev, FW_STATUS_REG, &fw_status, 2); status = rsi_usb_reg_read(dev->usbdev, FW_STATUS_REG, &fw_status, 2);
...@@ -845,7 +857,8 @@ static int rsi_resume(struct usb_interface *intf) ...@@ -845,7 +857,8 @@ static int rsi_resume(struct usb_interface *intf)
#endif #endif
static const struct usb_device_id rsi_dev_table[] = { static const struct usb_device_id rsi_dev_table[] = {
{ USB_DEVICE(RSI_USB_VID_9113, RSI_USB_PID_9113) }, { USB_DEVICE(RSI_USB_VENDOR_ID, RSI_USB_PID_9113) },
{ USB_DEVICE(RSI_USB_VENDOR_ID, RSI_USB_PID_9116) },
{ /* Blank */}, { /* Blank */},
}; };
......
...@@ -111,9 +111,13 @@ extern __printf(2, 3) void rsi_dbg(u32 zone, const char *fmt, ...); ...@@ -111,9 +111,13 @@ extern __printf(2, 3) void rsi_dbg(u32 zone, const char *fmt, ...);
#define RSI_WOW_ENABLED BIT(0) #define RSI_WOW_ENABLED BIT(0)
#define RSI_WOW_NO_CONNECTION BIT(1) #define RSI_WOW_NO_CONNECTION BIT(1)
#define RSI_DEV_9113 1
#define RSI_MAX_RX_PKTS 64 #define RSI_MAX_RX_PKTS 64
enum rsi_dev_model {
RSI_DEV_9113 = 0,
RSI_DEV_9116
};
struct version_info { struct version_info {
u16 major; u16 major;
u16 minor; u16 minor;
...@@ -329,7 +333,7 @@ struct eeprom_read { ...@@ -329,7 +333,7 @@ struct eeprom_read {
struct rsi_hw { struct rsi_hw {
struct rsi_common *priv; struct rsi_common *priv;
u8 device_model; enum rsi_dev_model device_model;
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
struct ieee80211_vif *vifs[RSI_MAX_VIFS]; struct ieee80211_vif *vifs[RSI_MAX_VIFS];
struct ieee80211_tx_queue_params edca_params[NUM_EDCA_QUEUES]; struct ieee80211_tx_queue_params edca_params[NUM_EDCA_QUEUES];
......
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
#include <linux/mmc/sdio_ids.h> #include <linux/mmc/sdio_ids.h>
#include "rsi_main.h" #include "rsi_main.h"
#define RSI_SDIO_VID_9113 0x041B #define RSI_SDIO_VENDOR_ID 0x041B
#define RSI_SDIO_PID_9113 0x9330 #define RSI_SDIO_PID_9113 0x9330
#define RSI_SDIO_PID_9116 0x9116
enum sdio_interrupt_type { enum sdio_interrupt_type {
BUFFER_FULL = 0x0, BUFFER_FULL = 0x0,
......
...@@ -22,8 +22,9 @@ ...@@ -22,8 +22,9 @@
#include "rsi_main.h" #include "rsi_main.h"
#include "rsi_common.h" #include "rsi_common.h"
#define RSI_USB_VID_9113 0x1618 #define RSI_USB_VENDOR_ID 0x1618
#define RSI_USB_PID_9113 0x9113 #define RSI_USB_PID_9113 0x9113
#define RSI_USB_PID_9116 0x9116
#define USB_INTERNAL_REG_1 0x25000 #define USB_INTERNAL_REG_1 0x25000
#define RSI_USB_READY_MAGIC_NUM 0xab #define RSI_USB_READY_MAGIC_NUM 0xab
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment