1 #include <linux/config.h>
4 #include <linux/sysctl.h>
9 #include <linux/version.h>
11 /* void enableReceive(struct net_device* dev);
14 static int arlan_command(struct net_device
* dev
, int command
);
17 #define ARLAN_STR_SIZE 0x2ff0
18 #define DEV_ARLAN_INFO 1
20 #define SARLG(type,var) {\
21 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n", #var, READSHMB(priva->card->var)); \
24 #define SARLBN(type,var,nn) {\
25 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x",#var);\
26 for (i=0; i < nn; i++ ) pos += sprintf(arlan_drive_info+pos, "%02x",READSHMB(priva->card->var[i]));\
27 pos += sprintf(arlan_drive_info+pos, "\n"); \
30 #define SARLBNpln(type,var,nn) {\
31 for (i=0; i < nn; i++ ) pos += sprintf(arlan_drive_info+pos, "%02x",READSHMB(priva->card->var[i]));\
34 #define SARLSTR(var,nn) {\
37 if (nn > 399 ) tmpLn = 399; \
38 memcpy(tmpStr,(char *) priva->conf->var,tmpLn);\
40 pos += sprintf(arlan_drive_info+pos, "%s\t=\t%s \n",#var,priva->conf->var);\
43 #define SARLUC(var) SARLG(u_char, var)
44 #define SARLUCN(var,nn) SARLBN(u_char,var, nn)
45 #define SARLUS(var) SARLG(u_short, var)
46 #define SARLUSN(var,nn) SARLBN(u_short,var, nn)
47 #define SARLUI(var) SARLG(u_int, var)
49 #define SARLUSA(var) {\
51 memcpy(&tmpVar, (short *) priva->conf->var,2); \
52 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n",#var, tmpVar);\
55 #define SARLUIA(var) {\
57 memcpy(&tmpVar, (int* )priva->conf->var,4); \
58 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n",#var, tmpVar);\
62 const char *arlan_diagnostic_info_string(struct net_device
*dev
)
65 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
66 u_char diagnosticInfo
;
68 READSHM(diagnosticInfo
, arlan
->diagnosticInfo
, u_char
);
70 switch (diagnosticInfo
)
73 return "Diagnostic info is OK";
75 return "ERROR EPROM Checksum error ";
77 return "ERROR Local Ram Test Failed ";
79 return "ERROR SCC failure ";
81 return "ERROR BackBone failure ";
83 return "ERROR tranceiver not found ";
85 return "ERROR no more address space ";
87 return "ERROR Checksum error ";
89 return "ERROR Missing SS Code";
91 return "ERROR Invalid config format";
93 return "ERROR Reserved errorcode F5";
95 return "ERROR Invalid spreading code/channel number";
97 return "ERROR Load Code Error";
99 return "ERROR Reserver errorcode F2 ";
101 return "ERROR Invalid command receivec by LAN card ";
103 return "ERROR Invalid parameter found in command ";
105 return "ERROR On-chip timer failure ";
107 return "ERROR T410 timer failure ";
109 return "ERROR Too Many TxEnable commands ";
111 return "ERROR EEPROM error on radio module ";
113 return "ERROR unknown Diagnostic info reply code ";
117 static const char *arlan_hardware_type_string(struct net_device
*dev
)
120 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
122 READSHM(hardwareType
, arlan
->hardwareType
, u_char
);
123 switch (hardwareType
)
130 return "type TMA coproc";
132 return "type A650E ";
134 return "type TMA coproc Australian";
136 return "type A650A ";
138 return "type TMA coproc European";
142 return "type A655A ";
144 return "type A655E ";
148 return "type A670E ";
150 return "type A670A ";
154 return "type A411TA";
160 return "type A412TA";
162 return "type A411TE";
164 return "type A412TE";
166 return "type A671T ";
168 return "type A671TA ";
170 return "type A671TE ";
172 return "type A415T ";
174 return "type A415TA ";
176 return "type A415TE ";
180 return "type A672A ";
184 return "type IC2200";
190 static void arlan_print_diagnostic_info(struct net_device
*dev
)
193 u_char diagnosticInfo
;
194 u_short diagnosticOffset
;
196 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
198 // ARLAN_DEBUG_ENTRY("arlan_print_diagnostic_info");
200 if (READSHMB(arlan
->configuredStatusFlag
) == 0)
201 printk("Arlan: Card NOT configured\n");
203 printk("Arlan: Card is configured\n");
205 READSHM(diagnosticInfo
, arlan
->diagnosticInfo
, u_char
);
206 READSHM(diagnosticOffset
, arlan
->diagnosticOffset
, u_short
);
208 printk(KERN_INFO
"%s\n", arlan_diagnostic_info_string(dev
));
210 if (diagnosticInfo
!= 0xff)
211 printk("%s arlan: Diagnostic Offset %d \n", dev
->name
, diagnosticOffset
);
213 printk("arlan: LAN CODE ID = ");
214 for (i
= 0; i
< 6; i
++)
215 DEBUGSHM(1, "%03d:", arlan
->lanCardNodeId
[i
], u_char
);
218 printk("arlan: Arlan BroadCast address = ");
219 for (i
= 0; i
< 6; i
++)
220 DEBUGSHM(1, "%03d:", arlan
->broadcastAddress
[i
], u_char
);
223 READSHM(hardwareType
, arlan
->hardwareType
, u_char
);
224 printk(KERN_INFO
"%s\n", arlan_hardware_type_string(dev
));
227 DEBUGSHM(1, "arlan: channelNumber=%d\n", arlan
->channelNumber
, u_char
);
228 DEBUGSHM(1, "arlan: channelSet=%d\n", arlan
->channelSet
, u_char
);
229 DEBUGSHM(1, "arlan: spreadingCode=%d\n", arlan
->spreadingCode
, u_char
);
230 DEBUGSHM(1, "arlan: radioNodeId=%d\n", arlan
->radioNodeId
, u_short
);
231 DEBUGSHM(1, "arlan: SID =%d\n", arlan
->SID
, u_short
);
232 DEBUGSHM(1, "arlan: rxOffset=%d\n", arlan
->rxOffset
, u_short
);
234 DEBUGSHM(1, "arlan: registration mode is %d\n", arlan
->registrationMode
, u_char
);
236 printk("arlan: name= ");
239 for (i
= 0; i
< 16; i
++)
242 READSHM(c
, arlan
->name
[i
], char);
248 // ARLAN_DEBUG_EXIT("arlan_print_diagnostic_info");
253 /****************************** TEST MEMORY **************/
255 static int arlan_hw_test_memory(struct net_device
*dev
)
259 int memlen
= sizeof(struct arlan_shmem
) - 0xF; /* avoid control register */
260 volatile char *arlan_mem
= (char *) (dev
->mem_start
);
261 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
266 /* hold card in reset state */
267 setHardwareReset(dev
);
271 for (i
= 0; i
< memlen
; i
++)
272 WRITESHM(arlan_mem
[i
], ((u_char
) pattern
++), u_char
);
275 for (i
= 0; i
< memlen
; i
++)
278 READSHM(res
, arlan_mem
[i
], char);
279 if (res
!= pattern
++)
281 printk(KERN_ERR
"Arlan driver memory test 1 failed \n");
287 for (i
= 0; i
< memlen
; i
++)
288 WRITESHM(arlan_mem
[i
], ~(pattern
++), char);
291 for (i
= 0; i
< memlen
; i
++)
294 READSHM(res
, arlan_mem
[i
], char);
295 if (res
!= ~(pattern
++))
297 printk(KERN_ERR
"Arlan driver memory test 2 failed \n");
303 for (i
= 0; i
< memlen
; i
++)
304 WRITESHM(arlan_mem
[i
], 0x00, char);
306 IFDEBUG(1) printk(KERN_INFO
"Arlan: memory tests ok\n");
308 /* set reset flag and then release reset */
309 WRITESHM(arlan
->resetFlag
, 0xff, u_char
);
311 clearChannelAttention(dev
);
312 clearHardwareReset(dev
);
314 /* wait for reset flag to become zero, we'll wait for two seconds */
315 if (arlan_command(dev
, ARLAN_COMMAND_LONG_WAIT_NOW
))
317 printk(KERN_ERR
"%s arlan: failed to come back from memory test\n", dev
->name
);
324 static int arlan_setup_card_by_book(struct net_device
*dev
)
326 u_char irqLevel
, configuredStatusFlag
;
327 volatile struct arlan_shmem
*arlan
= ((struct arlan_private
*) dev
->priv
)->card
;
329 // ARLAN_DEBUG_ENTRY("arlan_setup_card");
331 READSHM(configuredStatusFlag
, arlan
->configuredStatusFlag
, u_char
);
334 if (configuredStatusFlag
!= 0)
335 IFDEBUG(10) printk("arlan: CARD IS CONFIGURED\n");
337 IFDEBUG(10) printk("arlan: card is NOT configured\n");
339 if (testMemory
|| (READSHMB(arlan
->diagnosticInfo
) != 0xff))
340 if (arlan_hw_test_memory(dev
))
343 DEBUGSHM(4, "arlan configuredStatus = %d \n", arlan
->configuredStatusFlag
, u_char
);
344 DEBUGSHM(4, "arlan driver diagnostic: 0x%2x\n", arlan
->diagnosticInfo
, u_char
);
346 /* issue nop command - no interupt */
347 arlan_command(dev
, ARLAN_COMMAND_NOOP
);
348 if (arlan_command(dev
, ARLAN_COMMAND_WAIT_NOW
) != 0)
351 IFDEBUG(50) printk("1st Noop successfully executed !!\n");
353 /* try to turn on the arlan interrupts */
354 clearClearInterrupt(dev
);
355 setClearInterrupt(dev
);
356 setInterruptEnable(dev
);
358 /* issue nop command - with interrupt */
360 arlan_command(dev
, ARLAN_COMMAND_NOOPINT
);
361 if (arlan_command(dev
, ARLAN_COMMAND_WAIT_NOW
) != 0)
365 IFDEBUG(50) printk("2nd Noop successfully executed !!\n");
367 READSHM(irqLevel
, arlan
->irqLevel
, u_char
)
369 if (irqLevel
!= dev
->irq
)
371 IFDEBUG(1) printk(KERN_WARNING
"arlan dip switches set irq to %d\n", irqLevel
);
372 printk(KERN_WARNING
"device driver irq set to %d - does not match\n", dev
->irq
);
376 IFDEBUG(2) printk("irq level is OK\n");
379 IFDEBUG(3) arlan_print_diagnostic_info(dev
);
381 arlan_command(dev
, ARLAN_COMMAND_CONF
);
383 READSHM(configuredStatusFlag
, arlan
->configuredStatusFlag
, u_char
);
384 if (configuredStatusFlag
== 0)
386 printk(KERN_WARNING
"arlan configure failed\n");
389 arlan_command(dev
, ARLAN_COMMAND_LONG_WAIT_NOW
);
390 arlan_command(dev
, ARLAN_COMMAND_RX
);
391 arlan_command(dev
, ARLAN_COMMAND_LONG_WAIT_NOW
);
392 printk(KERN_NOTICE
"%s: arlan driver version %s loaded\n",
393 dev
->name
, arlan_version
);
395 // ARLAN_DEBUG_EXIT("arlan_setup_card");
397 return 0; /* no errors */
401 #ifdef ARLAN_PROC_INTERFACE
402 #ifdef ARLAN_PROC_SHM_DUMP
404 static char arlan_drive_info
[ARLAN_STR_SIZE
] = "A655\n\0";
406 static int arlan_sysctl_info(ctl_table
* ctl
, int write
, struct file
*filp
,
407 void *buffer
, size_t * lenp
)
410 int retv
, pos
, devnum
;
411 struct arlan_private
*priva
= NULL
;
412 struct net_device
*dev
;
417 for (i
= 0; i
< 100; i
++)
418 printk("adi %x \n", arlan_drive_info
[i
]);
420 if (ctl
->procname
== NULL
|| arlan_drive_info
== NULL
)
422 printk(KERN_WARNING
" procname is NULL in sysctl_table or arlan_drive_info is NULL \n at arlan module\n ");
425 devnum
= ctl
->procname
[5] - '0';
426 if (devnum
< 0 || devnum
> MAX_ARLANS
- 1)
428 printk(KERN_WARNING
"too strange devnum in procfs parse\n ");
431 else if (arlan_device
[devnum
] == NULL
)
434 pos
+= sprintf(arlan_drive_info
+ pos
, "\t%s\n\n", ctl
->procname
);
435 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
439 priva
= arlan_device
[devnum
]->priv
;
443 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
446 dev
= arlan_device
[devnum
];
448 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
450 pos
= sprintf(arlan_drive_info
, "Arlan info \n");
451 /* Header Signature */
452 SARLSTR(textRegion
, 48);
454 pos
+= sprintf(arlan_drive_info
+ pos
, "diagnosticInfo\t=\t%s \n", arlan_diagnostic_info_string(dev
));
455 SARLUC(diagnosticInfo
);
456 SARLUS(diagnosticOffset
);
458 SARLUCN(lanCardNodeId
, 6);
459 SARLUCN(broadcastAddress
, 6);
460 pos
+= sprintf(arlan_drive_info
+ pos
, "hardwareType =\t %s \n", arlan_hardware_type_string(dev
));
461 SARLUC(hardwareType
);
462 SARLUC(majorHardwareVersion
);
463 SARLUC(minorHardwareVersion
);
465 SARLUC(defaultChannelSet
);
468 /* Control/Status Block - 0x0080 */
469 SARLUC(interruptInProgress
);
470 SARLUC(cntrlRegImage
);
474 SARLUCN(commandParameter
, 15);
476 /* Receive Status - 0x00a0 */
482 SARLUC(rxBroadcastFlag
);
487 /* Transmit Status - 0x00b0 */
489 SARLUC(txAckQuality
);
492 SARLUCN(registeredRouter
, 6);
493 SARLUCN(backboneRouter
, 6);
494 SARLUC(registrationStatus
);
495 SARLUC(configuredStatusFlag
);
497 SARLUCN(ultimateDestAddress
, 6);
498 SARLUCN(immedDestAddress
, 6);
499 SARLUCN(immedSrcAddress
, 6);
500 SARLUS(rxSequenceNumber
);
501 SARLUC(assignedLocaltalkAddress
);
504 /* System Parameter Block */
506 /* - Driver Parameters (Novell Specific) */
509 SARLUS(transportTime
);
512 /* - Configuration Parameters */
514 SARLUC(spreadingCode
);
516 SARLUC(channelNumber
);
519 SARLUC(scramblingDisable
);
523 SARLUC(txAttenuation
);
525 SARLUS(globalChecksum
);
527 SARLUS(maxDatagramSize
);
528 SARLUS(maxFrameSize
);
532 SARLUC(rootOrRepeater
);
533 SARLUCN(specifiedRouter
, 6);
534 SARLUS(fastPollPeriod
);
536 SARLUSA(fastPollDelay
);
537 SARLUC(arlThreshold
);
540 SARLUS(specRouterTimeout
);
545 SARLUCN(encryptionKey
, 12);
551 SARLUS(sectionChecksum
);
553 SARLUC(registrationMode
);
554 SARLUC(registrationFill
);
556 SARLUS(refreshPeriod
);
559 SARLUC(localTalkAddress
);
568 /* SARLUCN( _16, 0x140);
570 /* Statistics Block - 0x0300 */
573 SARLUCN(resetTime
, 18);
574 SARLUIA(numDatagramsTransmitted
);
575 SARLUIA(numReTransmissions
);
576 SARLUIA(numFramesDiscarded
);
577 SARLUIA(numDatagramsReceived
);
578 SARLUIA(numDuplicateReceivedFrames
);
579 SARLUIA(numDatagramsDiscarded
);
580 SARLUS(maxNumReTransmitDatagram
);
581 SARLUS(maxNumReTransmitFrames
);
582 SARLUS(maxNumConsecutiveDuplicateFrames
);
583 /* misaligned here so we have to go to characters */
584 SARLUIA(numBytesTransmitted
);
585 SARLUIA(numBytesReceived
);
586 SARLUIA(numCRCErrors
);
587 SARLUIA(numLengthErrors
);
588 SARLUIA(numAbortErrors
);
589 SARLUIA(numTXUnderruns
);
590 SARLUIA(numRXOverruns
);
591 SARLUIA(numHoldOffs
);
592 SARLUIA(numFramesTransmitted
);
593 SARLUIA(numFramesReceived
);
594 SARLUIA(numReceiveFramesLost
);
595 SARLUIA(numRXBufferOverflows
);
596 SARLUIA(numFramesDiscardedAddrMismatch
);
597 SARLUIA(numFramesDiscardedSIDMismatch
);
598 SARLUIA(numPollsTransmistted
);
599 SARLUIA(numPollAcknowledges
);
600 SARLUIA(numStatusTimeouts
);
601 SARLUIA(numNACKReceived
);
607 /* next 4 seems too long for procfs, over single page ?
609 SARLUCN( txBuffer, 0x800);
610 SARLUCN( rxBuffer, 0x800);
611 SARLUCN( _18, 0x0bff);
614 pos
+= sprintf(arlan_drive_info
+ pos
, "rxRing\t=\t0x");
615 for (i
= 0; i
< 0x50; i
++)
616 pos
+= sprintf(arlan_drive_info
+ pos
, "%02x", ((char *) priva
->conf
)[priva
->conf
->rxOffset
+ i
]);
617 pos
+= sprintf(arlan_drive_info
+ pos
, "\n");
619 SARLUC(configStatus
);
623 SARLUC(controlRegister
);
625 pos
+= sprintf(arlan_drive_info
+ pos
, " total %d chars\n", pos
);
628 pos
+= sprintf(arlan_drive_info
+ pos
, " driver name : %s\n", ctl
->procname
);
633 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
643 static int arlan_sysctl_info161719(ctl_table
* ctl
, int write
, struct file
*filp
,
644 void *buffer
, size_t * lenp
)
647 int retv
, pos
, devnum
;
648 struct arlan_private
*priva
= NULL
;
651 devnum
= ctl
->procname
[5] - '0';
652 if (arlan_device
[devnum
] == NULL
)
654 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
658 priva
= arlan_device
[devnum
]->priv
;
661 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
664 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
673 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
677 static int arlan_sysctl_infotxRing(ctl_table
* ctl
, int write
, struct file
*filp
,
678 void *buffer
, size_t * lenp
)
681 int retv
, pos
, devnum
;
682 struct arlan_private
*priva
= NULL
;
685 devnum
= ctl
->procname
[5] - '0';
686 if (arlan_device
[devnum
] == NULL
)
688 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
692 priva
= arlan_device
[devnum
]->priv
;
695 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
698 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
699 SARLBNpln(u_char
, txBuffer
, 0x800);
702 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
706 static int arlan_sysctl_inforxRing(ctl_table
* ctl
, int write
, struct file
*filp
,
707 void *buffer
, size_t * lenp
)
710 int retv
, pos
, devnum
;
711 struct arlan_private
*priva
= NULL
;
714 devnum
= ctl
->procname
[5] - '0';
715 if (arlan_device
[devnum
] == NULL
)
717 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
720 priva
= arlan_device
[devnum
]->priv
;
723 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
726 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
727 SARLBNpln(u_char
, rxBuffer
, 0x800);
730 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
734 static int arlan_sysctl_info18(ctl_table
* ctl
, int write
, struct file
*filp
,
735 void *buffer
, size_t * lenp
)
738 int retv
, pos
, devnum
;
739 struct arlan_private
*priva
= NULL
;
742 devnum
= ctl
->procname
[5] - '0';
743 if (arlan_device
[devnum
] == NULL
)
745 pos
+= sprintf(arlan_drive_info
+ pos
, "No device found here \n");
749 priva
= arlan_device
[devnum
]->priv
;
752 printk(KERN_WARNING
" Could not find the device private in arlan procsys, bad\n ");
755 memcpy_fromio(priva
->conf
, priva
->card
, sizeof(struct arlan_shmem
));
756 SARLBNpln(u_char
, _18
, 0x800);
760 retv
= proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
765 #endif /* #ifdef ARLAN_PROC_SHM_DUMP */
768 static char conf_reset_result
[200];
770 static int arlan_configure(ctl_table
* ctl
, int write
, struct file
*filp
,
771 void *buffer
, size_t * lenp
)
774 int devnum
= ctl
->procname
[6] - '0';
775 struct arlan_private
*priv
;
777 if (devnum
< 0 || devnum
> MAX_ARLANS
- 1)
779 printk(KERN_WARNING
"too strange devnum in procfs parse\n ");
782 else if (arlan_device
[devnum
] != NULL
)
784 priv
= arlan_device
[devnum
]->priv
;
786 arlan_command(arlan_device
[devnum
], ARLAN_COMMAND_CLEAN_AND_CONF
);
792 return proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
795 int arlan_sysctl_reset(ctl_table
* ctl
, int write
, struct file
*filp
,
796 void *buffer
, size_t * lenp
)
799 int devnum
= ctl
->procname
[5] - '0';
800 struct arlan_private
*priv
;
802 if (devnum
< 0 || devnum
> MAX_ARLANS
- 1)
804 printk(KERN_WARNING
"too strange devnum in procfs parse\n ");
807 else if (arlan_device
[devnum
] != NULL
)
809 priv
= arlan_device
[devnum
]->priv
;
810 arlan_command(arlan_device
[devnum
], ARLAN_COMMAND_CLEAN_AND_RESET
);
815 return proc_dostring(ctl
, write
, filp
, buffer
, lenp
);
819 /* Place files in /proc/sys/dev/arlan */
820 #define CTBLN(num,card,nam) \
821 {num , #nam, &(arlan_conf[card].nam), \
822 sizeof(int), 0600, NULL, &proc_dointvec}
825 #define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\
826 CTBLN(1,cardNo,spreadingCode),\
827 CTBLN(2,cardNo, channelNumber),\
828 CTBLN(3,cardNo, scramblingDisable),\
829 CTBLN(4,cardNo, txAttenuation),\
830 CTBLN(5,cardNo, systemId), \
831 CTBLN(6,cardNo, maxDatagramSize),\
832 CTBLN(7,cardNo, maxFrameSize),\
833 CTBLN(8,cardNo, maxRetries),\
834 CTBLN(9,cardNo, receiveMode),\
835 CTBLN(10,cardNo, priority),\
836 CTBLN(11,cardNo, rootOrRepeater),\
837 CTBLN(12,cardNo, SID),\
838 CTBLN(13,cardNo, registrationMode),\
839 CTBLN(14,cardNo, registrationFill),\
840 CTBLN(15,cardNo, localTalkAddress),\
841 CTBLN(16,cardNo, codeFormat),\
842 CTBLN(17,cardNo, numChannels),\
843 CTBLN(18,cardNo, channel1),\
844 CTBLN(19,cardNo, channel2),\
845 CTBLN(20,cardNo, channel3),\
846 CTBLN(21,cardNo, channel4),\
847 CTBLN(22,cardNo, txClear),\
848 CTBLN(23,cardNo, txRetries),\
849 CTBLN(24,cardNo, txRouting),\
850 CTBLN(25,cardNo, txScrambled),\
851 CTBLN(26,cardNo, rxParameter),\
852 CTBLN(27,cardNo, txTimeoutMs),\
853 CTBLN(28,cardNo, waitCardTimeout),\
854 CTBLN(29,cardNo, channelSet), \
855 {30, "name", arlan_conf[cardNo].siteName, \
856 16, 0600, NULL, &proc_dostring},\
857 CTBLN(31,cardNo,waitTime),\
858 CTBLN(32,cardNo,lParameter),\
859 CTBLN(33,cardNo,_15),\
860 CTBLN(34,cardNo,headerSize),\
861 CTBLN(35,cardNo,async),\
862 CTBLN(36,cardNo,tx_delay_ms),\
863 CTBLN(37,cardNo,retries),\
864 CTBLN(38,cardNo,ReTransmitPacketMaxSize),\
865 CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\
866 CTBLN(40,cardNo,fastReTransCount),\
867 CTBLN(41,cardNo,driverRetransmissions),\
868 CTBLN(42,cardNo,txAckTimeoutMs),\
869 CTBLN(43,cardNo,registrationInterrupts),\
870 CTBLN(44,cardNo,hardwareType),\
871 CTBLN(45,cardNo,radioType),\
872 CTBLN(46,cardNo,writeEEPROM),\
873 CTBLN(47,cardNo,writeRadioType),\
874 {48, "entry_exit_debug", &arlan_entry_and_exit_debug, \
875 sizeof(int), 0600, NULL, &proc_dointvec},\
876 {49, "debug", &arlan_debug, \
877 sizeof(int), 0600, NULL, &proc_dointvec},\
878 CTBLN(50,cardNo,in_speed),\
879 CTBLN(51,cardNo,out_speed),\
880 CTBLN(52,cardNo,in_speed10),\
881 CTBLN(53,cardNo,out_speed10),\
882 CTBLN(54,cardNo,in_speed_max),\
883 CTBLN(55,cardNo,out_speed_max),\
884 CTBLN(56,cardNo,measure_rate),\
885 CTBLN(57,cardNo,pre_Command_Wait),\
886 CTBLN(58,cardNo,rx_tweak1),\
887 CTBLN(59,cardNo,rx_tweak2),\
888 CTBLN(60,cardNo,tx_queue_len),\
892 static ctl_table arlan_conf_table0[] =
894 ARLAN_SYSCTL_TABLE_TOTAL(0)
896 #ifdef ARLAN_PROC_SHM_DUMP
897 {150, "arlan0-txRing", &arlan_drive_info
,
898 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
899 {151, "arlan0-rxRing", &arlan_drive_info
,
900 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
901 {152, "arlan0-18", &arlan_drive_info
,
902 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
903 {153, "arlan0-ring", &arlan_drive_info
,
904 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
905 {154, "arlan0-shm-cpy", &arlan_drive_info
,
906 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
908 {155, "config0", &conf_reset_result
, \
909 100, 0400, NULL
, &arlan_configure
}, \
910 {156, "reset0", &conf_reset_result
, \
911 100, 0400, NULL
, &arlan_sysctl_reset
}, \
915 static ctl_table arlan_conf_table1
[] =
918 ARLAN_SYSCTL_TABLE_TOTAL(1)
920 #ifdef ARLAN_PROC_SHM_DUMP
921 {150, "arlan1-txRing", &arlan_drive_info
,
922 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
923 {151, "arlan1-rxRing", &arlan_drive_info
,
924 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
925 {152, "arlan1-18", &arlan_drive_info
,
926 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
927 {153, "arlan1-ring", &arlan_drive_info
,
928 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
929 {154, "arlan1-shm-cpy", &arlan_drive_info
,
930 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
932 {155, "config1", &conf_reset_result
,
933 100, 0400, NULL
, &arlan_configure
},
934 {156, "reset1", &conf_reset_result
,
935 100, 0400, NULL
, &arlan_sysctl_reset
},
939 static ctl_table arlan_conf_table2
[] =
942 ARLAN_SYSCTL_TABLE_TOTAL(2)
944 #ifdef ARLAN_PROC_SHM_DUMP
945 {150, "arlan2-txRing", &arlan_drive_info
,
946 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
947 {151, "arlan2-rxRing", &arlan_drive_info
,
948 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
949 {152, "arlan2-18", &arlan_drive_info
,
950 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
951 {153, "arlan2-ring", &arlan_drive_info
,
952 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
953 {154, "arlan2-shm-cpy", &arlan_drive_info
,
954 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
956 {155, "config2", &conf_reset_result
,
957 100, 0400, NULL
, &arlan_configure
},
958 {156, "reset2", &conf_reset_result
,
959 100, 0400, NULL
, &arlan_sysctl_reset
},
963 static ctl_table arlan_conf_table3
[] =
966 ARLAN_SYSCTL_TABLE_TOTAL(3)
968 #ifdef ARLAN_PROC_SHM_DUMP
969 {150, "arlan3-txRing", &arlan_drive_info
,
970 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_infotxRing
},
971 {151, "arlan3-rxRing", &arlan_drive_info
,
972 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_inforxRing
},
973 {152, "arlan3-18", &arlan_drive_info
,
974 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info18
},
975 {153, "arlan3-ring", &arlan_drive_info
,
976 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info161719
},
977 {154, "arlan3-shm-cpy", &arlan_drive_info
,
978 ARLAN_STR_SIZE
, 0400, NULL
, &arlan_sysctl_info
},
980 {155, "config3", &conf_reset_result
,
981 100, 0400, NULL
, &arlan_configure
},
982 {156, "reset3", &conf_reset_result
,
983 100, 0400, NULL
, &arlan_sysctl_reset
},
989 static ctl_table arlan_table
[] =
991 {0, "arlan0", NULL
, 0, 0600, arlan_conf_table0
},
992 {0, "arlan1", NULL
, 0, 0600, arlan_conf_table1
},
993 {0, "arlan2", NULL
, 0, 0600, arlan_conf_table2
},
994 {0, "arlan3", NULL
, 0, 0600, arlan_conf_table3
},
1000 static ctl_table arlan_table
[MAX_ARLANS
+ 1] =
1007 static ctl_table arlan_table
[MAX_ARLANS
+ 1] =
1013 static int mmtu
= 1234;
1015 static ctl_table arlan_root_table
[] =
1017 {254, "arlan", NULL
, 0, 0555, arlan_table
},
1021 /* Make sure that /proc/sys/dev is there */
1022 static ctl_table arlan_device_root_table
[] =
1024 {CTL_DEV
, "dev", NULL
, 0, 0555, arlan_root_table
},
1030 static struct ctl_table_header
*arlan_device_sysctl_header
= NULL
;
1032 int init_arlan_proc(void)
1036 if (arlan_device_sysctl_header
)
1038 for (i
= 0; i
< MAX_ARLANS
&& arlan_device
[i
]; i
++)
1039 arlan_table
[i
].ctl_name
= i
+ 1;
1040 arlan_device_sysctl_header
= register_sysctl_table(arlan_root_table
, 0);
1041 if (!arlan_device_sysctl_header
)
1052 int init_module(void)
1055 return init_arlan_proc();
1058 void cleanup_module(void)
1060 unregister_sysctl_table(arlan_device_sysctl_header
);
1061 arlan_device_sysctl_header
= NULL
;