osdef1st.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /******************************************************************************
  3. *
  4. * (C)Copyright 1998,1999 SysKonnect,
  5. * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
  6. *
  7. * The information in this file is provided "AS IS" without warranty.
  8. *
  9. ******************************************************************************/
  10. /*
  11. * Operating system-dependent definitions that have to be defined
  12. * before any other header files are included.
  13. */
  14. // HWM (HardWare Module) Definitions
  15. // -----------------------
  16. #include <asm/byteorder.h>
  17. #ifdef __LITTLE_ENDIAN
  18. #define LITTLE_ENDIAN
  19. #else
  20. #define BIG_ENDIAN
  21. #endif
  22. // this is set in the makefile
  23. // #define PCI /* only PCI adapters supported by this driver */
  24. // #define MEM_MAPPED_IO /* use memory mapped I/O */
  25. #define USE_CAN_ADDR /* DA and SA in MAC header are canonical. */
  26. #define MB_OUTSIDE_SMC /* SMT Mbufs outside of smc struct. */
  27. // -----------------------
  28. // SMT Definitions
  29. // -----------------------
  30. #define SYNC /* allow synchronous frames */
  31. // #define SBA /* Synchronous Bandwidth Allocator support */
  32. /* not available as free source */
  33. #define ESS /* SBA End Station Support */
  34. #define SMT_PANIC(smc, nr, msg) printk(KERN_INFO "SMT PANIC: code: %d, msg: %s\n",nr,msg)
  35. #ifdef DEBUG
  36. #define printf(s,args...) printk(KERN_INFO s, ## args)
  37. #endif
  38. // #define HW_PTR u_long
  39. // -----------------------
  40. // HWM and OS-specific buffer definitions
  41. // -----------------------
  42. // default number of receive buffers.
  43. #define NUM_RECEIVE_BUFFERS 10
  44. // default number of transmit buffers.
  45. #define NUM_TRANSMIT_BUFFERS 10
  46. // Number of SMT buffers (Mbufs).
  47. #define NUM_SMT_BUF 4
  48. // Number of TXDs for asynchronous transmit queue.
  49. #define HWM_ASYNC_TXD_COUNT (NUM_TRANSMIT_BUFFERS + NUM_SMT_BUF)
  50. // Number of TXDs for synchronous transmit queue.
  51. #define HWM_SYNC_TXD_COUNT HWM_ASYNC_TXD_COUNT
  52. // Number of RXDs for receive queue #1.
  53. // Note: Workaround for ASIC Errata #7: One extra RXD is required.
  54. #if (NUM_RECEIVE_BUFFERS > 100)
  55. #define SMT_R1_RXD_COUNT (1 + 100)
  56. #else
  57. #define SMT_R1_RXD_COUNT (1 + NUM_RECEIVE_BUFFERS)
  58. #endif
  59. // Number of RXDs for receive queue #2.
  60. #define SMT_R2_RXD_COUNT 0 // Not used.
  61. // -----------------------
  62. /*
  63. * OS-specific part of the transmit/receive descriptor structure (TXD/RXD).
  64. *
  65. * Note: The size of these structures must follow this rule:
  66. *
  67. * sizeof(struct) + 2*sizeof(void*) == n * 16, n >= 1
  68. *
  69. * We use the dma_addr fields under Linux to keep track of the
  70. * DMA address of the packet data, for later pci_unmap_single. -DaveM
  71. */
  72. struct s_txd_os { // os-specific part of transmit descriptor
  73. struct sk_buff *skb;
  74. dma_addr_t dma_addr;
  75. } ;
  76. struct s_rxd_os { // os-specific part of receive descriptor
  77. struct sk_buff *skb;
  78. dma_addr_t dma_addr;
  79. } ;
  80. /*
  81. * So we do not need to make too many modifications to the generic driver
  82. * parts, we take advantage of the AIX byte swapping macro interface.
  83. */
  84. #define AIX_REVERSE(x) ((u32)le32_to_cpu((u32)(x)))
  85. #define MDR_REVERSE(x) ((u32)le32_to_cpu((u32)(x)))