#include "arlan.h"
#include <linux/sysctl.h>
#ifdef CONFIG_PROC_FS
/* void enableReceive(struct net_device* dev);
*/
#define ARLAN_STR_SIZE 0x2ff0
#define DEV_ARLAN_INFO 1
#define DEV_ARLAN 1
#define SARLG(type,var) {\
pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n", #var, READSHMB(priva->card->var)); \
}
#define SARLBN(type,var,nn) {\
pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x",#var);\
for (i=0; i < nn; i++ ) pos += sprintf(arlan_drive_info+pos, "%02x",READSHMB(priva->card->var[i]));\
pos += sprintf(arlan_drive_info+pos, "\n"); \
}
#define SARLBNpln(type,var,nn) {\
for (i=0; i < nn; i++ ) pos += sprintf(arlan_drive_info+pos, "%02x",READSHMB(priva->card->var[i]));\
}
#define SARLSTR(var,nn) {\
char tmpStr[400];\
int tmpLn = nn;\
if (nn > 399 ) tmpLn = 399; \
memcpy(tmpStr,(char *) priva->conf->var,tmpLn);\
tmpStr[tmpLn] = 0; \
pos += sprintf(arlan_drive_info+pos, "%s\t=\t%s \n",#var,priva->conf->var);\
}
#define SARLUC(var) SARLG(u_char, var)
#define SARLUCN(var,nn) SARLBN(u_char,var, nn)
#define SARLUS(var) SARLG(u_short, var)
#define SARLUSN(var,nn) SARLBN(u_short,var, nn)
#define SARLUI(var) SARLG(u_int, var)
#define SARLUSA(var) {\
u_short tmpVar;\
memcpy(&tmpVar, (short *) priva->conf->var,2); \
pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n",#var, tmpVar);\
}
#define SARLUIA(var) {\
u_int tmpVar;\
memcpy(&tmpVar, (int* )priva->conf->var,4); \
pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n",#var, tmpVar);\
}
static const char *arlan_diagnostic_info_string(struct net_device *dev)
{
struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem __iomem *arlan = priv->card;
u_char diagnosticInfo;
READSHM(diagnosticInfo, arlan->diagnosticInfo, u_char);
switch (diagnosticInfo)
{
case 0xFF:
return "Diagnostic info is OK";
case 0xFE:
return "ERROR EPROM Checksum error ";
case 0xFD:
return "ERROR Local Ram Test Failed ";
case 0xFC:
return "ERROR SCC failure ";
case 0xFB:
return "ERROR BackBone failure ";
case 0xFA:
return "ERROR transceiver not found ";
case 0xF9:
return "ERROR no more address space ";
case 0xF8:
return "ERROR Checksum error ";
case 0xF7:
return "ERROR Missing SS Code";
case 0xF6:
return "ERROR Invalid config format";
case 0xF5:
return "ERROR Reserved errorcode F5";
case 0xF4:
return "ERROR Invalid spreading code/channel number";
case 0xF3:
return "ERROR Load Code Error";
case 0xF2:
return "ERROR Reserver errorcode F2 ";
case 0xF1:
return "ERROR Invalid command receivec by LAN card ";
case 0xF0:
return "ERROR Invalid parameter found in command ";
case 0xEF:
return "ERROR On-chip timer failure ";
case 0xEE:
return "ERROR T410 timer failure ";
case 0xED:
return "ERROR Too Many TxEnable commands ";
case 0xEC:
return "ERROR EEPROM error on radio module ";
default:
return "ERROR unknown Diagnostic info reply code ";
}
}
static const char *arlan_hardware_type_string(struct net_device *dev)
{
u_char hardwareType;
struct arlan_private *priv = netdev_priv(dev);
volatile struct arlan_shmem __iomem *arlan = priv->card;
READSHM(hardwareType, arlan->hardwareType, u_char);
switch (hardwareType)
{
case 0x00:
return "type A450";
case 0x01:
return "type A650 ";