2  * RNDIS        Definitions for Remote NDIS
 
   4  * Version:     $Id: rndis.h,v 1.15 2004/03/25 21:33:46 robert Exp $
 
   6  * Authors:     Benedikt Spranger, Pengutronix
 
   7  *              Robert Schwebel, Pengutronix
 
   9  *              This program is free software; you can redistribute it and/or
 
  10  *              modify it under the terms of the GNU General Public License
 
  11  *              version 2, as published by the Free Software Foundation. 
 
  13  *              This software was originally developed in conformance with
 
  14  *              Microsoft's Remote NDIS Specification License Agreement.
 
  17 #ifndef _LINUX_RNDIS_H
 
  18 #define _LINUX_RNDIS_H
 
  22 #define RNDIS_MAXIMUM_FRAME_SIZE        1518
 
  23 #define RNDIS_MAX_TOTAL_SIZE            1558
 
  25 /* Remote NDIS Versions */
 
  26 #define RNDIS_MAJOR_VERSION             1
 
  27 #define RNDIS_MINOR_VERSION             0
 
  30 #define RNDIS_STATUS_SUCCESS            0x00000000U     /* Success           */
 
  31 #define RNDIS_STATUS_FAILURE            0xC0000001U     /* Unspecified error */
 
  32 #define RNDIS_STATUS_INVALID_DATA       0xC0010015U     /* Invalid data      */
 
  33 #define RNDIS_STATUS_NOT_SUPPORTED      0xC00000BBU     /* Unsupported request */
 
  34 #define RNDIS_STATUS_MEDIA_CONNECT      0x4001000BU     /* Device connected  */
 
  35 #define RNDIS_STATUS_MEDIA_DISCONNECT   0x4001000CU     /* Device disconnected */
 
  36 /* For all not specified status messages:
 
  37  * RNDIS_STATUS_Xxx -> NDIS_STATUS_Xxx 
 
  40 /* Message Set for Connectionless (802.3) Devices */
 
  41 #define REMOTE_NDIS_PACKET_MSG          0x00000001U
 
  42 #define REMOTE_NDIS_INITIALIZE_MSG      0x00000002U     /* Initialize device */
 
  43 #define REMOTE_NDIS_HALT_MSG            0x00000003U
 
  44 #define REMOTE_NDIS_QUERY_MSG           0x00000004U
 
  45 #define REMOTE_NDIS_SET_MSG             0x00000005U
 
  46 #define REMOTE_NDIS_RESET_MSG           0x00000006U
 
  47 #define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007U
 
  48 #define REMOTE_NDIS_KEEPALIVE_MSG       0x00000008U
 
  50 /* Message completion */
 
  51 #define REMOTE_NDIS_INITIALIZE_CMPLT    0x80000002U
 
  52 #define REMOTE_NDIS_QUERY_CMPLT         0x80000004U
 
  53 #define REMOTE_NDIS_SET_CMPLT           0x80000005U
 
  54 #define REMOTE_NDIS_RESET_CMPLT         0x80000006U
 
  55 #define REMOTE_NDIS_KEEPALIVE_CMPLT     0x80000008U
 
  58 #define RNDIS_DF_CONNECTIONLESS         0x00000001U
 
  59 #define RNDIS_DF_CONNECTION_ORIENTED    0x00000002U
 
  61 #define RNDIS_MEDIUM_802_3              0x00000000U
 
  63 /* from drivers/net/sk98lin/h/skgepnmi.h */
 
  64 #define OID_PNP_CAPABILITIES                    0xFD010100
 
  65 #define OID_PNP_SET_POWER                       0xFD010101
 
  66 #define OID_PNP_QUERY_POWER                     0xFD010102
 
  67 #define OID_PNP_ADD_WAKE_UP_PATTERN             0xFD010103
 
  68 #define OID_PNP_REMOVE_WAKE_UP_PATTERN          0xFD010104
 
  69 #define OID_PNP_ENABLE_WAKE_UP                  0xFD010106
 
  72 typedef struct rndis_init_msg_type 
 
  79         __le32  MaxTransferSize;
 
  80 } rndis_init_msg_type;
 
  82 typedef struct rndis_init_cmplt_type
 
  92         __le32  MaxPacketsPerTransfer;
 
  93         __le32  MaxTransferSize;
 
  94         __le32  PacketAlignmentFactor;
 
  97 } rndis_init_cmplt_type;
 
  99 typedef struct rndis_halt_msg_type
 
 102         __le32  MessageLength;
 
 104 } rndis_halt_msg_type;
 
 106 typedef struct rndis_query_msg_type
 
 109         __le32  MessageLength;
 
 112         __le32  InformationBufferLength;
 
 113         __le32  InformationBufferOffset;
 
 114         __le32  DeviceVcHandle;
 
 115 } rndis_query_msg_type;
 
 117 typedef struct rndis_query_cmplt_type
 
 120         __le32  MessageLength;
 
 123         __le32  InformationBufferLength;
 
 124         __le32  InformationBufferOffset;
 
 125 } rndis_query_cmplt_type;
 
 127 typedef struct rndis_set_msg_type
 
 130         __le32  MessageLength;
 
 133         __le32  InformationBufferLength;
 
 134         __le32  InformationBufferOffset;
 
 135         __le32  DeviceVcHandle;
 
 136 } rndis_set_msg_type;
 
 138 typedef struct rndis_set_cmplt_type
 
 141         __le32  MessageLength;
 
 144 } rndis_set_cmplt_type;
 
 146 typedef struct rndis_reset_msg_type
 
 149         __le32  MessageLength;
 
 151 } rndis_reset_msg_type;
 
 153 typedef struct rndis_reset_cmplt_type
 
 156         __le32  MessageLength;
 
 158         __le32  AddressingReset;
 
 159 } rndis_reset_cmplt_type;
 
 161 typedef struct rndis_indicate_status_msg_type
 
 164         __le32  MessageLength;
 
 166         __le32  StatusBufferLength;
 
 167         __le32  StatusBufferOffset;
 
 168 } rndis_indicate_status_msg_type;
 
 170 typedef struct rndis_keepalive_msg_type
 
 173         __le32  MessageLength;
 
 175 } rndis_keepalive_msg_type;
 
 177 typedef struct rndis_keepalive_cmplt_type
 
 180         __le32  MessageLength;
 
 183 } rndis_keepalive_cmplt_type;
 
 185 struct rndis_packet_msg_type
 
 188         __le32  MessageLength;
 
 191         __le32  OOBDataOffset;
 
 192         __le32  OOBDataLength;
 
 193         __le32  NumOOBDataElements;
 
 194         __le32  PerPacketInfoOffset;
 
 195         __le32  PerPacketInfoLength;
 
 200 struct rndis_config_parameter
 
 202         __le32  ParameterNameOffset;
 
 203         __le32  ParameterNameLength;
 
 204         __le32  ParameterType;
 
 205         __le32  ParameterValueOffset;
 
 206         __le32  ParameterValueLength;
 
 209 /* implementation specific */
 
 214         RNDIS_DATA_INITIALIZED,
 
 217 typedef struct rndis_resp_t
 
 219         struct list_head        list;
 
 225 typedef struct rndis_params
 
 230         enum rndis_state        state;
 
 237         struct net_device       *dev;
 
 238         struct net_device_stats *stats;
 
 241         const char              *vendorDescr;
 
 242         int                     (*ack) (struct net_device *);
 
 243         struct list_head        resp_queue;
 
 246 /* RNDIS Message parser and other useless functions */
 
 247 int  rndis_msg_parser (u8 configNr, u8 *buf);
 
 248 int  rndis_register (int (*rndis_control_ack) (struct net_device *));
 
 249 void rndis_deregister (int configNr);
 
 250 int  rndis_set_param_dev (u8 configNr, struct net_device *dev,
 
 251                          struct net_device_stats *stats,
 
 253 int  rndis_set_param_vendor (u8 configNr, u32 vendorID, 
 
 254                             const char *vendorDescr);
 
 255 int  rndis_set_param_medium (u8 configNr, u32 medium, u32 speed);
 
 256 void rndis_add_hdr (struct sk_buff *skb);
 
 257 int rndis_rm_hdr (struct sk_buff *skb);
 
 258 u8   *rndis_get_next_response (int configNr, u32 *length);
 
 259 void rndis_free_response (int configNr, u8 *buf);
 
 261 void rndis_uninit (int configNr);
 
 262 int  rndis_signal_connect (int configNr);
 
 263 int  rndis_signal_disconnect (int configNr);
 
 264 int  rndis_state (int configNr);
 
 265 extern void rndis_set_host_mac (int configNr, const u8 *addr);
 
 267 int __init rndis_init (void);
 
 268 void rndis_exit (void);
 
 270 #endif  /* _LINUX_RNDIS_H */