Commit e70a5ac5 authored by Bing Zhao's avatar Bing Zhao Committed by John W. Linville

libertas: define macros for SDIO model numbers

replace direct usages of SDIO model numbers with defined macros.
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Acked-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ea2d0639
...@@ -66,19 +66,19 @@ struct if_sdio_model { ...@@ -66,19 +66,19 @@ struct if_sdio_model {
static struct if_sdio_model if_sdio_models[] = { static struct if_sdio_model if_sdio_models[] = {
{ {
/* 8385 */ /* 8385 */
.model = 0x04, .model = IF_SDIO_MODEL_8385,
.helper = "sd8385_helper.bin", .helper = "sd8385_helper.bin",
.firmware = "sd8385.bin", .firmware = "sd8385.bin",
}, },
{ {
/* 8686 */ /* 8686 */
.model = 0x0B, .model = IF_SDIO_MODEL_8686,
.helper = "sd8686_helper.bin", .helper = "sd8686_helper.bin",
.firmware = "sd8686.bin", .firmware = "sd8686.bin",
}, },
{ {
/* 8688 */ /* 8688 */
.model = 0x10, .model = IF_SDIO_MODEL_8688,
.helper = "sd8688_helper.bin", .helper = "sd8688_helper.bin",
.firmware = "sd8688.bin", .firmware = "sd8688.bin",
}, },
...@@ -118,7 +118,7 @@ static u16 if_sdio_read_scratch(struct if_sdio_card *card, int *err) ...@@ -118,7 +118,7 @@ static u16 if_sdio_read_scratch(struct if_sdio_card *card, int *err)
int ret, reg; int ret, reg;
u16 scratch; u16 scratch;
if (card->model == 0x04) if (card->model == IF_SDIO_MODEL_8385)
reg = IF_SDIO_SCRATCH_OLD; reg = IF_SDIO_SCRATCH_OLD;
else else
reg = IF_SDIO_SCRATCH; reg = IF_SDIO_SCRATCH;
...@@ -216,7 +216,7 @@ static int if_sdio_handle_event(struct if_sdio_card *card, ...@@ -216,7 +216,7 @@ static int if_sdio_handle_event(struct if_sdio_card *card,
lbs_deb_enter(LBS_DEB_SDIO); lbs_deb_enter(LBS_DEB_SDIO);
if (card->model == 0x04) { if (card->model == IF_SDIO_MODEL_8385) {
event = sdio_readb(card->func, IF_SDIO_EVENT, &ret); event = sdio_readb(card->func, IF_SDIO_EVENT, &ret);
if (ret) if (ret)
goto out; goto out;
...@@ -830,7 +830,7 @@ static int if_sdio_probe(struct sdio_func *func, ...@@ -830,7 +830,7 @@ static int if_sdio_probe(struct sdio_func *func,
"ID: %x", &model) == 1) "ID: %x", &model) == 1)
break; break;
if (!strcmp(func->card->info[i], "IBIS Wireless SDIO Card")) { if (!strcmp(func->card->info[i], "IBIS Wireless SDIO Card")) {
model = 4; model = IF_SDIO_MODEL_8385;
break; break;
} }
} }
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
#ifndef _LBS_IF_SDIO_H #ifndef _LBS_IF_SDIO_H
#define _LBS_IF_SDIO_H #define _LBS_IF_SDIO_H
#define IF_SDIO_MODEL_8385 0x04
#define IF_SDIO_MODEL_8686 0x0b
#define IF_SDIO_MODEL_8688 0x10
#define IF_SDIO_IOPORT 0x00 #define IF_SDIO_IOPORT 0x00
#define IF_SDIO_H_INT_MASK 0x04 #define IF_SDIO_H_INT_MASK 0x04
......
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