osdef1st.h 3.3 KB

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