beautypg.com

DSS Networks 5161 User Manual

Page 27

background image

GigMAC PMC and PCI

Board and Driver Users Manual

C. Issue ioctl command

/* issue ioctl to network driver */

err = ioctl (s, SIOCDEVPRIVATE + subCmd, &ifr);

D. Check and print results

if (err < 0)

{

/* perror (errno); */

usage ();

exit (1);

}

if (subCmd == DM_IOCTL_GET_TRC)

{

print_trace();

}

else

{

if ((subCmd != DM_IOCTL_SET_LOOP_MODE) &&

(subCmd != DM_IOCTL_PROG_EEPROM))

printf ("\n%s\n", myDataBuf);

}

IOCTL COMMAND SUB-TYPES


/* get driver trace buffer */

#define DM_IOCTL_GET_TRC 1

/* get driver statistics */

#define DM_IOCTL_GET_STATS 2

/* get phy registers */

#define DM_IOCTL_GET_PHY_REGS 3

/* get mac registers */

#define DM_IOCTL_GET_MAC_REGS 4

/* set loopback mode */

#define DM_IOCTL_SET_LOOP_MODE 5

Additional arguments:

arg1=0

Disable loopback

arg1=1

Enable loopback

/* read eeprom */

#define DM_IOCTL_READ_EEPROM

6

/* program eeprom */

#define DM_IOCTL_PROG_EEPROM 7

/* get mac address */

#define DM_IOCTL_GET_MAC_ADDR 8

DSS NETWORKS, INC.

Version: 2.0

Page: 27

This manual is related to the following products: