diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/orinoco/airport.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/cfg.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/fw.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hermes.c | 52 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hermes.h | 50 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hermes_dld.c | 34 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hw.c | 63 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/main.c | 83 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/wext.c | 6 |
9 files changed, 154 insertions, 140 deletions
diff --git a/drivers/net/wireless/orinoco/airport.c b/drivers/net/wireless/orinoco/airport.c index c60df2c1aca3..ea23c4fdbf62 100644 --- a/drivers/net/wireless/orinoco/airport.c +++ b/drivers/net/wireless/orinoco/airport.c | |||
@@ -195,7 +195,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match) | |||
195 | ssleep(1); | 195 | ssleep(1); |
196 | 196 | ||
197 | /* Reset it before we get the interrupt */ | 197 | /* Reset it before we get the interrupt */ |
198 | hermes_init(hw); | 198 | hw->ops->init(hw); |
199 | 199 | ||
200 | if (request_irq(card->irq, orinoco_interrupt, 0, DRIVER_NAME, priv)) { | 200 | if (request_irq(card->irq, orinoco_interrupt, 0, DRIVER_NAME, priv)) { |
201 | printk(KERN_ERR PFX "Couldn't get IRQ %d\n", card->irq); | 201 | printk(KERN_ERR PFX "Couldn't get IRQ %d\n", card->irq); |
diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c index 90dd4d0595c3..81d228de9e5d 100644 --- a/drivers/net/wireless/orinoco/cfg.c +++ b/drivers/net/wireless/orinoco/cfg.c | |||
@@ -189,7 +189,7 @@ static int orinoco_set_channel(struct wiphy *wiphy, | |||
189 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { | 189 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { |
190 | /* Fast channel change - no commit if successful */ | 190 | /* Fast channel change - no commit if successful */ |
191 | hermes_t *hw = &priv->hw; | 191 | hermes_t *hw = &priv->hw; |
192 | err = hermes_docmd_wait(hw, HERMES_CMD_TEST | | 192 | err = hw->ops->cmd_wait(hw, HERMES_CMD_TEST | |
193 | HERMES_TEST_SET_CHANNEL, | 193 | HERMES_TEST_SET_CHANNEL, |
194 | channel, NULL); | 194 | channel, NULL); |
195 | } | 195 | } |
diff --git a/drivers/net/wireless/orinoco/fw.c b/drivers/net/wireless/orinoco/fw.c index cfa72962052b..07c79e5de32d 100644 --- a/drivers/net/wireless/orinoco/fw.c +++ b/drivers/net/wireless/orinoco/fw.c | |||
@@ -259,7 +259,7 @@ symbol_dl_image(struct orinoco_private *priv, const struct fw_info *fw, | |||
259 | } | 259 | } |
260 | 260 | ||
261 | /* Reset hermes chip and make sure it responds */ | 261 | /* Reset hermes chip and make sure it responds */ |
262 | ret = hermes_init(hw); | 262 | ret = hw->ops->init(hw); |
263 | 263 | ||
264 | /* hermes_reset() should return 0 with the secondary firmware */ | 264 | /* hermes_reset() should return 0 with the secondary firmware */ |
265 | if (secondary && ret != 0) | 265 | if (secondary && ret != 0) |
diff --git a/drivers/net/wireless/orinoco/hermes.c b/drivers/net/wireless/orinoco/hermes.c index 1a2fca76fd3c..a7df5240779c 100644 --- a/drivers/net/wireless/orinoco/hermes.c +++ b/drivers/net/wireless/orinoco/hermes.c | |||
@@ -70,6 +70,7 @@ | |||
70 | 70 | ||
71 | #endif /* ! HERMES_DEBUG */ | 71 | #endif /* ! HERMES_DEBUG */ |
72 | 72 | ||
73 | static const struct hermes_ops hermes_ops_local; | ||
73 | 74 | ||
74 | /* | 75 | /* |
75 | * Internal functions | 76 | * Internal functions |
@@ -111,9 +112,9 @@ static int hermes_issue_cmd(hermes_t *hw, u16 cmd, u16 param0, | |||
111 | */ | 112 | */ |
112 | 113 | ||
113 | /* For doing cmds that wipe the magic constant in SWSUPPORT0 */ | 114 | /* For doing cmds that wipe the magic constant in SWSUPPORT0 */ |
114 | int hermes_doicmd_wait(hermes_t *hw, u16 cmd, | 115 | static int hermes_doicmd_wait(hermes_t *hw, u16 cmd, |
115 | u16 parm0, u16 parm1, u16 parm2, | 116 | u16 parm0, u16 parm1, u16 parm2, |
116 | struct hermes_response *resp) | 117 | struct hermes_response *resp) |
117 | { | 118 | { |
118 | int err = 0; | 119 | int err = 0; |
119 | int k; | 120 | int k; |
@@ -163,17 +164,17 @@ int hermes_doicmd_wait(hermes_t *hw, u16 cmd, | |||
163 | out: | 164 | out: |
164 | return err; | 165 | return err; |
165 | } | 166 | } |
166 | EXPORT_SYMBOL(hermes_doicmd_wait); | ||
167 | 167 | ||
168 | void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing) | 168 | void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing) |
169 | { | 169 | { |
170 | hw->iobase = address; | 170 | hw->iobase = address; |
171 | hw->reg_spacing = reg_spacing; | 171 | hw->reg_spacing = reg_spacing; |
172 | hw->inten = 0x0; | 172 | hw->inten = 0x0; |
173 | hw->ops = &hermes_ops_local; | ||
173 | } | 174 | } |
174 | EXPORT_SYMBOL(hermes_struct_init); | 175 | EXPORT_SYMBOL(hermes_struct_init); |
175 | 176 | ||
176 | int hermes_init(hermes_t *hw) | 177 | static int hermes_init(hermes_t *hw) |
177 | { | 178 | { |
178 | u16 reg; | 179 | u16 reg; |
179 | int err = 0; | 180 | int err = 0; |
@@ -217,7 +218,6 @@ int hermes_init(hermes_t *hw) | |||
217 | 218 | ||
218 | return err; | 219 | return err; |
219 | } | 220 | } |
220 | EXPORT_SYMBOL(hermes_init); | ||
221 | 221 | ||
222 | /* Issue a command to the chip, and (busy!) wait for it to | 222 | /* Issue a command to the chip, and (busy!) wait for it to |
223 | * complete. | 223 | * complete. |
@@ -228,8 +228,8 @@ EXPORT_SYMBOL(hermes_init); | |||
228 | * > 0 on error returned by the firmware | 228 | * > 0 on error returned by the firmware |
229 | * | 229 | * |
230 | * Callable from any context, but locking is your problem. */ | 230 | * Callable from any context, but locking is your problem. */ |
231 | int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0, | 231 | static int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0, |
232 | struct hermes_response *resp) | 232 | struct hermes_response *resp) |
233 | { | 233 | { |
234 | int err; | 234 | int err; |
235 | int k; | 235 | int k; |
@@ -291,9 +291,8 @@ int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0, | |||
291 | out: | 291 | out: |
292 | return err; | 292 | return err; |
293 | } | 293 | } |
294 | EXPORT_SYMBOL(hermes_docmd_wait); | ||
295 | 294 | ||
296 | int hermes_allocate(hermes_t *hw, u16 size, u16 *fid) | 295 | static int hermes_allocate(hermes_t *hw, u16 size, u16 *fid) |
297 | { | 296 | { |
298 | int err = 0; | 297 | int err = 0; |
299 | int k; | 298 | int k; |
@@ -333,7 +332,6 @@ int hermes_allocate(hermes_t *hw, u16 size, u16 *fid) | |||
333 | 332 | ||
334 | return 0; | 333 | return 0; |
335 | } | 334 | } |
336 | EXPORT_SYMBOL(hermes_allocate); | ||
337 | 335 | ||
338 | /* Set up a BAP to read a particular chunk of data from card's internal buffer. | 336 | /* Set up a BAP to read a particular chunk of data from card's internal buffer. |
339 | * | 337 | * |
@@ -403,8 +401,8 @@ static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset) | |||
403 | * 0 on success | 401 | * 0 on success |
404 | * > 0 on error from firmware | 402 | * > 0 on error from firmware |
405 | */ | 403 | */ |
406 | int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len, | 404 | static int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len, |
407 | u16 id, u16 offset) | 405 | u16 id, u16 offset) |
408 | { | 406 | { |
409 | int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; | 407 | int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; |
410 | int err = 0; | 408 | int err = 0; |
@@ -422,7 +420,6 @@ int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len, | |||
422 | out: | 420 | out: |
423 | return err; | 421 | return err; |
424 | } | 422 | } |
425 | EXPORT_SYMBOL(hermes_bap_pread); | ||
426 | 423 | ||
427 | /* Write a block of data to the chip's buffer, via the | 424 | /* Write a block of data to the chip's buffer, via the |
428 | * BAP. Synchronization/serialization is the caller's problem. | 425 | * BAP. Synchronization/serialization is the caller's problem. |
@@ -432,8 +429,8 @@ EXPORT_SYMBOL(hermes_bap_pread); | |||
432 | * 0 on success | 429 | * 0 on success |
433 | * > 0 on error from firmware | 430 | * > 0 on error from firmware |
434 | */ | 431 | */ |
435 | int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len, | 432 | static int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len, |
436 | u16 id, u16 offset) | 433 | u16 id, u16 offset) |
437 | { | 434 | { |
438 | int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; | 435 | int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; |
439 | int err = 0; | 436 | int err = 0; |
@@ -451,7 +448,6 @@ int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len, | |||
451 | out: | 448 | out: |
452 | return err; | 449 | return err; |
453 | } | 450 | } |
454 | EXPORT_SYMBOL(hermes_bap_pwrite); | ||
455 | 451 | ||
456 | /* Read a Length-Type-Value record from the card. | 452 | /* Read a Length-Type-Value record from the card. |
457 | * | 453 | * |
@@ -461,8 +457,8 @@ EXPORT_SYMBOL(hermes_bap_pwrite); | |||
461 | * practice. | 457 | * practice. |
462 | * | 458 | * |
463 | * Callable from user or bh context. */ | 459 | * Callable from user or bh context. */ |
464 | int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned bufsize, | 460 | static int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned bufsize, |
465 | u16 *length, void *buf) | 461 | u16 *length, void *buf) |
466 | { | 462 | { |
467 | int err = 0; | 463 | int err = 0; |
468 | int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; | 464 | int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; |
@@ -505,10 +501,9 @@ int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned bufsize, | |||
505 | 501 | ||
506 | return 0; | 502 | return 0; |
507 | } | 503 | } |
508 | EXPORT_SYMBOL(hermes_read_ltv); | ||
509 | 504 | ||
510 | int hermes_write_ltv(hermes_t *hw, int bap, u16 rid, | 505 | static int hermes_write_ltv(hermes_t *hw, int bap, u16 rid, |
511 | u16 length, const void *value) | 506 | u16 length, const void *value) |
512 | { | 507 | { |
513 | int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; | 508 | int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; |
514 | int err = 0; | 509 | int err = 0; |
@@ -533,4 +528,15 @@ int hermes_write_ltv(hermes_t *hw, int bap, u16 rid, | |||
533 | 528 | ||
534 | return err; | 529 | return err; |
535 | } | 530 | } |
536 | EXPORT_SYMBOL(hermes_write_ltv); | 531 | |
532 | /* Hermes operations for local buses */ | ||
533 | static const struct hermes_ops hermes_ops_local = { | ||
534 | .init = hermes_init, | ||
535 | .cmd_wait = hermes_docmd_wait, | ||
536 | .init_cmd_wait = hermes_doicmd_wait, | ||
537 | .allocate = hermes_allocate, | ||
538 | .read_ltv = hermes_read_ltv, | ||
539 | .write_ltv = hermes_write_ltv, | ||
540 | .bap_pread = hermes_bap_pread, | ||
541 | .bap_pwrite = hermes_bap_pwrite | ||
542 | }; | ||
diff --git a/drivers/net/wireless/orinoco/hermes.h b/drivers/net/wireless/orinoco/hermes.h index 2dddbb597c4d..18b268c54dfe 100644 --- a/drivers/net/wireless/orinoco/hermes.h +++ b/drivers/net/wireless/orinoco/hermes.h | |||
@@ -374,6 +374,27 @@ struct hermes_multicast { | |||
374 | /* Timeouts */ | 374 | /* Timeouts */ |
375 | #define HERMES_BAP_BUSY_TIMEOUT (10000) /* In iterations of ~1us */ | 375 | #define HERMES_BAP_BUSY_TIMEOUT (10000) /* In iterations of ~1us */ |
376 | 376 | ||
377 | struct hermes; | ||
378 | |||
379 | /* Functions to access hardware */ | ||
380 | struct hermes_ops { | ||
381 | int (*init)(struct hermes *hw); | ||
382 | int (*cmd_wait)(struct hermes *hw, u16 cmd, u16 parm0, | ||
383 | struct hermes_response *resp); | ||
384 | int (*init_cmd_wait)(struct hermes *hw, u16 cmd, | ||
385 | u16 parm0, u16 parm1, u16 parm2, | ||
386 | struct hermes_response *resp); | ||
387 | int (*allocate)(struct hermes *hw, u16 size, u16 *fid); | ||
388 | int (*read_ltv)(struct hermes *hw, int bap, u16 rid, unsigned buflen, | ||
389 | u16 *length, void *buf); | ||
390 | int (*write_ltv)(struct hermes *hw, int bap, u16 rid, | ||
391 | u16 length, const void *value); | ||
392 | int (*bap_pread)(struct hermes *hw, int bap, void *buf, int len, | ||
393 | u16 id, u16 offset); | ||
394 | int (*bap_pwrite)(struct hermes *hw, int bap, const void *buf, | ||
395 | int len, u16 id, u16 offset); | ||
396 | }; | ||
397 | |||
377 | /* Basic control structure */ | 398 | /* Basic control structure */ |
378 | typedef struct hermes { | 399 | typedef struct hermes { |
379 | void __iomem *iobase; | 400 | void __iomem *iobase; |
@@ -381,6 +402,7 @@ typedef struct hermes { | |||
381 | #define HERMES_16BIT_REGSPACING 0 | 402 | #define HERMES_16BIT_REGSPACING 0 |
382 | #define HERMES_32BIT_REGSPACING 1 | 403 | #define HERMES_32BIT_REGSPACING 1 |
383 | u16 inten; /* Which interrupts should be enabled? */ | 404 | u16 inten; /* Which interrupts should be enabled? */ |
405 | const struct hermes_ops *ops; | ||
384 | } hermes_t; | 406 | } hermes_t; |
385 | 407 | ||
386 | /* Register access convenience macros */ | 408 | /* Register access convenience macros */ |
@@ -394,22 +416,6 @@ typedef struct hermes { | |||
394 | 416 | ||
395 | /* Function prototypes */ | 417 | /* Function prototypes */ |
396 | void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing); | 418 | void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing); |
397 | int hermes_init(hermes_t *hw); | ||
398 | int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0, | ||
399 | struct hermes_response *resp); | ||
400 | int hermes_doicmd_wait(hermes_t *hw, u16 cmd, | ||
401 | u16 parm0, u16 parm1, u16 parm2, | ||
402 | struct hermes_response *resp); | ||
403 | int hermes_allocate(hermes_t *hw, u16 size, u16 *fid); | ||
404 | |||
405 | int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len, | ||
406 | u16 id, u16 offset); | ||
407 | int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len, | ||
408 | u16 id, u16 offset); | ||
409 | int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned buflen, | ||
410 | u16 *length, void *buf); | ||
411 | int hermes_write_ltv(hermes_t *hw, int bap, u16 rid, | ||
412 | u16 length, const void *value); | ||
413 | 419 | ||
414 | /* Inline functions */ | 420 | /* Inline functions */ |
415 | 421 | ||
@@ -426,13 +432,13 @@ static inline void hermes_set_irqmask(hermes_t *hw, u16 events) | |||
426 | 432 | ||
427 | static inline int hermes_enable_port(hermes_t *hw, int port) | 433 | static inline int hermes_enable_port(hermes_t *hw, int port) |
428 | { | 434 | { |
429 | return hermes_docmd_wait(hw, HERMES_CMD_ENABLE | (port << 8), | 435 | return hw->ops->cmd_wait(hw, HERMES_CMD_ENABLE | (port << 8), |
430 | 0, NULL); | 436 | 0, NULL); |
431 | } | 437 | } |
432 | 438 | ||
433 | static inline int hermes_disable_port(hermes_t *hw, int port) | 439 | static inline int hermes_disable_port(hermes_t *hw, int port) |
434 | { | 440 | { |
435 | return hermes_docmd_wait(hw, HERMES_CMD_DISABLE | (port << 8), | 441 | return hw->ops->cmd_wait(hw, HERMES_CMD_DISABLE | (port << 8), |
436 | 0, NULL); | 442 | 0, NULL); |
437 | } | 443 | } |
438 | 444 | ||
@@ -440,7 +446,7 @@ static inline int hermes_disable_port(hermes_t *hw, int port) | |||
440 | * information frame in __orinoco_ev_info() */ | 446 | * information frame in __orinoco_ev_info() */ |
441 | static inline int hermes_inquire(hermes_t *hw, u16 rid) | 447 | static inline int hermes_inquire(hermes_t *hw, u16 rid) |
442 | { | 448 | { |
443 | return hermes_docmd_wait(hw, HERMES_CMD_INQUIRE, rid, NULL); | 449 | return hw->ops->cmd_wait(hw, HERMES_CMD_INQUIRE, rid, NULL); |
444 | } | 450 | } |
445 | 451 | ||
446 | #define HERMES_BYTES_TO_RECLEN(n) ((((n)+1)/2) + 1) | 452 | #define HERMES_BYTES_TO_RECLEN(n) ((((n)+1)/2) + 1) |
@@ -475,10 +481,10 @@ static inline void hermes_clear_words(struct hermes *hw, int off, | |||
475 | } | 481 | } |
476 | 482 | ||
477 | #define HERMES_READ_RECORD(hw, bap, rid, buf) \ | 483 | #define HERMES_READ_RECORD(hw, bap, rid, buf) \ |
478 | (hermes_read_ltv((hw), (bap), (rid), sizeof(*buf), NULL, (buf))) | 484 | (hw->ops->read_ltv((hw), (bap), (rid), sizeof(*buf), NULL, (buf))) |
479 | #define HERMES_WRITE_RECORD(hw, bap, rid, buf) \ | 485 | #define HERMES_WRITE_RECORD(hw, bap, rid, buf) \ |
480 | (hermes_write_ltv((hw), (bap), (rid), \ | 486 | (hw->ops->write_ltv((hw), (bap), (rid), \ |
481 | HERMES_BYTES_TO_RECLEN(sizeof(*buf)), (buf))) | 487 | HERMES_BYTES_TO_RECLEN(sizeof(*buf)), (buf))) |
482 | 488 | ||
483 | static inline int hermes_read_wordrec(hermes_t *hw, int bap, u16 rid, u16 *word) | 489 | static inline int hermes_read_wordrec(hermes_t *hw, int bap, u16 rid, u16 *word) |
484 | { | 490 | { |
diff --git a/drivers/net/wireless/orinoco/hermes_dld.c b/drivers/net/wireless/orinoco/hermes_dld.c index fb157eb889ca..8f22e2026a82 100644 --- a/drivers/net/wireless/orinoco/hermes_dld.c +++ b/drivers/net/wireless/orinoco/hermes_dld.c | |||
@@ -293,7 +293,7 @@ int hermes_read_pda(hermes_t *hw, | |||
293 | /* PDA of spectrum symbol is in eeprom */ | 293 | /* PDA of spectrum symbol is in eeprom */ |
294 | 294 | ||
295 | /* Issue command to read EEPROM */ | 295 | /* Issue command to read EEPROM */ |
296 | ret = hermes_docmd_wait(hw, HERMES_CMD_READMIF, 0, NULL); | 296 | ret = hw->ops->cmd_wait(hw, HERMES_CMD_READMIF, 0, NULL); |
297 | if (ret) | 297 | if (ret) |
298 | return ret; | 298 | return ret; |
299 | } else { | 299 | } else { |
@@ -408,16 +408,16 @@ int hermesi_program_init(hermes_t *hw, u32 offset) | |||
408 | /* Acknowledge any outstanding command */ | 408 | /* Acknowledge any outstanding command */ |
409 | hermes_write_regn(hw, EVACK, 0xFFFF); | 409 | hermes_write_regn(hw, EVACK, 0xFFFF); |
410 | 410 | ||
411 | /* Using doicmd_wait rather than docmd_wait */ | 411 | /* Using init_cmd_wait rather than cmd_wait */ |
412 | err = hermes_doicmd_wait(hw, | 412 | err = hw->ops->init_cmd_wait(hw, |
413 | 0x0100 | HERMES_CMD_INIT, | 413 | 0x0100 | HERMES_CMD_INIT, |
414 | 0, 0, 0, NULL); | 414 | 0, 0, 0, NULL); |
415 | if (err) | 415 | if (err) |
416 | return err; | 416 | return err; |
417 | 417 | ||
418 | err = hermes_doicmd_wait(hw, | 418 | err = hw->ops->init_cmd_wait(hw, |
419 | 0x0000 | HERMES_CMD_INIT, | 419 | 0x0000 | HERMES_CMD_INIT, |
420 | 0, 0, 0, NULL); | 420 | 0, 0, 0, NULL); |
421 | if (err) | 421 | if (err) |
422 | return err; | 422 | return err; |
423 | 423 | ||
@@ -428,12 +428,12 @@ int hermesi_program_init(hermes_t *hw, u32 offset) | |||
428 | return err; | 428 | return err; |
429 | 429 | ||
430 | pr_debug(PFX "Enabling volatile, EP 0x%08x\n", offset); | 430 | pr_debug(PFX "Enabling volatile, EP 0x%08x\n", offset); |
431 | err = hermes_doicmd_wait(hw, | 431 | err = hw->ops->init_cmd_wait(hw, |
432 | HERMES_PROGRAM_ENABLE_VOLATILE, | 432 | HERMES_PROGRAM_ENABLE_VOLATILE, |
433 | offset & 0xFFFFu, | 433 | offset & 0xFFFFu, |
434 | offset >> 16, | 434 | offset >> 16, |
435 | 0, | 435 | 0, |
436 | NULL); | 436 | NULL); |
437 | pr_debug(PFX "PROGRAM_ENABLE returned %d\n", err); | 437 | pr_debug(PFX "PROGRAM_ENABLE returned %d\n", err); |
438 | 438 | ||
439 | return err; | 439 | return err; |
@@ -451,7 +451,7 @@ int hermesi_program_end(hermes_t *hw) | |||
451 | int rc = 0; | 451 | int rc = 0; |
452 | int err; | 452 | int err; |
453 | 453 | ||
454 | rc = hermes_docmd_wait(hw, HERMES_PROGRAM_DISABLE, 0, &resp); | 454 | rc = hw->ops->cmd_wait(hw, HERMES_PROGRAM_DISABLE, 0, &resp); |
455 | 455 | ||
456 | pr_debug(PFX "PROGRAM_DISABLE returned %d, " | 456 | pr_debug(PFX "PROGRAM_DISABLE returned %d, " |
457 | "r0 0x%04x, r1 0x%04x, r2 0x%04x\n", | 457 | "r0 0x%04x, r1 0x%04x, r2 0x%04x\n", |
@@ -468,8 +468,8 @@ int hermesi_program_end(hermes_t *hw) | |||
468 | hermes_write_regn(hw, EVACK, 0xFFFF); | 468 | hermes_write_regn(hw, EVACK, 0xFFFF); |
469 | 469 | ||
470 | /* Reinitialise, ignoring return */ | 470 | /* Reinitialise, ignoring return */ |
471 | (void) hermes_doicmd_wait(hw, 0x0000 | HERMES_CMD_INIT, | 471 | (void) hw->ops->init_cmd_wait(hw, 0x0000 | HERMES_CMD_INIT, |
472 | 0, 0, 0, NULL); | 472 | 0, 0, 0, NULL); |
473 | 473 | ||
474 | return rc ? rc : err; | 474 | return rc ? rc : err; |
475 | } | 475 | } |
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c index 24ea4b4d487e..9c86acc42794 100644 --- a/drivers/net/wireless/orinoco/hw.c +++ b/drivers/net/wireless/orinoco/hw.c | |||
@@ -177,9 +177,9 @@ int determine_fw_capabilities(struct orinoco_private *priv, | |||
177 | /* 3Com MAC : 00:50:DA:* */ | 177 | /* 3Com MAC : 00:50:DA:* */ |
178 | memset(tmp, 0, sizeof(tmp)); | 178 | memset(tmp, 0, sizeof(tmp)); |
179 | /* Get the Symbol firmware version */ | 179 | /* Get the Symbol firmware version */ |
180 | err = hermes_read_ltv(hw, USER_BAP, | 180 | err = hw->ops->read_ltv(hw, USER_BAP, |
181 | HERMES_RID_SECONDARYVERSION_SYMBOL, | 181 | HERMES_RID_SECONDARYVERSION_SYMBOL, |
182 | SYMBOL_MAX_VER_LEN, NULL, &tmp); | 182 | SYMBOL_MAX_VER_LEN, NULL, &tmp); |
183 | if (err) { | 183 | if (err) { |
184 | dev_warn(dev, "Error %d reading Symbol firmware info. " | 184 | dev_warn(dev, "Error %d reading Symbol firmware info. " |
185 | "Wildly guessing capabilities...\n", err); | 185 | "Wildly guessing capabilities...\n", err); |
@@ -286,8 +286,8 @@ int orinoco_hw_read_card_settings(struct orinoco_private *priv, u8 *dev_addr) | |||
286 | u16 reclen; | 286 | u16 reclen; |
287 | 287 | ||
288 | /* Get the MAC address */ | 288 | /* Get the MAC address */ |
289 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR, | 289 | err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR, |
290 | ETH_ALEN, NULL, dev_addr); | 290 | ETH_ALEN, NULL, dev_addr); |
291 | if (err) { | 291 | if (err) { |
292 | dev_warn(dev, "Failed to read MAC address!\n"); | 292 | dev_warn(dev, "Failed to read MAC address!\n"); |
293 | goto out; | 293 | goto out; |
@@ -296,8 +296,8 @@ int orinoco_hw_read_card_settings(struct orinoco_private *priv, u8 *dev_addr) | |||
296 | dev_dbg(dev, "MAC address %pM\n", dev_addr); | 296 | dev_dbg(dev, "MAC address %pM\n", dev_addr); |
297 | 297 | ||
298 | /* Get the station name */ | 298 | /* Get the station name */ |
299 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME, | 299 | err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME, |
300 | sizeof(nickbuf), &reclen, &nickbuf); | 300 | sizeof(nickbuf), &reclen, &nickbuf); |
301 | if (err) { | 301 | if (err) { |
302 | dev_err(dev, "failed to read station name\n"); | 302 | dev_err(dev, "failed to read station name\n"); |
303 | goto out; | 303 | goto out; |
@@ -413,11 +413,11 @@ int orinoco_hw_allocate_fid(struct orinoco_private *priv) | |||
413 | struct hermes *hw = &priv->hw; | 413 | struct hermes *hw = &priv->hw; |
414 | int err; | 414 | int err; |
415 | 415 | ||
416 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); | 416 | err = hw->ops->allocate(hw, priv->nicbuf_size, &priv->txfid); |
417 | if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) { | 417 | if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) { |
418 | /* Try workaround for old Symbol firmware bug */ | 418 | /* Try workaround for old Symbol firmware bug */ |
419 | priv->nicbuf_size = TX_NICBUF_SIZE_BUG; | 419 | priv->nicbuf_size = TX_NICBUF_SIZE_BUG; |
420 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); | 420 | err = hw->ops->allocate(hw, priv->nicbuf_size, &priv->txfid); |
421 | 421 | ||
422 | dev_warn(dev, "Firmware ALLOC bug detected " | 422 | dev_warn(dev, "Firmware ALLOC bug detected " |
423 | "(old Symbol firmware?). Work around %s\n", | 423 | "(old Symbol firmware?). Work around %s\n", |
@@ -463,8 +463,9 @@ int orinoco_hw_program_rids(struct orinoco_private *priv) | |||
463 | struct hermes_idstring idbuf; | 463 | struct hermes_idstring idbuf; |
464 | 464 | ||
465 | /* Set the MAC address */ | 465 | /* Set the MAC address */ |
466 | err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR, | 466 | err = hw->ops->write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR, |
467 | HERMES_BYTES_TO_RECLEN(ETH_ALEN), dev->dev_addr); | 467 | HERMES_BYTES_TO_RECLEN(ETH_ALEN), |
468 | dev->dev_addr); | ||
468 | if (err) { | 469 | if (err) { |
469 | printk(KERN_ERR "%s: Error %d setting MAC address\n", | 470 | printk(KERN_ERR "%s: Error %d setting MAC address\n", |
470 | dev->name, err); | 471 | dev->name, err); |
@@ -527,7 +528,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv) | |||
527 | idbuf.len = cpu_to_le16(strlen(priv->desired_essid)); | 528 | idbuf.len = cpu_to_le16(strlen(priv->desired_essid)); |
528 | memcpy(&idbuf.val, priv->desired_essid, sizeof(idbuf.val)); | 529 | memcpy(&idbuf.val, priv->desired_essid, sizeof(idbuf.val)); |
529 | /* WinXP wants partner to configure OWNSSID even in IBSS mode. (jimc) */ | 530 | /* WinXP wants partner to configure OWNSSID even in IBSS mode. (jimc) */ |
530 | err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNSSID, | 531 | err = hw->ops->write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNSSID, |
531 | HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2), | 532 | HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2), |
532 | &idbuf); | 533 | &idbuf); |
533 | if (err) { | 534 | if (err) { |
@@ -535,7 +536,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv) | |||
535 | dev->name, err); | 536 | dev->name, err); |
536 | return err; | 537 | return err; |
537 | } | 538 | } |
538 | err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFDESIREDSSID, | 539 | err = hw->ops->write_ltv(hw, USER_BAP, HERMES_RID_CNFDESIREDSSID, |
539 | HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2), | 540 | HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2), |
540 | &idbuf); | 541 | &idbuf); |
541 | if (err) { | 542 | if (err) { |
@@ -547,9 +548,9 @@ int orinoco_hw_program_rids(struct orinoco_private *priv) | |||
547 | /* Set the station name */ | 548 | /* Set the station name */ |
548 | idbuf.len = cpu_to_le16(strlen(priv->nick)); | 549 | idbuf.len = cpu_to_le16(strlen(priv->nick)); |
549 | memcpy(&idbuf.val, priv->nick, sizeof(idbuf.val)); | 550 | memcpy(&idbuf.val, priv->nick, sizeof(idbuf.val)); |
550 | err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME, | 551 | err = hw->ops->write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME, |
551 | HERMES_BYTES_TO_RECLEN(strlen(priv->nick)+2), | 552 | HERMES_BYTES_TO_RECLEN(strlen(priv->nick)+2), |
552 | &idbuf); | 553 | &idbuf); |
553 | if (err) { | 554 | if (err) { |
554 | printk(KERN_ERR "%s: Error %d setting nickname\n", | 555 | printk(KERN_ERR "%s: Error %d setting nickname\n", |
555 | dev->name, err); | 556 | dev->name, err); |
@@ -664,12 +665,12 @@ int orinoco_hw_program_rids(struct orinoco_private *priv) | |||
664 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { | 665 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { |
665 | /* Enable monitor mode */ | 666 | /* Enable monitor mode */ |
666 | dev->type = ARPHRD_IEEE80211; | 667 | dev->type = ARPHRD_IEEE80211; |
667 | err = hermes_docmd_wait(hw, HERMES_CMD_TEST | | 668 | err = hw->ops->cmd_wait(hw, HERMES_CMD_TEST | |
668 | HERMES_TEST_MONITOR, 0, NULL); | 669 | HERMES_TEST_MONITOR, 0, NULL); |
669 | } else { | 670 | } else { |
670 | /* Disable monitor mode */ | 671 | /* Disable monitor mode */ |
671 | dev->type = ARPHRD_ETHER; | 672 | dev->type = ARPHRD_ETHER; |
672 | err = hermes_docmd_wait(hw, HERMES_CMD_TEST | | 673 | err = hw->ops->cmd_wait(hw, HERMES_CMD_TEST | |
673 | HERMES_TEST_STOP, 0, NULL); | 674 | HERMES_TEST_STOP, 0, NULL); |
674 | } | 675 | } |
675 | if (err) | 676 | if (err) |
@@ -695,8 +696,8 @@ int orinoco_hw_get_tkip_iv(struct orinoco_private *priv, int key, u8 *tsc) | |||
695 | if ((key < 0) || (key >= 4)) | 696 | if ((key < 0) || (key >= 4)) |
696 | return -EINVAL; | 697 | return -EINVAL; |
697 | 698 | ||
698 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV, | 699 | err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV, |
699 | sizeof(tsc_arr), NULL, &tsc_arr); | 700 | sizeof(tsc_arr), NULL, &tsc_arr); |
700 | if (!err) | 701 | if (!err) |
701 | memcpy(tsc, &tsc_arr[key][0], sizeof(tsc_arr[0])); | 702 | memcpy(tsc, &tsc_arr[key][0], sizeof(tsc_arr[0])); |
702 | 703 | ||
@@ -875,7 +876,7 @@ int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv) | |||
875 | memcpy(key, priv->keys[i].key, | 876 | memcpy(key, priv->keys[i].key, |
876 | priv->keys[i].key_len); | 877 | priv->keys[i].key_len); |
877 | 878 | ||
878 | err = hermes_write_ltv(hw, USER_BAP, | 879 | err = hw->ops->write_ltv(hw, USER_BAP, |
879 | HERMES_RID_CNFDEFAULTKEY0 + i, | 880 | HERMES_RID_CNFDEFAULTKEY0 + i, |
880 | HERMES_BYTES_TO_RECLEN(keylen), | 881 | HERMES_BYTES_TO_RECLEN(keylen), |
881 | key); | 882 | key); |
@@ -1092,7 +1093,7 @@ int __orinoco_hw_set_multicast_list(struct orinoco_private *priv, | |||
1092 | memcpy(mclist.addr[i++], p->dmi_addr, ETH_ALEN); | 1093 | memcpy(mclist.addr[i++], p->dmi_addr, ETH_ALEN); |
1093 | } | 1094 | } |
1094 | 1095 | ||
1095 | err = hermes_write_ltv(hw, USER_BAP, | 1096 | err = hw->ops->write_ltv(hw, USER_BAP, |
1096 | HERMES_RID_CNFGROUPADDRESSES, | 1097 | HERMES_RID_CNFGROUPADDRESSES, |
1097 | HERMES_BYTES_TO_RECLEN(mc_count * ETH_ALEN), | 1098 | HERMES_BYTES_TO_RECLEN(mc_count * ETH_ALEN), |
1098 | &mclist); | 1099 | &mclist); |
@@ -1134,15 +1135,15 @@ int orinoco_hw_get_essid(struct orinoco_private *priv, int *active, | |||
1134 | rid = (priv->port_type == 3) ? HERMES_RID_CNFOWNSSID : | 1135 | rid = (priv->port_type == 3) ? HERMES_RID_CNFOWNSSID : |
1135 | HERMES_RID_CNFDESIREDSSID; | 1136 | HERMES_RID_CNFDESIREDSSID; |
1136 | 1137 | ||
1137 | err = hermes_read_ltv(hw, USER_BAP, rid, sizeof(essidbuf), | 1138 | err = hw->ops->read_ltv(hw, USER_BAP, rid, sizeof(essidbuf), |
1138 | NULL, &essidbuf); | 1139 | NULL, &essidbuf); |
1139 | if (err) | 1140 | if (err) |
1140 | goto fail_unlock; | 1141 | goto fail_unlock; |
1141 | } else { | 1142 | } else { |
1142 | *active = 0; | 1143 | *active = 0; |
1143 | 1144 | ||
1144 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTSSID, | 1145 | err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CURRENTSSID, |
1145 | sizeof(essidbuf), NULL, &essidbuf); | 1146 | sizeof(essidbuf), NULL, &essidbuf); |
1146 | if (err) | 1147 | if (err) |
1147 | goto fail_unlock; | 1148 | goto fail_unlock; |
1148 | } | 1149 | } |
@@ -1213,8 +1214,8 @@ int orinoco_hw_get_bitratelist(struct orinoco_private *priv, | |||
1213 | if (orinoco_lock(priv, &flags) != 0) | 1214 | if (orinoco_lock(priv, &flags) != 0) |
1214 | return -EBUSY; | 1215 | return -EBUSY; |
1215 | 1216 | ||
1216 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_SUPPORTEDDATARATES, | 1217 | err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_SUPPORTEDDATARATES, |
1217 | sizeof(list), NULL, &list); | 1218 | sizeof(list), NULL, &list); |
1218 | orinoco_unlock(priv, &flags); | 1219 | orinoco_unlock(priv, &flags); |
1219 | 1220 | ||
1220 | if (err) | 1221 | if (err) |
@@ -1281,7 +1282,7 @@ int orinoco_hw_trigger_scan(struct orinoco_private *priv, | |||
1281 | idbuf.len = cpu_to_le16(len); | 1282 | idbuf.len = cpu_to_le16(len); |
1282 | memcpy(idbuf.val, ssid->ssid, len); | 1283 | memcpy(idbuf.val, ssid->ssid, len); |
1283 | 1284 | ||
1284 | err = hermes_write_ltv(hw, USER_BAP, | 1285 | err = hw->ops->write_ltv(hw, USER_BAP, |
1285 | HERMES_RID_CNFSCANSSID_AGERE, | 1286 | HERMES_RID_CNFSCANSSID_AGERE, |
1286 | HERMES_BYTES_TO_RECLEN(len + 2), | 1287 | HERMES_BYTES_TO_RECLEN(len + 2), |
1287 | &idbuf); | 1288 | &idbuf); |
@@ -1345,8 +1346,8 @@ int orinoco_hw_get_current_bssid(struct orinoco_private *priv, | |||
1345 | hermes_t *hw = &priv->hw; | 1346 | hermes_t *hw = &priv->hw; |
1346 | int err; | 1347 | int err; |
1347 | 1348 | ||
1348 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID, | 1349 | err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID, |
1349 | ETH_ALEN, NULL, addr); | 1350 | ETH_ALEN, NULL, addr); |
1350 | 1351 | ||
1351 | return err; | 1352 | return err; |
1352 | } | 1353 | } |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index b42634c614b5..d90951f731ef 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -399,8 +399,8 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
399 | memset(&desc, 0, sizeof(desc)); | 399 | memset(&desc, 0, sizeof(desc)); |
400 | 400 | ||
401 | *txcntl = cpu_to_le16(tx_control); | 401 | *txcntl = cpu_to_le16(tx_control); |
402 | err = hermes_bap_pwrite(hw, USER_BAP, &desc, sizeof(desc), | 402 | err = hw->ops->bap_pwrite(hw, USER_BAP, &desc, sizeof(desc), |
403 | txfid, 0); | 403 | txfid, 0); |
404 | if (err) { | 404 | if (err) { |
405 | if (net_ratelimit()) | 405 | if (net_ratelimit()) |
406 | printk(KERN_ERR "%s: Error %d writing Tx " | 406 | printk(KERN_ERR "%s: Error %d writing Tx " |
@@ -413,8 +413,8 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
413 | memset(&desc, 0, sizeof(desc)); | 413 | memset(&desc, 0, sizeof(desc)); |
414 | 414 | ||
415 | desc.tx_control = cpu_to_le16(tx_control); | 415 | desc.tx_control = cpu_to_le16(tx_control); |
416 | err = hermes_bap_pwrite(hw, USER_BAP, &desc, sizeof(desc), | 416 | err = hw->ops->bap_pwrite(hw, USER_BAP, &desc, sizeof(desc), |
417 | txfid, 0); | 417 | txfid, 0); |
418 | if (err) { | 418 | if (err) { |
419 | if (net_ratelimit()) | 419 | if (net_ratelimit()) |
420 | printk(KERN_ERR "%s: Error %d writing Tx " | 420 | printk(KERN_ERR "%s: Error %d writing Tx " |
@@ -457,8 +457,8 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
457 | memcpy(eh, &hdr, sizeof(hdr)); | 457 | memcpy(eh, &hdr, sizeof(hdr)); |
458 | } | 458 | } |
459 | 459 | ||
460 | err = hermes_bap_pwrite(hw, USER_BAP, skb->data, skb->len, | 460 | err = hw->ops->bap_pwrite(hw, USER_BAP, skb->data, skb->len, |
461 | txfid, HERMES_802_3_OFFSET); | 461 | txfid, HERMES_802_3_OFFSET); |
462 | if (err) { | 462 | if (err) { |
463 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", | 463 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", |
464 | dev->name, err); | 464 | dev->name, err); |
@@ -489,8 +489,8 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
489 | skb->data + ETH_HLEN, skb->len - ETH_HLEN, mic); | 489 | skb->data + ETH_HLEN, skb->len - ETH_HLEN, mic); |
490 | 490 | ||
491 | /* Write the MIC */ | 491 | /* Write the MIC */ |
492 | err = hermes_bap_pwrite(hw, USER_BAP, &mic_buf[0], len, | 492 | err = hw->ops->bap_pwrite(hw, USER_BAP, &mic_buf[0], len, |
493 | txfid, HERMES_802_3_OFFSET + offset); | 493 | txfid, HERMES_802_3_OFFSET + offset); |
494 | if (err) { | 494 | if (err) { |
495 | printk(KERN_ERR "%s: Error %d writing MIC to BAP\n", | 495 | printk(KERN_ERR "%s: Error %d writing MIC to BAP\n", |
496 | dev->name, err); | 496 | dev->name, err); |
@@ -501,7 +501,7 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
501 | /* Finally, we actually initiate the send */ | 501 | /* Finally, we actually initiate the send */ |
502 | netif_stop_queue(dev); | 502 | netif_stop_queue(dev); |
503 | 503 | ||
504 | err = hermes_docmd_wait(hw, HERMES_CMD_TX | HERMES_CMD_RECL, | 504 | err = hw->ops->cmd_wait(hw, HERMES_CMD_TX | HERMES_CMD_RECL, |
505 | txfid, NULL); | 505 | txfid, NULL); |
506 | if (err) { | 506 | if (err) { |
507 | netif_start_queue(dev); | 507 | netif_start_queue(dev); |
@@ -571,9 +571,9 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw) | |||
571 | return; /* Nothing's really happened */ | 571 | return; /* Nothing's really happened */ |
572 | 572 | ||
573 | /* Read part of the frame header - we need status and addr1 */ | 573 | /* Read part of the frame header - we need status and addr1 */ |
574 | err = hermes_bap_pread(hw, IRQ_BAP, &hdr, | 574 | err = hw->ops->bap_pread(hw, IRQ_BAP, &hdr, |
575 | sizeof(struct hermes_txexc_data), | 575 | sizeof(struct hermes_txexc_data), |
576 | fid, 0); | 576 | fid, 0); |
577 | 577 | ||
578 | hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID); | 578 | hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID); |
579 | stats->tx_errors++; | 579 | stats->tx_errors++; |
@@ -763,9 +763,9 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid, | |||
763 | 763 | ||
764 | /* If any, copy the data from the card to the skb */ | 764 | /* If any, copy the data from the card to the skb */ |
765 | if (datalen > 0) { | 765 | if (datalen > 0) { |
766 | err = hermes_bap_pread(hw, IRQ_BAP, skb_put(skb, datalen), | 766 | err = hw->ops->bap_pread(hw, IRQ_BAP, skb_put(skb, datalen), |
767 | ALIGN(datalen, 2), rxfid, | 767 | ALIGN(datalen, 2), rxfid, |
768 | HERMES_802_2_OFFSET); | 768 | HERMES_802_2_OFFSET); |
769 | if (err) { | 769 | if (err) { |
770 | printk(KERN_ERR "%s: error %d reading monitor frame\n", | 770 | printk(KERN_ERR "%s: error %d reading monitor frame\n", |
771 | dev->name, err); | 771 | dev->name, err); |
@@ -813,8 +813,8 @@ static void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw) | |||
813 | 813 | ||
814 | rxfid = hermes_read_regn(hw, RXFID); | 814 | rxfid = hermes_read_regn(hw, RXFID); |
815 | 815 | ||
816 | err = hermes_bap_pread(hw, IRQ_BAP, desc, sizeof(*desc), | 816 | err = hw->ops->bap_pread(hw, IRQ_BAP, desc, sizeof(*desc), |
817 | rxfid, 0); | 817 | rxfid, 0); |
818 | if (err) { | 818 | if (err) { |
819 | printk(KERN_ERR "%s: error %d reading Rx descriptor. " | 819 | printk(KERN_ERR "%s: error %d reading Rx descriptor. " |
820 | "Frame dropped.\n", dev->name, err); | 820 | "Frame dropped.\n", dev->name, err); |
@@ -881,9 +881,9 @@ static void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw) | |||
881 | nothing is removed. 2 is for aligning the IP header. */ | 881 | nothing is removed. 2 is for aligning the IP header. */ |
882 | skb_reserve(skb, ETH_HLEN + 2); | 882 | skb_reserve(skb, ETH_HLEN + 2); |
883 | 883 | ||
884 | err = hermes_bap_pread(hw, IRQ_BAP, skb_put(skb, length), | 884 | err = hw->ops->bap_pread(hw, IRQ_BAP, skb_put(skb, length), |
885 | ALIGN(length, 2), rxfid, | 885 | ALIGN(length, 2), rxfid, |
886 | HERMES_802_2_OFFSET); | 886 | HERMES_802_2_OFFSET); |
887 | if (err) { | 887 | if (err) { |
888 | printk(KERN_ERR "%s: error %d reading frame. " | 888 | printk(KERN_ERR "%s: error %d reading frame. " |
889 | "Frame dropped.\n", dev->name, err); | 889 | "Frame dropped.\n", dev->name, err); |
@@ -1144,9 +1144,9 @@ static void orinoco_join_ap(struct work_struct *work) | |||
1144 | goto out; | 1144 | goto out; |
1145 | 1145 | ||
1146 | /* Read scan results from the firmware */ | 1146 | /* Read scan results from the firmware */ |
1147 | err = hermes_read_ltv(hw, USER_BAP, | 1147 | err = hw->ops->read_ltv(hw, USER_BAP, |
1148 | HERMES_RID_SCANRESULTSTABLE, | 1148 | HERMES_RID_SCANRESULTSTABLE, |
1149 | MAX_SCAN_LEN, &len, buf); | 1149 | MAX_SCAN_LEN, &len, buf); |
1150 | if (err) { | 1150 | if (err) { |
1151 | printk(KERN_ERR "%s: Cannot read scan results\n", | 1151 | printk(KERN_ERR "%s: Cannot read scan results\n", |
1152 | dev->name); | 1152 | dev->name); |
@@ -1193,8 +1193,8 @@ static void orinoco_send_bssid_wevent(struct orinoco_private *priv) | |||
1193 | union iwreq_data wrqu; | 1193 | union iwreq_data wrqu; |
1194 | int err; | 1194 | int err; |
1195 | 1195 | ||
1196 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID, | 1196 | err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID, |
1197 | ETH_ALEN, NULL, wrqu.ap_addr.sa_data); | 1197 | ETH_ALEN, NULL, wrqu.ap_addr.sa_data); |
1198 | if (err != 0) | 1198 | if (err != 0) |
1199 | return; | 1199 | return; |
1200 | 1200 | ||
@@ -1216,8 +1216,8 @@ static void orinoco_send_assocreqie_wevent(struct orinoco_private *priv) | |||
1216 | if (!priv->has_wpa) | 1216 | if (!priv->has_wpa) |
1217 | return; | 1217 | return; |
1218 | 1218 | ||
1219 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_ASSOC_REQ_INFO, | 1219 | err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_ASSOC_REQ_INFO, |
1220 | sizeof(buf), NULL, &buf); | 1220 | sizeof(buf), NULL, &buf); |
1221 | if (err != 0) | 1221 | if (err != 0) |
1222 | return; | 1222 | return; |
1223 | 1223 | ||
@@ -1246,8 +1246,9 @@ static void orinoco_send_assocrespie_wevent(struct orinoco_private *priv) | |||
1246 | if (!priv->has_wpa) | 1246 | if (!priv->has_wpa) |
1247 | return; | 1247 | return; |
1248 | 1248 | ||
1249 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_ASSOC_RESP_INFO, | 1249 | err = hw->ops->read_ltv(hw, USER_BAP, |
1250 | sizeof(buf), NULL, &buf); | 1250 | HERMES_RID_CURRENT_ASSOC_RESP_INFO, |
1251 | sizeof(buf), NULL, &buf); | ||
1251 | if (err != 0) | 1252 | if (err != 0) |
1252 | return; | 1253 | return; |
1253 | 1254 | ||
@@ -1370,8 +1371,8 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) | |||
1370 | infofid = hermes_read_regn(hw, INFOFID); | 1371 | infofid = hermes_read_regn(hw, INFOFID); |
1371 | 1372 | ||
1372 | /* Read the info frame header - don't try too hard */ | 1373 | /* Read the info frame header - don't try too hard */ |
1373 | err = hermes_bap_pread(hw, IRQ_BAP, &info, sizeof(info), | 1374 | err = hw->ops->bap_pread(hw, IRQ_BAP, &info, sizeof(info), |
1374 | infofid, 0); | 1375 | infofid, 0); |
1375 | if (err) { | 1376 | if (err) { |
1376 | printk(KERN_ERR "%s: error %d reading info frame. " | 1377 | printk(KERN_ERR "%s: error %d reading info frame. " |
1377 | "Frame dropped.\n", dev->name, err); | 1378 | "Frame dropped.\n", dev->name, err); |
@@ -1392,8 +1393,8 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) | |||
1392 | len = sizeof(tallies); | 1393 | len = sizeof(tallies); |
1393 | } | 1394 | } |
1394 | 1395 | ||
1395 | err = hermes_bap_pread(hw, IRQ_BAP, &tallies, len, | 1396 | err = hw->ops->bap_pread(hw, IRQ_BAP, &tallies, len, |
1396 | infofid, sizeof(info)); | 1397 | infofid, sizeof(info)); |
1397 | if (err) | 1398 | if (err) |
1398 | break; | 1399 | break; |
1399 | 1400 | ||
@@ -1428,8 +1429,8 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) | |||
1428 | break; | 1429 | break; |
1429 | } | 1430 | } |
1430 | 1431 | ||
1431 | err = hermes_bap_pread(hw, IRQ_BAP, &linkstatus, len, | 1432 | err = hw->ops->bap_pread(hw, IRQ_BAP, &linkstatus, len, |
1432 | infofid, sizeof(info)); | 1433 | infofid, sizeof(info)); |
1433 | if (err) | 1434 | if (err) |
1434 | break; | 1435 | break; |
1435 | newstatus = le16_to_cpu(linkstatus.linkstatus); | 1436 | newstatus = le16_to_cpu(linkstatus.linkstatus); |
@@ -1493,8 +1494,8 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) | |||
1493 | } | 1494 | } |
1494 | 1495 | ||
1495 | /* Read scan data */ | 1496 | /* Read scan data */ |
1496 | err = hermes_bap_pread(hw, IRQ_BAP, (void *) buf, len, | 1497 | err = hw->ops->bap_pread(hw, IRQ_BAP, (void *) buf, len, |
1497 | infofid, sizeof(info)); | 1498 | infofid, sizeof(info)); |
1498 | if (err) { | 1499 | if (err) { |
1499 | kfree(buf); | 1500 | kfree(buf); |
1500 | qabort_scan(priv); | 1501 | qabort_scan(priv); |
@@ -1546,8 +1547,8 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) | |||
1546 | break; | 1547 | break; |
1547 | 1548 | ||
1548 | /* Read scan data */ | 1549 | /* Read scan data */ |
1549 | err = hermes_bap_pread(hw, IRQ_BAP, (void *) bss, len, | 1550 | err = hw->ops->bap_pread(hw, IRQ_BAP, (void *) bss, len, |
1550 | infofid, sizeof(info)); | 1551 | infofid, sizeof(info)); |
1551 | if (err) | 1552 | if (err) |
1552 | kfree(bss); | 1553 | kfree(bss); |
1553 | else | 1554 | else |
@@ -1646,7 +1647,7 @@ static int orinoco_reinit_firmware(struct orinoco_private *priv) | |||
1646 | struct hermes *hw = &priv->hw; | 1647 | struct hermes *hw = &priv->hw; |
1647 | int err; | 1648 | int err; |
1648 | 1649 | ||
1649 | err = hermes_init(hw); | 1650 | err = hw->ops->init(hw); |
1650 | if (priv->do_fw_download && !err) { | 1651 | if (priv->do_fw_download && !err) { |
1651 | err = orinoco_download(priv); | 1652 | err = orinoco_download(priv); |
1652 | if (err) | 1653 | if (err) |
@@ -1983,7 +1984,7 @@ int orinoco_init(struct orinoco_private *priv) | |||
1983 | priv->nicbuf_size = IEEE80211_MAX_FRAME_LEN + ETH_HLEN; | 1984 | priv->nicbuf_size = IEEE80211_MAX_FRAME_LEN + ETH_HLEN; |
1984 | 1985 | ||
1985 | /* Initialize the firmware */ | 1986 | /* Initialize the firmware */ |
1986 | err = hermes_init(hw); | 1987 | err = hw->ops->init(hw); |
1987 | if (err != 0) { | 1988 | if (err != 0) { |
1988 | dev_err(dev, "Failed to initialize firmware (err = %d)\n", | 1989 | dev_err(dev, "Failed to initialize firmware (err = %d)\n", |
1989 | err); | 1990 | err); |
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c index d261423ecf62..b7fef250237b 100644 --- a/drivers/net/wireless/orinoco/wext.c +++ b/drivers/net/wireless/orinoco/wext.c | |||
@@ -457,7 +457,7 @@ static int orinoco_ioctl_setfreq(struct net_device *dev, | |||
457 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { | 457 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { |
458 | /* Fast channel change - no commit if successful */ | 458 | /* Fast channel change - no commit if successful */ |
459 | hermes_t *hw = &priv->hw; | 459 | hermes_t *hw = &priv->hw; |
460 | err = hermes_docmd_wait(hw, HERMES_CMD_TEST | | 460 | err = hw->ops->cmd_wait(hw, HERMES_CMD_TEST | |
461 | HERMES_TEST_SET_CHANNEL, | 461 | HERMES_TEST_SET_CHANNEL, |
462 | chan, NULL); | 462 | chan, NULL); |
463 | } | 463 | } |
@@ -1272,8 +1272,8 @@ static int orinoco_ioctl_getrid(struct net_device *dev, | |||
1272 | if (orinoco_lock(priv, &flags) != 0) | 1272 | if (orinoco_lock(priv, &flags) != 0) |
1273 | return -EBUSY; | 1273 | return -EBUSY; |
1274 | 1274 | ||
1275 | err = hermes_read_ltv(hw, USER_BAP, rid, MAX_RID_LEN, &length, | 1275 | err = hw->ops->read_ltv(hw, USER_BAP, rid, MAX_RID_LEN, &length, |
1276 | extra); | 1276 | extra); |
1277 | if (err) | 1277 | if (err) |
1278 | goto out; | 1278 | goto out; |
1279 | 1279 | ||