p54.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef PRISM54_H
  2. #define PRISM54_H
  3. /*
  4. * Shared defines for all mac80211 Prism54 code
  5. *
  6. * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
  7. *
  8. * Based on the islsm (softmac prism54) driver, which is:
  9. * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. enum control_frame_types {
  16. P54_CONTROL_TYPE_FILTER_SET = 0,
  17. P54_CONTROL_TYPE_CHANNEL_CHANGE,
  18. P54_CONTROL_TYPE_FREQDONE,
  19. P54_CONTROL_TYPE_DCFINIT,
  20. P54_CONTROL_TYPE_FREEQUEUE = 7,
  21. P54_CONTROL_TYPE_TXDONE,
  22. P54_CONTROL_TYPE_PING,
  23. P54_CONTROL_TYPE_STAT_READBACK,
  24. P54_CONTROL_TYPE_BBP,
  25. P54_CONTROL_TYPE_EEPROM_READBACK,
  26. P54_CONTROL_TYPE_LED
  27. };
  28. struct p54_control_hdr {
  29. __le16 magic1;
  30. __le16 len;
  31. __le32 req_id;
  32. __le16 type; /* enum control_frame_types */
  33. u8 retry1;
  34. u8 retry2;
  35. u8 data[0];
  36. } __attribute__ ((packed));
  37. #define EEPROM_READBACK_LEN (sizeof(struct p54_control_hdr) + 4 /* p54_eeprom_lm86 */)
  38. #define MAX_RX_SIZE (IEEE80211_MAX_RTS_THRESHOLD + sizeof(struct p54_control_hdr) + 20 /* length of struct p54_rx_hdr */ + 16 )
  39. #define ISL38XX_DEV_FIRMWARE_ADDR 0x20000
  40. struct p54_common {
  41. u32 rx_start;
  42. u32 rx_end;
  43. struct sk_buff_head tx_queue;
  44. void (*tx)(struct ieee80211_hw *dev, struct p54_control_hdr *data,
  45. size_t len, int free_on_tx);
  46. int (*open)(struct ieee80211_hw *dev);
  47. void (*stop)(struct ieee80211_hw *dev);
  48. int mode;
  49. u8 mac_addr[ETH_ALEN];
  50. u8 bssid[ETH_ALEN];
  51. struct pda_iq_autocal_entry *iq_autocal;
  52. unsigned int iq_autocal_len;
  53. struct pda_channel_output_limit *output_limit;
  54. unsigned int output_limit_len;
  55. struct pda_pa_curve_data *curve_data;
  56. __le16 rxhw;
  57. u8 version;
  58. unsigned int tx_hdr_len;
  59. void *cached_vdcf;
  60. unsigned int fw_var;
  61. /* FIXME: this channels/modes/rates stuff sucks */
  62. struct ieee80211_channel channels[14];
  63. struct ieee80211_rate rates[12];
  64. struct ieee80211_hw_mode modes[2];
  65. struct ieee80211_tx_queue_stats tx_stats;
  66. };
  67. int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb);
  68. void p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw);
  69. int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len);
  70. void p54_fill_eeprom_readback(struct p54_control_hdr *hdr);
  71. struct ieee80211_hw *p54_init_common(size_t priv_data_len);
  72. void p54_free_common(struct ieee80211_hw *dev);
  73. #endif /* PRISM54_H */