1 #include <linux/config.h>
4 #include <linux/sysctl.h>
9 #include <linux/version.h>
11 /* void enableReceive(struct net_device* dev);
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";
188 #ifdef ARLAN_DEBUGING
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
);
322 static int arlan_setup_card_by_book(struct net_device
*dev
)
324 u_char irqLevel
, configuredStatusFlag
;
325 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
327 // ARLAN_DEBUG_ENTRY("arlan_setup_card");
329 READSHM(configuredStatusFlag
, arlan
->configuredStatusFlag
, u_char
);
332 if (configuredStatusFlag
!= 0)
333 IFDEBUG(10) printk("arlan: CARD IS CONFIGURED\n");
335 IFDEBUG(10) printk("arlan: card is NOT configured\n");
337 if (testMemory
|| (READSHMB(arlan
->diagnosticInfo
) != 0xff))
338 if (arlan_hw_test_memory(dev
))
341 DEBUGSHM(4, "arlan configuredStatus = %d \n", arlan
->configuredStatusFlag
, u_char
);
342 DEBUGSHM(4, "arlan driver diagnostic: 0x%2x\n", arlan
->diagnosticInfo
, u_char
);
344 /* issue nop command - no interupt */
345 arlan_command(dev
, ARLAN_COMMAND_NOOP
);
346 if (arlan_command(dev
, ARLAN_COMMAND_WAIT_NOW
) != 0)
349 IFDEBUG(50) printk("1st Noop successfully executed !!\n");
351 /* try to turn on the arlan interrupts */
352 clearClearInterrupt(dev
);
353 setClearInterrupt(dev
);
354 setInterruptEnable(dev
);
356 /* issue nop command - with interrupt */
358 arlan_command(dev
, ARLAN_COMMAND_NOOPINT
);
359 if (arlan_command(dev
, ARLAN_COMMAND_WAIT_NOW
) != 0)
363 IFDEBUG(50) printk("2nd Noop successfully executed !!\n");
365 READSHM(irqLevel
, arlan
->irqLevel
, u_char
)
367 if (irqLevel
!= dev
->irq
)
369 IFDEBUG(1) printk(KERN_WARNING
"arlan dip switches set irq to %d\n", irqLevel
);
370 printk(KERN_WARNING
"device driver irq set to %d - does not match\n", dev
->irq
);
374 IFDEBUG(2) printk("irq level is OK\n");
377 IFDEBUG(3) arlan_print_diagnostic_info(dev
);
379 arlan_command(dev
, ARLAN_COMMAND_CONF
);
381 READSHM(configuredStatusFlag
, arlan
->configuredStatusFlag
, u_char
);
382 if (configuredStatusFlag
== 0)
384 printk(KERN_WARNING
"arlan configure failed\n");
387 arlan_command(dev
, ARLAN_COMMAND_LONG_WAIT_NOW
);
388 arlan_command(dev
, ARLAN_COMMAND_RX
);
389 arlan_command(dev
, ARLAN_COMMAND_LONG_WAIT_NOW
);
390 printk(KERN_NOTICE
"%s: arlan driver version %s loaded\n",
391 dev
->name
, arlan_version
);
393 // ARLAN_DEBUG_EXIT("arlan_setup_card");
395 return 0; /* no errors */
399 #ifdef ARLAN_PROC_INTERFACE
400 #ifdef ARLAN_PROC_SHM_DUMP
402 static char arlan_drive_info
[ARLAN_STR_SIZE
] = "A655\n\0";
404 static int arlan_sysctl_info(ctl_table
* ctl
, int write
, struct file
*filp
,
405 void *buffer
, size_t * lenp
)
408 int retv
, pos
, devnum
;
409 struct arlan_private
*priva
= NULL
;
410 struct net_device
*dev
;
415 for (i
= 0; i
< 100; i
++)
416 printk("adi %x \n", arlan_drive_info
[i
]);
418 if (ctl
->procname
== NULL
|| arlan_drive_info
== NULL
)
420 printk(KERN_WARNING
" procname is NULL in sysctl_table or arlan_drive_info is NULL \n at arlan module\n ");
423 devnum
= ctl
->procname
[5] - '0';
424 if (devnum
< 0 || devnum
> MAX_ARLANS
- 1)
426 printk(KERN_WARNING
"too strange devnum in procfs parse\n ");
429 else if (arlan_device
[devnum
] == NULL
)
432 pos
+= sprintf(arlan_drive_info
+ pos
, "\t%s\n\n", ctl
->procname
);
433 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
437 priva
= arlan_device
[devnum
]->priv
;
441 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
444 dev
= arlan_device
[devnum
];
446 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
448 pos
= sprintf(arlan_drive_info
, "Arlan info \n");
449 /* Header Signature */
450 SARLSTR(textRegion
, 48);
452 pos
+= sprintf(arlan_drive_info
+ pos
, "diagnosticInfo\t=\t%s \n", arlan_diagnostic_info_string(dev
));
453 SARLUC(diagnosticInfo
);
454 SARLUS(diagnosticOffset
);
456 SARLUCN(lanCardNodeId
, 6);
457 SARLUCN(broadcastAddress
, 6);
458 pos
+= sprintf(arlan_drive_info
+ pos
, "hardwareType =\t %s \n", arlan_hardware_type_string(dev
));
459 SARLUC(hardwareType
);
460 SARLUC(majorHardwareVersion
);
461 SARLUC(minorHardwareVersion
);
463 SARLUC(defaultChannelSet
);
466 /* Control/Status Block - 0x0080 */
467 SARLUC(interruptInProgress
);
468 SARLUC(cntrlRegImage
);
472 SARLUCN(commandParameter
, 15);
474 /* Receive Status - 0x00a0 */
480 SARLUC(rxBroadcastFlag
);
485 /* Transmit Status - 0x00b0 */
487 SARLUC(txAckQuality
);
490 SARLUCN(registeredRouter
, 6);
491 SARLUCN(backboneRouter
, 6);
492 SARLUC(registrationStatus
);
493 SARLUC(configuredStatusFlag
);
495 SARLUCN(ultimateDestAddress
, 6);
496 SARLUCN(immedDestAddress
, 6);
497 SARLUCN(immedSrcAddress
, 6);
498 SARLUS(rxSequenceNumber
);
499 SARLUC(assignedLocaltalkAddress
);
502 /* System Parameter Block */
504 /* - Driver Parameters (Novell Specific) */
507 SARLUS(transportTime
);
510 /* - Configuration Parameters */
512 SARLUC(spreadingCode
);
514 SARLUC(channelNumber
);
517 SARLUC(scramblingDisable
);
521 SARLUC(txAttenuation
);
523 SARLUS(globalChecksum
);
525 SARLUS(maxDatagramSize
);
526 SARLUS(maxFrameSize
);
530 SARLUC(rootOrRepeater
);
531 SARLUCN(specifiedRouter
, 6);
532 SARLUS(fastPollPeriod
);
534 SARLUSA(fastPollDelay
);
535 SARLUC(arlThreshold
);
538 SARLUS(specRouterTimeout
);
543 SARLUCN(encryptionKey
, 12);
549 SARLUS(sectionChecksum
);
551 SARLUC(registrationMode
);
552 SARLUC(registrationFill
);
554 SARLUS(refreshPeriod
);
557 SARLUC(localTalkAddress
);
566 /* SARLUCN( _16, 0x140);
568 /* Statistics Block - 0x0300 */
571 SARLUCN(resetTime
, 18);
572 SARLUIA(numDatagramsTransmitted
);
573 SARLUIA(numReTransmissions
);
574 SARLUIA(numFramesDiscarded
);
575 SARLUIA(numDatagramsReceived
);
576 SARLUIA(numDuplicateReceivedFrames
);
577 SARLUIA(numDatagramsDiscarded
);
578 SARLUS(maxNumReTransmitDatagram
);
579 SARLUS(maxNumReTransmitFrames
);
580 SARLUS(maxNumConsecutiveDuplicateFrames
);
581 /* misaligned here so we have to go to characters */
582 SARLUIA(numBytesTransmitted
);
583 SARLUIA(numBytesReceived
);
584 SARLUIA(numCRCErrors
);
585 SARLUIA(numLengthErrors
);
586 SARLUIA(numAbortErrors
);
587 SARLUIA(numTXUnderruns
);
588 SARLUIA(numRXOverruns
);
589 SARLUIA(numHoldOffs
);
590 SARLUIA(numFramesTransmitted
);
591 SARLUIA(numFramesReceived
);
592 SARLUIA(numReceiveFramesLost
);
593 SARLUIA(numRXBufferOverflows
);
594 SARLUIA(numFramesDiscardedAddrMismatch
);
595 SARLUIA(numFramesDiscardedSIDMismatch
);
596 SARLUIA(numPollsTransmistted
);
597 SARLUIA(numPollAcknowledges
);
598 SARLUIA(numStatusTimeouts
);
599 SARLUIA(numNACKReceived
);
605 /* next 4 seems too long for procfs, over single page ?
607 SARLUCN( txBuffer, 0x800);
608 SARLUCN( rxBuffer, 0x800);
609 SARLUCN( _18, 0x0bff);
612 pos
+= sprintf(arlan_drive_info
+ pos
, "rxRing\t=\t0x");
613 for (i
= 0; i
< 0x50; i
++)
614 pos
+= sprintf(arlan_drive_info
+ pos
, "%02x", ((char *) priva
->conf
)[priva
->conf
->rxOffset
+ i
]);
615 pos
+= sprintf(arlan_drive_info
+ pos
, "\n");
617 SARLUC(configStatus
);
621 SARLUC(controlRegister
);
623 pos
+= sprintf(arlan_drive_info
+ pos
, " total %d chars\n", pos
);
626 pos
+= sprintf(arlan_drive_info
+ pos
, " driver name : %s\n", ctl
->procname
);
631 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
641 static int arlan_sysctl_info161719(ctl_table
* ctl
, int write
, struct file
*filp
,
642 void *buffer
, size_t * lenp
)
645 int retv
, pos
, devnum
;
646 struct arlan_private
*priva
= NULL
;
649 devnum
= ctl
->procname
[5] - '0';
650 if (arlan_device
[devnum
] == NULL
)
652 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
656 priva
= arlan_device
[devnum
]->priv
;
659 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
662 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
671 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
675 static int arlan_sysctl_infotxRing(ctl_table
* ctl
, int write
, struct file
*filp
,
676 void *buffer
, size_t * lenp
)
679 int retv
, pos
, devnum
;
680 struct arlan_private
*priva
= NULL
;
683 devnum
= ctl
->procname
[5] - '0';
684 if (arlan_device
[devnum
] == NULL
)
686 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
690 priva
= arlan_device
[devnum
]->priv
;
693 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
696 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
697 SARLBNpln(u_char
, txBuffer
, 0x800);
700 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
704 static int arlan_sysctl_inforxRing(ctl_table
* ctl
, int write
, struct file
*filp
,
705 void *buffer
, size_t * lenp
)
708 int retv
, pos
, devnum
;
709 struct arlan_private
*priva
= NULL
;
712 devnum
= ctl
->procname
[5] - '0';
713 if (arlan_device
[devnum
] == NULL
)
715 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
718 priva
= arlan_device
[devnum
]->priv
;
721 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
724 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
725 SARLBNpln(u_char
, rxBuffer
, 0x800);
728 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
732 static int arlan_sysctl_info18(ctl_table
* ctl
, int write
, struct file
*filp
,
733 void *buffer
, size_t * lenp
)
736 int retv
, pos
, devnum
;
737 struct arlan_private
*priva
= NULL
;
740 devnum
= ctl
->procname
[5] - '0';
741 if (arlan_device
[devnum
] == NULL
)
743 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
747 priva
= arlan_device
[devnum
]->priv
;
750 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
753 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
754 SARLBNpln(u_char
, _18
, 0x800);
758 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
763 #endif /* #ifdef ARLAN_PROC_SHM_DUMP */
766 static char conf_reset_result
[200];
768 static int arlan_configure(ctl_table
* ctl
, int write
, struct file
*filp
,
769 void *buffer
, size_t * lenp
)
772 int devnum
= ctl
->procname
[6] - '0';
773 struct arlan_private
*priv
;
775 if (devnum
< 0 || devnum
> MAX_ARLANS
- 1)
777 printk(KERN_WARNING
"too strange devnum in procfs parse\n ");
780 else if (arlan_device
[devnum
] != NULL
)
782 priv
= arlan_device
[devnum
]->priv
;
784 arlan_command(arlan_device
[devnum
], ARLAN_COMMAND_CLEAN_AND_CONF
);
790 return proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
793 int arlan_sysctl_reset(ctl_table
* ctl
, int write
, struct file
*filp
,
794 void *buffer
, size_t * lenp
)
797 int devnum
= ctl
->procname
[5] - '0';
798 struct arlan_private
*priv
;
800 if (devnum
< 0 || devnum
> MAX_ARLANS
- 1)
802 printk(KERN_WARNING
"too strange devnum in procfs parse\n ");
805 else if (arlan_device
[devnum
] != NULL
)
807 priv
= arlan_device
[devnum
]->priv
;
808 arlan_command(arlan_device
[devnum
], ARLAN_COMMAND_CLEAN_AND_RESET
);
813 return proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
817 /* Place files in /proc/sys/dev/arlan */
818 #define CTBLN(num,card,nam) \
819 {num , #nam, &(arlan_conf[card].nam), \
820 sizeof(int), 0600, NULL, &proc_dointvec}
821 #ifdef ARLAN_DEBUGING
823 #define ARLAN_PROC_DEBUG_ENTRIES {48, "entry_exit_debug", &arlan_entry_and_exit_debug, \
824 sizeof(int), 0600, NULL, &proc_dointvec},\
825 {49, "debug", &arlan_debug, \
826 sizeof(int), 0600, NULL, &proc_dointvec},
828 #define ARLAN_PROC_DEBUG_ENTRIES
831 #define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\
832 CTBLN(1,cardNo,spreadingCode),\
833 CTBLN(2,cardNo, channelNumber),\
834 CTBLN(3,cardNo, scramblingDisable),\
835 CTBLN(4,cardNo, txAttenuation),\
836 CTBLN(5,cardNo, systemId), \
837 CTBLN(6,cardNo, maxDatagramSize),\
838 CTBLN(7,cardNo, maxFrameSize),\
839 CTBLN(8,cardNo, maxRetries),\
840 CTBLN(9,cardNo, receiveMode),\
841 CTBLN(10,cardNo, priority),\
842 CTBLN(11,cardNo, rootOrRepeater),\
843 CTBLN(12,cardNo, SID),\
844 CTBLN(13,cardNo, registrationMode),\
845 CTBLN(14,cardNo, registrationFill),\
846 CTBLN(15,cardNo, localTalkAddress),\
847 CTBLN(16,cardNo, codeFormat),\
848 CTBLN(17,cardNo, numChannels),\
849 CTBLN(18,cardNo, channel1),\
850 CTBLN(19,cardNo, channel2),\
851 CTBLN(20,cardNo, channel3),\
852 CTBLN(21,cardNo, channel4),\
853 CTBLN(22,cardNo, txClear),\
854 CTBLN(23,cardNo, txRetries),\
855 CTBLN(24,cardNo, txRouting),\
856 CTBLN(25,cardNo, txScrambled),\
857 CTBLN(26,cardNo, rxParameter),\
858 CTBLN(27,cardNo, txTimeoutMs),\
859 CTBLN(28,cardNo, waitCardTimeout),\
860 CTBLN(29,cardNo, channelSet), \
861 {30, "name", arlan_conf[cardNo].siteName, \
862 16, 0600, NULL, &proc_dostring},\
863 CTBLN(31,cardNo,waitTime),\
864 CTBLN(32,cardNo,lParameter),\
865 CTBLN(33,cardNo,_15),\
866 CTBLN(34,cardNo,headerSize),\
867 CTBLN(35,cardNo,async),\
868 CTBLN(36,cardNo,tx_delay_ms),\
869 CTBLN(37,cardNo,retries),\
870 CTBLN(38,cardNo,ReTransmitPacketMaxSize),\
871 CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\
872 CTBLN(40,cardNo,fastReTransCount),\
873 CTBLN(41,cardNo,driverRetransmissions),\
874 CTBLN(42,cardNo,txAckTimeoutMs),\
875 CTBLN(43,cardNo,registrationInterrupts),\
876 CTBLN(44,cardNo,hardwareType),\
877 CTBLN(45,cardNo,radioType),\
878 CTBLN(46,cardNo,writeEEPROM),\
879 CTBLN(47,cardNo,writeRadioType),\
880 ARLAN_PROC_DEBUG_ENTRIES\
881 CTBLN(50,cardNo,in_speed),\
882 CTBLN(51,cardNo,out_speed),\
883 CTBLN(52,cardNo,in_speed10),\
884 CTBLN(53,cardNo,out_speed10),\
885 CTBLN(54,cardNo,in_speed_max),\
886 CTBLN(55,cardNo,out_speed_max),\
887 CTBLN(56,cardNo,measure_rate),\
888 CTBLN(57,cardNo,pre_Command_Wait),\
889 CTBLN(58,cardNo,rx_tweak1),\
890 CTBLN(59,cardNo,rx_tweak2),\
891 CTBLN(60,cardNo,tx_queue_len),\
895 static ctl_table arlan_conf_table0[] =
897 ARLAN_SYSCTL_TABLE_TOTAL(0)
899 #ifdef ARLAN_PROC_SHM_DUMP
900 {150, "arlan0-txRing", &arlan_drive_info
,
901 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
902 {151, "arlan0-rxRing", &arlan_drive_info
,
903 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
904 {152, "arlan0-18", &arlan_drive_info
,
905 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
906 {153, "arlan0-ring", &arlan_drive_info
,
907 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
908 {154, "arlan0-shm-cpy", &arlan_drive_info
,
909 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
911 {155, "config0", &conf_reset_result
, \
912 100, 0400, NULL
, &arlan_configure
}, \
913 {156, "reset0", &conf_reset_result
, \
914 100, 0400, NULL
, &arlan_sysctl_reset
}, \
918 static ctl_table arlan_conf_table1
[] =
921 ARLAN_SYSCTL_TABLE_TOTAL(1)
923 #ifdef ARLAN_PROC_SHM_DUMP
924 {150, "arlan1-txRing", &arlan_drive_info
,
925 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
926 {151, "arlan1-rxRing", &arlan_drive_info
,
927 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
928 {152, "arlan1-18", &arlan_drive_info
,
929 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
930 {153, "arlan1-ring", &arlan_drive_info
,
931 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
932 {154, "arlan1-shm-cpy", &arlan_drive_info
,
933 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
935 {155, "config1", &conf_reset_result
,
936 100, 0400, NULL
, &arlan_configure
},
937 {156, "reset1", &conf_reset_result
,
938 100, 0400, NULL
, &arlan_sysctl_reset
},
942 static ctl_table arlan_conf_table2
[] =
945 ARLAN_SYSCTL_TABLE_TOTAL(2)
947 #ifdef ARLAN_PROC_SHM_DUMP
948 {150, "arlan2-txRing", &arlan_drive_info
,
949 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
950 {151, "arlan2-rxRing", &arlan_drive_info
,
951 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
952 {152, "arlan2-18", &arlan_drive_info
,
953 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
954 {153, "arlan2-ring", &arlan_drive_info
,
955 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
956 {154, "arlan2-shm-cpy", &arlan_drive_info
,
957 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
959 {155, "config2", &conf_reset_result
,
960 100, 0400, NULL
, &arlan_configure
},
961 {156, "reset2", &conf_reset_result
,
962 100, 0400, NULL
, &arlan_sysctl_reset
},
966 static ctl_table arlan_conf_table3
[] =
969 ARLAN_SYSCTL_TABLE_TOTAL(3)
971 #ifdef ARLAN_PROC_SHM_DUMP
972 {150, "arlan3-txRing", &arlan_drive_info
,
973 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
974 {151, "arlan3-rxRing", &arlan_drive_info
,
975 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
976 {152, "arlan3-18", &arlan_drive_info
,
977 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
978 {153, "arlan3-ring", &arlan_drive_info
,
979 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
980 {154, "arlan3-shm-cpy", &arlan_drive_info
,
981 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
983 {155, "config3", &conf_reset_result
,
984 100, 0400, NULL
, &arlan_configure
},
985 {156, "reset3", &conf_reset_result
,
986 100, 0400, NULL
, &arlan_sysctl_reset
},
992 static ctl_table arlan_table
[] =
994 {0, "arlan0", NULL
, 0, 0600, arlan_conf_table0
},
995 {0, "arlan1", NULL
, 0, 0600, arlan_conf_table1
},
996 {0, "arlan2", NULL
, 0, 0600, arlan_conf_table2
},
997 {0, "arlan3", NULL
, 0, 0600, arlan_conf_table3
},
1003 static ctl_table arlan_table
[MAX_ARLANS
+ 1] =
1010 static ctl_table arlan_table
[MAX_ARLANS
+ 1] =
1017 // static int mmtu = 1234;
1019 static ctl_table arlan_root_table
[] =
1021 {254, "arlan", NULL
, 0, 0555, arlan_table
},
1025 /* Make sure that /proc/sys/dev is there */
1026 //static ctl_table arlan_device_root_table[] =
1028 // {CTL_DEV, "dev", NULL, 0, 0555, arlan_root_table},
1034 static struct ctl_table_header
*arlan_device_sysctl_header
= NULL
;
1036 int init_arlan_proc(void)
1040 if (arlan_device_sysctl_header
)
1042 for (i
= 0; i
< MAX_ARLANS
&& arlan_device
[i
]; i
++)
1043 arlan_table
[i
].ctl_name
= i
+ 1;
1044 arlan_device_sysctl_header
= register_sysctl_table(arlan_root_table
, 0);
1045 if (!arlan_device_sysctl_header
)
1056 int init_module(void)
1059 return init_arlan_proc();
1062 void cleanup_module(void)
1064 unregister_sysctl_table(arlan_device_sysctl_header
);
1065 arlan_device_sysctl_header
= NULL
;