26 #define NETDEVICE_DEVICE_DEBUG (1) 36 #define NETDEVICE_DEVICE_MAXIMUM (5) 48 #define NETDEVICE_REQUEST_FAILED (0) 49 #define NETDEVICE_MODULE_NOT_FOUND (-1) 50 #define NETDEVICE_ALREADY_EXISTS (-2) 51 #define NETDEVICE_SUPPORT_TASK_FAILED (-3) 52 #define NETDEVICE_MODULE_NOT_SUPPORTED (-4) 55 #define NETDEVICE_SITE_COUNT (1) 56 #define NETDEVICE_SITE_LIST (2) 65 #define NETDEVICE_INITIALIZE (0) 66 #define NETDEVICE_UPDATE_PASSPHRASE (1) 67 #define NETDEVICE_GET_TEMPORAL_KEY (2) 84 typedef enum _NetDeviceController
87 ControllerPointToPoint,
88 ControllerRealtekRtl8711
90 } NetDeviceController;
102 typedef enum _NetDeviceBusType
107 BusTypeSdioBusSpiMode,
133 typedef enum _NetDeviceSelectDetail
136 SelectDetailSpiUnmanaged,
137 SelectDetailSpiUnmanagedMultiplex,
138 SelectDetailSpiManaged,
139 SelectDetailSpiManagedMultiplex,
140 SelectDetailGpioUnmanaged,
142 } NetDeviceSelectDetail;
160 typedef void(NetDeviceProgressFn)(
int activity,
int progress,
const char *detail);
161 typedef NetDeviceProgressFn *NetDeviceProgressFnPtr;
164 typedef BOOL(NetDeviceSupplicantFn)(
int action,
void *buffer);
165 typedef NetDeviceSupplicantFn *NetDeviceSupplicantFnPtr;
183 NetDevice(
int irq, NetDeviceController controller, NetDeviceBusType busType,
int select, NetDeviceSelectDetail selectDetails);
186 virtual ~NetDevice();
193 static int add(
int irq, NetDeviceController controller, NetDeviceBusType busType,
int select, NetDeviceSelectDetail selectDetails);
196 static NetDevice *getNetDevice(
int deviceIndex);
200 virtual BOOL setupBus(
void);
203 virtual BOOL setupIsr(DeviceIsrFnPtr isrFunction,
int irq);
206 virtual BOOL probe(
void);
209 virtual BOOL open(
void);
212 virtual BOOL
close(
void);
215 virtual BOOL
remove(void);
218 virtual BOOL configure(
int request, ssize_t parameterSize,
void *parameterPtr);
219 virtual BOOL retrieveSetting(
int setting, ssize_t settingSize,
void *settingPtr);
222 virtual BOOL list(
int request, ssize_t &listSize,
void *listPtr);
225 virtual void getNetworkName(
char *name, ssize_t maximumBytes);
228 virtual BOOL surveyNetwork(
char *site);
231 virtual BOOL connect(
const char *identifier =
NULL,
const char *securityKey =
NULL,
int securityDetail = 0,
int mode = 0);
234 virtual BOOL disconnect(
void);
238 virtual BOOL transmitPacket(PoolPtr poolPtr);
241 virtual void resetMulticast(MACADDRESS_48 macAddress, BOOL addAddress);
245 void setInterfaceNumber(
int interfaceNumber);
246 int getInterfaceNumber(
void)
const;
249 int getNumber(
void)
const;
255 int getUnit(
void)
const;
258 NetDeviceController getController(
void)
const;
261 NetDeviceBusType getBusType(
void)
const;
264 int getSelect(
void)
const;
267 NetDeviceSelectDetail getSelectDetail(
void)
const;
270 virtual BOOL getMacAddress(MACADDRESS_48 &macAddress);
273 virtual BOOL isConnected(
void);
276 virtual void setProgressRoutine(NetDeviceProgressFnPtr routinePtr);
279 virtual void setSupplicant(NetDeviceSupplicantFnPtr routinePtr);
282 void setTicksPerSecond(
unsigned short ticksPerSecond);
283 unsigned int getTicksPerSecond(
void)
const;
286 virtual void signalInterrupt(
void);
289 BOOL isValid(
void)
const;
293 void setName(
const char *namePtr);
296 void setUnit(
int unit);
299 void setValid(BOOL valid)
const;
319 NetDeviceController __controller;
322 NetDeviceBusType __busType;
328 NetDeviceSelectDetail __selectDetail;
331 int __interfaceNumber;
334 unsigned short __ticksPerSecond;
341 static BOOL __isInitialized;
344 static OS_CRIT __criticalSection;
347 static NetDevice *__device[NETDEVICE_DEVICE_MAXIMUM];
370 BOOL NetDeviceIsValid(
int irq, NetDeviceController controller, NetDeviceBusType busType);
396 NetDevice *NetDeviceGetDevice(
int irq,
397 NetDeviceController controller,
398 NetDeviceBusType busType,
400 NetDeviceSelectDetail selectDetails);
403 NetDevice *NetDeviceGetDeviceRtl8711SdioSpi(
int irq,
int select, NetDeviceSelectDetail selectDetails);
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, unsigned long timeout)
This function waits for events to occur on one or more I/O resources associated with a set of file de...
Definition: iosys.cpp:362
int close(int fd)
This function closes the resources associated with a file descriptor (fd). This can be a TCP socket o...
Definition: fileio.cpp:99
An OS_CRIT object is used to establish critical sections of code that can only be run by one task at ...
Definition: nbrtos.h:893
#define NULL
Definition: nm_bsp.h:76