islpci_mgt.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2002 Intersil Americas Inc.
  4. * Copyright (C) 2003 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>
  5. */
  6. #ifndef _ISLPCI_MGT_H
  7. #define _ISLPCI_MGT_H
  8. #include <linux/wireless.h>
  9. #include <linux/skbuff.h>
  10. #include <linux/slab.h>
  11. /*
  12. * Function definitions
  13. */
  14. #define K_DEBUG(f, m, args...) do { if(f & m) printk(KERN_DEBUG args); } while(0)
  15. #define DEBUG(f, args...) K_DEBUG(f, pc_debug, args)
  16. extern int pc_debug;
  17. #define init_wds 0 /* help compiler optimize away dead code */
  18. /* General driver definitions */
  19. #define PCIDEVICE_LATENCY_TIMER_MIN 0x40
  20. #define PCIDEVICE_LATENCY_TIMER_VAL 0x50
  21. /* Debugging verbose definitions */
  22. #define SHOW_NOTHING 0x00 /* overrules everything */
  23. #define SHOW_ANYTHING 0xFF
  24. #define SHOW_ERROR_MESSAGES 0x01
  25. #define SHOW_TRAPS 0x02
  26. #define SHOW_FUNCTION_CALLS 0x04
  27. #define SHOW_TRACING 0x08
  28. #define SHOW_QUEUE_INDEXES 0x10
  29. #define SHOW_PIMFOR_FRAMES 0x20
  30. #define SHOW_BUFFER_CONTENTS 0x40
  31. #define VERBOSE 0x01
  32. /* Default card definitions */
  33. #define CARD_DEFAULT_CHANNEL 6
  34. #define CARD_DEFAULT_MODE INL_MODE_CLIENT
  35. #define CARD_DEFAULT_IW_MODE IW_MODE_INFRA
  36. #define CARD_DEFAULT_BSSTYPE DOT11_BSSTYPE_INFRA
  37. #define CARD_DEFAULT_CLIENT_SSID ""
  38. #define CARD_DEFAULT_AP_SSID "default"
  39. #define CARD_DEFAULT_KEY1 "default_key_1"
  40. #define CARD_DEFAULT_KEY2 "default_key_2"
  41. #define CARD_DEFAULT_KEY3 "default_key_3"
  42. #define CARD_DEFAULT_KEY4 "default_key_4"
  43. #define CARD_DEFAULT_WEP 0
  44. #define CARD_DEFAULT_FILTER 0
  45. #define CARD_DEFAULT_WDS 0
  46. #define CARD_DEFAULT_AUTHEN DOT11_AUTH_OS
  47. #define CARD_DEFAULT_DOT1X 0
  48. #define CARD_DEFAULT_MLME_MODE DOT11_MLME_AUTO
  49. #define CARD_DEFAULT_CONFORMANCE OID_INL_CONFORMANCE_NONE
  50. #define CARD_DEFAULT_PROFILE DOT11_PROFILE_MIXED_G_WIFI
  51. #define CARD_DEFAULT_MAXFRAMEBURST DOT11_MAXFRAMEBURST_MIXED_SAFE
  52. /* PIMFOR package definitions */
  53. #define PIMFOR_ETHERTYPE 0x8828
  54. #define PIMFOR_HEADER_SIZE 12
  55. #define PIMFOR_VERSION 1
  56. #define PIMFOR_OP_GET 0
  57. #define PIMFOR_OP_SET 1
  58. #define PIMFOR_OP_RESPONSE 2
  59. #define PIMFOR_OP_ERROR 3
  60. #define PIMFOR_OP_TRAP 4
  61. #define PIMFOR_OP_RESERVED 5 /* till 255 */
  62. #define PIMFOR_DEV_ID_MHLI_MIB 0
  63. #define PIMFOR_FLAG_APPLIC_ORIGIN 0x01
  64. #define PIMFOR_FLAG_LITTLE_ENDIAN 0x02
  65. void display_buffer(char *, int);
  66. /*
  67. * Type definition section
  68. *
  69. * the structure defines only the header allowing copyless
  70. * frame handling
  71. */
  72. typedef struct {
  73. u8 version;
  74. u8 operation;
  75. u32 oid;
  76. u8 device_id;
  77. u8 flags;
  78. u32 length;
  79. } __packed
  80. pimfor_header_t;
  81. /* A received and interrupt-processed management frame, either for
  82. * schedule_work(prism54_process_trap) or for priv->mgmt_received,
  83. * processed by islpci_mgt_transaction(). */
  84. struct islpci_mgmtframe {
  85. struct net_device *ndev; /* pointer to network device */
  86. pimfor_header_t *header; /* payload header, points into buf */
  87. void *data; /* payload ex header, points into buf */
  88. struct work_struct ws; /* argument for schedule_work() */
  89. char buf[0]; /* fragment buffer */
  90. };
  91. int
  92. islpci_mgt_receive(struct net_device *ndev);
  93. int
  94. islpci_mgmt_rx_fill(struct net_device *ndev);
  95. void
  96. islpci_mgt_cleanup_transmit(struct net_device *ndev);
  97. int
  98. islpci_mgt_transaction(struct net_device *ndev,
  99. int operation, unsigned long oid,
  100. void *senddata, int sendlen,
  101. struct islpci_mgmtframe **recvframe);
  102. static inline void
  103. islpci_mgt_release(struct islpci_mgmtframe *frame)
  104. {
  105. kfree(frame);
  106. }
  107. #endif /* _ISLPCI_MGT_H */