1 #include <linux/config.h>
7 #include <linux/sysctl.h>
8 #include <linux/version.h>
10 /* void enableReceive(struct net_device* dev);
13 static int arlan_command(struct net_device
* dev
, int command
);
16 #define ARLAN_STR_SIZE 0x2ff0
17 #define DEV_ARLAN_INFO 1
19 #define SARLG(type,var) {\
20 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n", #var, READSHMB(priva->card->var)); \
23 #define SARLBN(type,var,nn) {\
24 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x",#var);\
25 for (i=0; i < nn; i++ ) pos += sprintf(arlan_drive_info+pos, "%02x",READSHMB(priva->card->var[i]));\
26 pos += sprintf(arlan_drive_info+pos, "\n"); \
29 #define SARLBNpln(type,var,nn) {\
30 for (i=0; i < nn; i++ ) pos += sprintf(arlan_drive_info+pos, "%02x",READSHMB(priva->card->var[i]));\
33 #define SARLSTR(var,nn) {\
36 if (nn > 399 ) tmpLn = 399; \
37 memcpy(tmpStr,(char *) priva->conf->var,tmpLn);\
39 pos += sprintf(arlan_drive_info+pos, "%s\t=\t%s \n",#var,priva->conf->var);\
42 #define SARLUC(var) SARLG(u_char, var)
43 #define SARLUCN(var,nn) SARLBN(u_char,var, nn)
44 #define SARLUS(var) SARLG(u_short, var)
45 #define SARLUSN(var,nn) SARLBN(u_short,var, nn)
46 #define SARLUI(var) SARLG(u_int, var)
48 #define SARLUSA(var) {\
50 memcpy(&tmpVar, (short *) priva->conf->var,2); \
51 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n",#var, tmpVar);\
54 #define SARLUIA(var) {\
56 memcpy(&tmpVar, (int* )priva->conf->var,4); \
57 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n",#var, tmpVar);\
61 const char *arlan_diagnostic_info_string(struct net_device
*dev
)
64 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
65 u_char diagnosticInfo
;
67 READSHM(diagnosticInfo
, arlan
->diagnosticInfo
, u_char
);
69 switch (diagnosticInfo
)
72 return "Diagnostic info is OK";
74 return "ERROR EPROM Checksum error ";
76 return "ERROR Local Ram Test Failed ";
78 return "ERROR SCC failure ";
80 return "ERROR BackBone failure ";
82 return "ERROR tranceiver not found ";
84 return "ERROR no more address space ";
86 return "ERROR Checksum error ";
88 return "ERROR Missing SS Code";
90 return "ERROR Invalid config format";
92 return "ERROR Reserved errorcode F5";
94 return "ERROR Invalid spreading code/channel number";
96 return "ERROR Load Code Error";
98 return "ERROR Reserver errorcode F2 ";
100 return "ERROR Invalid command receivec by LAN card ";
102 return "ERROR Invalid parameter found in command ";
104 return "ERROR On-chip timer failure ";
106 return "ERROR T410 timer failure ";
108 return "ERROR Too Many TxEnable commands ";
110 return "ERROR EEPROM error on radio module ";
112 return "ERROR unknown Diagnostic info reply code ";
116 static const char *arlan_hardware_type_string(struct net_device
*dev
)
119 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
121 READSHM(hardwareType
, arlan
->hardwareType
, u_char
);
122 switch (hardwareType
)
129 return "type TMA coproc";
131 return "type A650E ";
133 return "type TMA coproc Australian";
135 return "type A650A ";
137 return "type TMA coproc European";
141 return "type A655A ";
143 return "type A655E ";
147 return "type A670E ";
149 return "type A670A ";
153 return "type A411TA";
159 return "type A412TA";
161 return "type A411TE";
163 return "type A412TE";
165 return "type A671T ";
167 return "type A671TA ";
169 return "type A671TE ";
171 return "type A415T ";
173 return "type A415TA ";
175 return "type A415TE ";
179 return "type A672A ";
183 return "type IC2200";
189 static void arlan_print_diagnostic_info(struct net_device
*dev
)
192 u_char diagnosticInfo
;
193 u_short diagnosticOffset
;
195 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
197 // ARLAN_DEBUG_ENTRY("arlan_print_diagnostic_info");
199 if (READSHMB(arlan
->configuredStatusFlag
) == 0)
200 printk("Arlan: Card NOT configured\n");
202 printk("Arlan: Card is configured\n");
204 READSHM(diagnosticInfo
, arlan
->diagnosticInfo
, u_char
);
205 READSHM(diagnosticOffset
, arlan
->diagnosticOffset
, u_short
);
207 printk(KERN_INFO
"%s\n", arlan_diagnostic_info_string(dev
));
209 if (diagnosticInfo
!= 0xff)
210 printk("%s arlan: Diagnostic Offset %d \n", dev
->name
, diagnosticOffset
);
212 printk("arlan: LAN CODE ID = ");
213 for (i
= 0; i
< 6; i
++)
214 DEBUGSHM(1, "%03d:", arlan
->lanCardNodeId
[i
], u_char
);
217 printk("arlan: Arlan BroadCast address = ");
218 for (i
= 0; i
< 6; i
++)
219 DEBUGSHM(1, "%03d:", arlan
->broadcastAddress
[i
], u_char
);
222 READSHM(hardwareType
, arlan
->hardwareType
, u_char
);
223 printk(KERN_INFO
"%s\n", arlan_hardware_type_string(dev
));
226 DEBUGSHM(1, "arlan: channelNumber=%d\n", arlan
->channelNumber
, u_char
);
227 DEBUGSHM(1, "arlan: channelSet=%d\n", arlan
->channelSet
, u_char
);
228 DEBUGSHM(1, "arlan: spreadingCode=%d\n", arlan
->spreadingCode
, u_char
);
229 DEBUGSHM(1, "arlan: radioNodeId=%d\n", arlan
->radioNodeId
, u_short
);
230 DEBUGSHM(1, "arlan: SID =%d\n", arlan
->SID
, u_short
);
231 DEBUGSHM(1, "arlan: rxOffset=%d\n", arlan
->rxOffset
, u_short
);
233 DEBUGSHM(1, "arlan: registration mode is %d\n", arlan
->registrationMode
, u_char
);
235 printk("arlan: name= ");
238 for (i
= 0; i
< 16; i
++)
241 READSHM(c
, arlan
->name
[i
], char);
247 // ARLAN_DEBUG_EXIT("arlan_print_diagnostic_info");
252 /****************************** TEST MEMORY **************/
254 static int arlan_hw_test_memory(struct net_device
*dev
)
258 int memlen
= sizeof(struct arlan_shmem
) - 0xF; /* avoid control register */
259 volatile char *arlan_mem
= (char *) (dev
->mem_start
);
260 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
265 /* hold card in reset state */
266 setHardwareReset(dev
);
270 for (i
= 0; i
< memlen
; i
++)
271 WRITESHM(arlan_mem
[i
], ((u_char
) pattern
++), u_char
);
274 for (i
= 0; i
< memlen
; i
++)
277 READSHM(res
, arlan_mem
[i
], char);
278 if (res
!= pattern
++)
280 printk(KERN_ERR
"Arlan driver memory test 1 failed \n");
286 for (i
= 0; i
< memlen
; i
++)
287 WRITESHM(arlan_mem
[i
], ~(pattern
++), char);
290 for (i
= 0; i
< memlen
; i
++)
293 READSHM(res
, arlan_mem
[i
], char);
294 if (res
!= ~(pattern
++))
296 printk(KERN_ERR
"Arlan driver memory test 2 failed \n");
302 for (i
= 0; i
< memlen
; i
++)
303 WRITESHM(arlan_mem
[i
], 0x00, char);
305 IFDEBUG(1) printk(KERN_INFO
"Arlan: memory tests ok\n");
307 /* set reset flag and then release reset */
308 WRITESHM(arlan
->resetFlag
, 0xff, u_char
);
310 clearChannelAttention(dev
);
311 clearHardwareReset(dev
);
313 /* wait for reset flag to become zero, we'll wait for two seconds */
314 if (arlan_command(dev
, ARLAN_COMMAND_LONG_WAIT_NOW
))
316 printk(KERN_ERR
"%s arlan: failed to come back from memory test\n", dev
->name
);
323 static int arlan_setup_card_by_book(struct net_device
*dev
)
325 u_char irqLevel
, configuredStatusFlag
;
326 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
328 // ARLAN_DEBUG_ENTRY("arlan_setup_card");
330 READSHM(configuredStatusFlag
, arlan
->configuredStatusFlag
, u_char
);
333 if (configuredStatusFlag
!= 0)
334 IFDEBUG(10) printk("arlan: CARD IS CONFIGURED\n");
336 IFDEBUG(10) printk("arlan: card is NOT configured\n");
338 if (testMemory
|| (READSHMB(arlan
->diagnosticInfo
) != 0xff))
339 if (arlan_hw_test_memory(dev
))
342 DEBUGSHM(4, "arlan configuredStatus = %d \n", arlan
->configuredStatusFlag
, u_char
);
343 DEBUGSHM(4, "arlan driver diagnostic: 0x%2x\n", arlan
->diagnosticInfo
, u_char
);
345 /* issue nop command - no interupt */
346 arlan_command(dev
, ARLAN_COMMAND_NOOP
);
347 if (arlan_command(dev
, ARLAN_COMMAND_WAIT_NOW
) != 0)
350 IFDEBUG(50) printk("1st Noop successfully executed !!\n");
352 /* try to turn on the arlan interrupts */
353 clearClearInterrupt(dev
);
354 setClearInterrupt(dev
);
355 setInterruptEnable(dev
);
357 /* issue nop command - with interrupt */
359 arlan_command(dev
, ARLAN_COMMAND_NOOPINT
);
360 if (arlan_command(dev
, ARLAN_COMMAND_WAIT_NOW
) != 0)
364 IFDEBUG(50) printk("2nd Noop successfully executed !!\n");
366 READSHM(irqLevel
, arlan
->irqLevel
, u_char
)
368 if (irqLevel
!= dev
->irq
)
370 IFDEBUG(1) printk(KERN_WARNING
"arlan dip switches set irq to %d\n", irqLevel
);
371 printk(KERN_WARNING
"device driver irq set to %d - does not match\n", dev
->irq
);
375 IFDEBUG(2) printk("irq level is OK\n");
378 IFDEBUG(3) arlan_print_diagnostic_info(dev
);
380 arlan_command(dev
, ARLAN_COMMAND_CONF
);
382 READSHM(configuredStatusFlag
, arlan
->configuredStatusFlag
, u_char
);
383 if (configuredStatusFlag
== 0)
385 printk(KERN_WARNING
"arlan configure failed\n");
388 arlan_command(dev
, ARLAN_COMMAND_LONG_WAIT_NOW
);
389 arlan_command(dev
, ARLAN_COMMAND_RX
);
390 arlan_command(dev
, ARLAN_COMMAND_LONG_WAIT_NOW
);
391 printk(KERN_NOTICE
"%s: arlan driver version %s loaded\n",
392 dev
->name
, arlan_version
);
394 // ARLAN_DEBUG_EXIT("arlan_setup_card");
396 return 0; /* no errors */
400 #ifdef ARLAN_PROC_INTERFACE
401 #ifdef ARLAN_PROC_SHM_DUMP
403 static char arlan_drive_info
[ARLAN_STR_SIZE
] = "A655\n\0";
405 static int arlan_sysctl_info(ctl_table
* ctl
, int write
, struct file
*filp
,
406 void *buffer
, size_t * lenp
)
409 int retv
, pos
, devnum
;
410 struct arlan_private
*priva
= NULL
;
411 struct net_device
*dev
;
416 for (i
= 0; i
< 100; i
++)
417 printk("adi %x \n", arlan_drive_info
[i
]);
419 if (ctl
->procname
== NULL
|| arlan_drive_info
== NULL
)
421 printk(KERN_WARNING
" procname is NULL in sysctl_table or arlan_drive_info is NULL \n at arlan module\n ");
424 devnum
= ctl
->procname
[5] - '0';
425 if (devnum
< 0 || devnum
> MAX_ARLANS
- 1)
427 printk(KERN_WARNING
"too strange devnum in procfs parse\n ");
430 else if (arlan_device
[devnum
] == NULL
)
433 pos
+= sprintf(arlan_drive_info
+ pos
, "\t%s\n\n", ctl
->procname
);
434 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
438 priva
= arlan_device
[devnum
]->priv
;
442 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
445 dev
= arlan_device
[devnum
];
447 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
449 pos
= sprintf(arlan_drive_info
, "Arlan info \n");
450 /* Header Signature */
451 SARLSTR(textRegion
, 48);
453 pos
+= sprintf(arlan_drive_info
+ pos
, "diagnosticInfo\t=\t%s \n", arlan_diagnostic_info_string(dev
));
454 SARLUC(diagnosticInfo
);
455 SARLUS(diagnosticOffset
);
457 SARLUCN(lanCardNodeId
, 6);
458 SARLUCN(broadcastAddress
, 6);
459 pos
+= sprintf(arlan_drive_info
+ pos
, "hardwareType =\t %s \n", arlan_hardware_type_string(dev
));
460 SARLUC(hardwareType
);
461 SARLUC(majorHardwareVersion
);
462 SARLUC(minorHardwareVersion
);
464 SARLUC(defaultChannelSet
);
467 /* Control/Status Block - 0x0080 */
468 SARLUC(interruptInProgress
);
469 SARLUC(cntrlRegImage
);
473 SARLUCN(commandParameter
, 15);
475 /* Receive Status - 0x00a0 */
481 SARLUC(rxBroadcastFlag
);
486 /* Transmit Status - 0x00b0 */
488 SARLUC(txAckQuality
);
491 SARLUCN(registeredRouter
, 6);
492 SARLUCN(backboneRouter
, 6);
493 SARLUC(registrationStatus
);
494 SARLUC(configuredStatusFlag
);
496 SARLUCN(ultimateDestAddress
, 6);
497 SARLUCN(immedDestAddress
, 6);
498 SARLUCN(immedSrcAddress
, 6);
499 SARLUS(rxSequenceNumber
);
500 SARLUC(assignedLocaltalkAddress
);
503 /* System Parameter Block */
505 /* - Driver Parameters (Novell Specific) */
508 SARLUS(transportTime
);
511 /* - Configuration Parameters */
513 SARLUC(spreadingCode
);
515 SARLUC(channelNumber
);
518 SARLUC(scramblingDisable
);
522 SARLUC(txAttenuation
);
524 SARLUS(globalChecksum
);
526 SARLUS(maxDatagramSize
);
527 SARLUS(maxFrameSize
);
531 SARLUC(rootOrRepeater
);
532 SARLUCN(specifiedRouter
, 6);
533 SARLUS(fastPollPeriod
);
535 SARLUSA(fastPollDelay
);
536 SARLUC(arlThreshold
);
539 SARLUS(specRouterTimeout
);
544 SARLUCN(encryptionKey
, 12);
550 SARLUS(sectionChecksum
);
552 SARLUC(registrationMode
);
553 SARLUC(registrationFill
);
555 SARLUS(refreshPeriod
);
558 SARLUC(localTalkAddress
);
567 /* SARLUCN( _16, 0x140);
569 /* Statistics Block - 0x0300 */
572 SARLUCN(resetTime
, 18);
573 SARLUIA(numDatagramsTransmitted
);
574 SARLUIA(numReTransmissions
);
575 SARLUIA(numFramesDiscarded
);
576 SARLUIA(numDatagramsReceived
);
577 SARLUIA(numDuplicateReceivedFrames
);
578 SARLUIA(numDatagramsDiscarded
);
579 SARLUS(maxNumReTransmitDatagram
);
580 SARLUS(maxNumReTransmitFrames
);
581 SARLUS(maxNumConsecutiveDuplicateFrames
);
582 /* misaligned here so we have to go to characters */
583 SARLUIA(numBytesTransmitted
);
584 SARLUIA(numBytesReceived
);
585 SARLUIA(numCRCErrors
);
586 SARLUIA(numLengthErrors
);
587 SARLUIA(numAbortErrors
);
588 SARLUIA(numTXUnderruns
);
589 SARLUIA(numRXOverruns
);
590 SARLUIA(numHoldOffs
);
591 SARLUIA(numFramesTransmitted
);
592 SARLUIA(numFramesReceived
);
593 SARLUIA(numReceiveFramesLost
);
594 SARLUIA(numRXBufferOverflows
);
595 SARLUIA(numFramesDiscardedAddrMismatch
);
596 SARLUIA(numFramesDiscardedSIDMismatch
);
597 SARLUIA(numPollsTransmistted
);
598 SARLUIA(numPollAcknowledges
);
599 SARLUIA(numStatusTimeouts
);
600 SARLUIA(numNACKReceived
);
606 /* next 4 seems too long for procfs, over single page ?
608 SARLUCN( txBuffer, 0x800);
609 SARLUCN( rxBuffer, 0x800);
610 SARLUCN( _18, 0x0bff);
613 pos
+= sprintf(arlan_drive_info
+ pos
, "rxRing\t=\t0x");
614 for (i
= 0; i
< 0x50; i
++)
615 pos
+= sprintf(arlan_drive_info
+ pos
, "%02x", ((char *) priva
->conf
)[priva
->conf
->rxOffset
+ i
]);
616 pos
+= sprintf(arlan_drive_info
+ pos
, "\n");
618 SARLUC(configStatus
);
622 SARLUC(controlRegister
);
624 pos
+= sprintf(arlan_drive_info
+ pos
, " total %d chars\n", pos
);
627 pos
+= sprintf(arlan_drive_info
+ pos
, " driver name : %s\n", ctl
->procname
);
632 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
642 static int arlan_sysctl_info161719(ctl_table
* ctl
, int write
, struct file
*filp
,
643 void *buffer
, size_t * lenp
)
646 int retv
, pos
, devnum
;
647 struct arlan_private
*priva
= NULL
;
650 devnum
= ctl
->procname
[5] - '0';
651 if (arlan_device
[devnum
] == NULL
)
653 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
657 priva
= arlan_device
[devnum
]->priv
;
660 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
663 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
672 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
676 static int arlan_sysctl_infotxRing(ctl_table
* ctl
, int write
, struct file
*filp
,
677 void *buffer
, size_t * lenp
)
680 int retv
, pos
, devnum
;
681 struct arlan_private
*priva
= NULL
;
684 devnum
= ctl
->procname
[5] - '0';
685 if (arlan_device
[devnum
] == NULL
)
687 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
691 priva
= arlan_device
[devnum
]->priv
;
694 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
697 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
698 SARLBNpln(u_char
, txBuffer
, 0x800);
701 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
705 static int arlan_sysctl_inforxRing(ctl_table
* ctl
, int write
, struct file
*filp
,
706 void *buffer
, size_t * lenp
)
709 int retv
, pos
, devnum
;
710 struct arlan_private
*priva
= NULL
;
713 devnum
= ctl
->procname
[5] - '0';
714 if (arlan_device
[devnum
] == NULL
)
716 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
719 priva
= arlan_device
[devnum
]->priv
;
722 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
725 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
726 SARLBNpln(u_char
, rxBuffer
, 0x800);
729 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
733 static int arlan_sysctl_info18(ctl_table
* ctl
, int write
, struct file
*filp
,
734 void *buffer
, size_t * lenp
)
737 int retv
, pos
, devnum
;
738 struct arlan_private
*priva
= NULL
;
741 devnum
= ctl
->procname
[5] - '0';
742 if (arlan_device
[devnum
] == NULL
)
744 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
748 priva
= arlan_device
[devnum
]->priv
;
751 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
754 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
755 SARLBNpln(u_char
, _18
, 0x800);
759 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
764 #endif /* #ifdef ARLAN_PROC_SHM_DUMP */
767 static char conf_reset_result
[200];
769 static int arlan_configure(ctl_table
* ctl
, int write
, struct file
*filp
,
770 void *buffer
, size_t * lenp
)
773 int devnum
= ctl
->procname
[6] - '0';
774 struct arlan_private
*priv
;
776 if (devnum
< 0 || devnum
> MAX_ARLANS
- 1)
778 printk(KERN_WARNING
"too strange devnum in procfs parse\n ");
781 else if (arlan_device
[devnum
] != NULL
)
783 priv
= arlan_device
[devnum
]->priv
;
785 arlan_command(arlan_device
[devnum
], ARLAN_COMMAND_CLEAN_AND_CONF
);
791 return proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
794 int arlan_sysctl_reset(ctl_table
* ctl
, int write
, struct file
*filp
,
795 void *buffer
, size_t * lenp
)
798 int devnum
= ctl
->procname
[5] - '0';
799 struct arlan_private
*priv
;
801 if (devnum
< 0 || devnum
> MAX_ARLANS
- 1)
803 printk(KERN_WARNING
"too strange devnum in procfs parse\n ");
806 else if (arlan_device
[devnum
] != NULL
)
808 priv
= arlan_device
[devnum
]->priv
;
809 arlan_command(arlan_device
[devnum
], ARLAN_COMMAND_CLEAN_AND_RESET
);
814 return proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
818 /* Place files in /proc/sys/dev/arlan */
819 #define CTBLN(num,card,nam) \
820 {num , #nam, &(arlan_conf[card].nam), \
821 sizeof(int), 0600, NULL, &proc_dointvec}
824 #define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\
825 CTBLN(1,cardNo,spreadingCode),\
826 CTBLN(2,cardNo, channelNumber),\
827 CTBLN(3,cardNo, scramblingDisable),\
828 CTBLN(4,cardNo, txAttenuation),\
829 CTBLN(5,cardNo, systemId), \
830 CTBLN(6,cardNo, maxDatagramSize),\
831 CTBLN(7,cardNo, maxFrameSize),\
832 CTBLN(8,cardNo, maxRetries),\
833 CTBLN(9,cardNo, receiveMode),\
834 CTBLN(10,cardNo, priority),\
835 CTBLN(11,cardNo, rootOrRepeater),\
836 CTBLN(12,cardNo, SID),\
837 CTBLN(13,cardNo, registrationMode),\
838 CTBLN(14,cardNo, registrationFill),\
839 CTBLN(15,cardNo, localTalkAddress),\
840 CTBLN(16,cardNo, codeFormat),\
841 CTBLN(17,cardNo, numChannels),\
842 CTBLN(18,cardNo, channel1),\
843 CTBLN(19,cardNo, channel2),\
844 CTBLN(20,cardNo, channel3),\
845 CTBLN(21,cardNo, channel4),\
846 CTBLN(22,cardNo, txClear),\
847 CTBLN(23,cardNo, txRetries),\
848 CTBLN(24,cardNo, txRouting),\
849 CTBLN(25,cardNo, txScrambled),\
850 CTBLN(26,cardNo, rxParameter),\
851 CTBLN(27,cardNo, txTimeoutMs),\
852 CTBLN(28,cardNo, waitCardTimeout),\
853 CTBLN(29,cardNo, channelSet), \
854 {30, "name", arlan_conf[cardNo].siteName, \
855 16, 0600, NULL, &proc_dostring},\
856 CTBLN(31,cardNo,waitTime),\
857 CTBLN(32,cardNo,lParameter),\
858 CTBLN(33,cardNo,_15),\
859 CTBLN(34,cardNo,headerSize),\
860 CTBLN(35,cardNo,async),\
861 CTBLN(36,cardNo,tx_delay_ms),\
862 CTBLN(37,cardNo,retries),\
863 CTBLN(38,cardNo,ReTransmitPacketMaxSize),\
864 CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\
865 CTBLN(40,cardNo,fastReTransCount),\
866 CTBLN(41,cardNo,driverRetransmissions),\
867 CTBLN(42,cardNo,txAckTimeoutMs),\
868 CTBLN(43,cardNo,registrationInterrupts),\
869 CTBLN(44,cardNo,hardwareType),\
870 CTBLN(45,cardNo,radioType),\
871 CTBLN(46,cardNo,writeEEPROM),\
872 CTBLN(47,cardNo,writeRadioType),\
873 {48, "entry_exit_debug", &arlan_entry_and_exit_debug, \
874 sizeof(int), 0600, NULL, &proc_dointvec},\
875 {49, "debug", &arlan_debug, \
876 sizeof(int), 0600, NULL, &proc_dointvec},\
877 CTBLN(50,cardNo,in_speed),\
878 CTBLN(51,cardNo,out_speed),\
879 CTBLN(52,cardNo,in_speed10),\
880 CTBLN(53,cardNo,out_speed10),\
881 CTBLN(54,cardNo,in_speed_max),\
882 CTBLN(55,cardNo,out_speed_max),\
883 CTBLN(56,cardNo,measure_rate),\
884 CTBLN(57,cardNo,pre_Command_Wait),\
885 CTBLN(58,cardNo,rx_tweak1),\
886 CTBLN(59,cardNo,rx_tweak2),\
887 CTBLN(60,cardNo,tx_queue_len),\
891 static ctl_table arlan_conf_table0[] =
893 ARLAN_SYSCTL_TABLE_TOTAL(0)
895 #ifdef ARLAN_PROC_SHM_DUMP
896 {150, "arlan0-txRing", &arlan_drive_info
,
897 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
898 {151, "arlan0-rxRing", &arlan_drive_info
,
899 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
900 {152, "arlan0-18", &arlan_drive_info
,
901 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
902 {153, "arlan0-ring", &arlan_drive_info
,
903 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
904 {154, "arlan0-shm-cpy", &arlan_drive_info
,
905 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
907 {155, "config0", &conf_reset_result
, \
908 100, 0400, NULL
, &arlan_configure
}, \
909 {156, "reset0", &conf_reset_result
, \
910 100, 0400, NULL
, &arlan_sysctl_reset
}, \
914 static ctl_table arlan_conf_table1
[] =
917 ARLAN_SYSCTL_TABLE_TOTAL(1)
919 #ifdef ARLAN_PROC_SHM_DUMP
920 {150, "arlan1-txRing", &arlan_drive_info
,
921 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
922 {151, "arlan1-rxRing", &arlan_drive_info
,
923 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
924 {152, "arlan1-18", &arlan_drive_info
,
925 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
926 {153, "arlan1-ring", &arlan_drive_info
,
927 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
928 {154, "arlan1-shm-cpy", &arlan_drive_info
,
929 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
931 {155, "config1", &conf_reset_result
,
932 100, 0400, NULL
, &arlan_configure
},
933 {156, "reset1", &conf_reset_result
,
934 100, 0400, NULL
, &arlan_sysctl_reset
},
938 static ctl_table arlan_conf_table2
[] =
941 ARLAN_SYSCTL_TABLE_TOTAL(2)
943 #ifdef ARLAN_PROC_SHM_DUMP
944 {150, "arlan2-txRing", &arlan_drive_info
,
945 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
946 {151, "arlan2-rxRing", &arlan_drive_info
,
947 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
948 {152, "arlan2-18", &arlan_drive_info
,
949 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
950 {153, "arlan2-ring", &arlan_drive_info
,
951 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
952 {154, "arlan2-shm-cpy", &arlan_drive_info
,
953 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
955 {155, "config2", &conf_reset_result
,
956 100, 0400, NULL
, &arlan_configure
},
957 {156, "reset2", &conf_reset_result
,
958 100, 0400, NULL
, &arlan_sysctl_reset
},
962 static ctl_table arlan_conf_table3
[] =
965 ARLAN_SYSCTL_TABLE_TOTAL(3)
967 #ifdef ARLAN_PROC_SHM_DUMP
968 {150, "arlan3-txRing", &arlan_drive_info
,
969 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
970 {151, "arlan3-rxRing", &arlan_drive_info
,
971 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
972 {152, "arlan3-18", &arlan_drive_info
,
973 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
974 {153, "arlan3-ring", &arlan_drive_info
,
975 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
976 {154, "arlan3-shm-cpy", &arlan_drive_info
,
977 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
979 {155, "config3", &conf_reset_result
,
980 100, 0400, NULL
, &arlan_configure
},
981 {156, "reset3", &conf_reset_result
,
982 100, 0400, NULL
, &arlan_sysctl_reset
},
988 static ctl_table arlan_table
[] =
990 {0, "arlan0", NULL
, 0, 0600, arlan_conf_table0
},
991 {0, "arlan1", NULL
, 0, 0600, arlan_conf_table1
},
992 {0, "arlan2", NULL
, 0, 0600, arlan_conf_table2
},
993 {0, "arlan3", NULL
, 0, 0600, arlan_conf_table3
},
999 static ctl_table arlan_table
[MAX_ARLANS
+ 1] =
1006 static int mmtu
= 1234;
1008 static ctl_table arlan_root_table
[] =
1010 {254, "arlan", NULL
, 0, 0555, arlan_table
},
1014 /* Make sure that /proc/sys/dev is there */
1015 static ctl_table arlan_device_root_table
[] =
1017 {CTL_DEV
, "dev", NULL
, 0, 0555, arlan_root_table
},
1023 static struct ctl_table_header
*arlan_device_sysctl_header
= NULL
;
1025 int init_arlan_proc(void)
1029 if (arlan_device_sysctl_header
)
1031 for (i
= 0; i
< MAX_ARLANS
&& arlan_device
[i
]; i
++)
1032 arlan_table
[i
].ctl_name
= i
+ 1;
1033 arlan_device_sysctl_header
= register_sysctl_table(arlan_root_table
, 0);
1034 if (!arlan_device_sysctl_header
)
1045 int init_module(void)
1048 return init_arlan_proc();
1051 void cleanup_module(void)
1053 unregister_sysctl_table(arlan_device_sysctl_header
);
1054 arlan_device_sysctl_header
= NULL
;