XINU
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
ethcontrol.c File Reference

Quark ethernetデバイスの制御機能。 More...

#include <xinu.h>
Include dependency graph for ethcontrol.c:

Go to the source code of this file.

Functions

devcall ethcontrol (struct dentry *devptr, int32 func, int32 arg1, int32 arg2)
 

Detailed Description

Quark ethernetデバイスの制御機能。

Definition in file ethcontrol.c.

Function Documentation

◆ ethcontrol()

devcall ethcontrol ( struct dentry devptr,
int32  func,
int32  arg1,
int32  arg2 
)

Definition at line 18 of file ethcontrol.c.

References ethcblk::devAddress, dentry::dvminor, ETH_ADDR_LEN, ETH_CTRL_GET_MAC, ethertab, memcpy(), OK, and SYSERR.

24 {
25  struct ethcblk *ethptr; /* Ethertab entry pointer */
26  int32 retval = OK; /* Return value of cntl function*/
27 
28  ethptr = &ethertab[devptr->dvminor];
29 
30  switch (func)
31  {
32 
33  /* Get MAC address */
34 
35  case ETH_CTRL_GET_MAC:
36  memcpy((byte *)arg1, ethptr->devAddress,
37  ETH_ADDR_LEN);
38  break;
39 
40  default:
41  return SYSERR;
42  }
43 
44  return retval;
45 }
unsigned char byte
符号なし8ビット値(unsigned char)
Definition: kernel.h:7
int32 dvminor
Definition: conf.h:8
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
Definition: ether.h:68
#define OK
処理が成功した場合
Definition: kernel.h:77
byte devAddress[ETH_ADDR_LEN]
Definition: ether.h:96
#define ETH_CTRL_GET_MAC
Definition: ether.h:45
struct ethcblk ethertab[]
Definition: ethinit.c:7
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
#define ETH_ADDR_LEN
Definition: ether.h:10
void * memcpy(void *, const void *, int32)
メモリAの領域(source)からメモリBの領域(Destination)にN Byteコピーする。
Definition: memcpy.c:13
Here is the call graph for this function: