eeprom_93cx6.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
  3. <http://rt2x00.serialmonkey.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the
  14. Free Software Foundation, Inc.,
  15. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  16. */
  17. /*
  18. Module: eeprom_93cx6
  19. Abstract: EEPROM reader datastructures for 93cx6 chipsets.
  20. Supported chipsets: 93c46 & 93c66.
  21. */
  22. /*
  23. * EEPROM operation defines.
  24. */
  25. #define PCI_EEPROM_WIDTH_93C46 6
  26. #define PCI_EEPROM_WIDTH_93C66 8
  27. #define PCI_EEPROM_WIDTH_OPCODE 3
  28. #define PCI_EEPROM_WRITE_OPCODE 0x05
  29. #define PCI_EEPROM_READ_OPCODE 0x06
  30. #define PCI_EEPROM_EWDS_OPCODE 0x10
  31. #define PCI_EEPROM_EWEN_OPCODE 0x13
  32. /**
  33. * struct eeprom_93cx6 - control structure for setting the commands
  34. * for reading the eeprom data.
  35. * @data: private pointer for the driver.
  36. * @register_read(struct eeprom_93cx6 *eeprom): handler to
  37. * read the eeprom register, this function should set all reg_* fields.
  38. * @register_write(struct eeprom_93cx6 *eeprom): handler to
  39. * write to the eeprom register by using all reg_* fields.
  40. * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines
  41. * @reg_data_in: register field to indicate data input
  42. * @reg_data_out: register field to indicate data output
  43. * @reg_data_clock: register field to set the data clock
  44. * @reg_chip_select: register field to set the chip select
  45. *
  46. * This structure is used for the communication between the driver
  47. * and the eeprom_93cx6 handlers for reading the eeprom.
  48. */
  49. struct eeprom_93cx6 {
  50. void *data;
  51. void (*register_read)(struct eeprom_93cx6 *eeprom);
  52. void (*register_write)(struct eeprom_93cx6 *eeprom);
  53. int width;
  54. char reg_data_in;
  55. char reg_data_out;
  56. char reg_data_clock;
  57. char reg_chip_select;
  58. };
  59. extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom,
  60. const u8 word, u16 *data);
  61. extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom,
  62. const u8 word, __le16 *data, const u16 words);