osdef1st.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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