1 #include <linux/config.h>
4 #include <linux/sysctl.h>
8 /* void enableReceive(struct net_device* dev);
13 #define ARLAN_STR_SIZE 0x2ff0
14 #define DEV_ARLAN_INFO 1
16 #define SARLG(type,var) {\
17 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n", #var, READSHMB(priva->card->var)); \
20 #define SARLBN(type,var,nn) {\
21 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x",#var);\
22 for (i=0; i < nn; i++ ) pos += sprintf(arlan_drive_info+pos, "%02x",READSHMB(priva->card->var[i]));\
23 pos += sprintf(arlan_drive_info+pos, "\n"); \
26 #define SARLBNpln(type,var,nn) {\
27 for (i=0; i < nn; i++ ) pos += sprintf(arlan_drive_info+pos, "%02x",READSHMB(priva->card->var[i]));\
30 #define SARLSTR(var,nn) {\
33 if (nn > 399 ) tmpLn = 399; \
34 memcpy(tmpStr,(char *) priva->conf->var,tmpLn);\
36 pos += sprintf(arlan_drive_info+pos, "%s\t=\t%s \n",#var,priva->conf->var);\
39 #define SARLUC(var) SARLG(u_char, var)
40 #define SARLUCN(var,nn) SARLBN(u_char,var, nn)
41 #define SARLUS(var) SARLG(u_short, var)
42 #define SARLUSN(var,nn) SARLBN(u_short,var, nn)
43 #define SARLUI(var) SARLG(u_int, var)
45 #define SARLUSA(var) {\
47 memcpy(&tmpVar, (short *) priva->conf->var,2); \
48 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n",#var, tmpVar);\
51 #define SARLUIA(var) {\
53 memcpy(&tmpVar, (int* )priva->conf->var,4); \
54 pos += sprintf(arlan_drive_info+pos, "%s\t=\t0x%x\n",#var, tmpVar);\
58 static const char *arlan_diagnostic_info_string(struct net_device *dev)
61 volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card;
62 u_char diagnosticInfo;
64 READSHM(diagnosticInfo, arlan->diagnosticInfo, u_char);
66 switch (diagnosticInfo)
69 return "Diagnostic info is OK";
71 return "ERROR EPROM Checksum error ";
73 return "ERROR Local Ram Test Failed ";
75 return "ERROR SCC failure ";
77 return "ERROR BackBone failure ";
79 return "ERROR transceiver not found ";
81 return "ERROR no more address space ";
83 return "ERROR Checksum error ";
85 return "ERROR Missing SS Code";
87 return "ERROR Invalid config format";
89 return "ERROR Reserved errorcode F5";
91 return "ERROR Invalid spreading code/channel number";
93 return "ERROR Load Code Error";
95 return "ERROR Reserver errorcode F2 ";
97 return "ERROR Invalid command receivec by LAN card ";
99 return "ERROR Invalid parameter found in command ";
101 return "ERROR On-chip timer failure ";
103 return "ERROR T410 timer failure ";
105 return "ERROR Too Many TxEnable commands ";
107 return "ERROR EEPROM error on radio module ";
109 return "ERROR unknown Diagnostic info reply code ";
113 static const char *arlan_hardware_type_string(struct net_device *dev)
116 volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card;
118 READSHM(hardwareType, arlan->hardwareType, u_char);
119 switch (hardwareType)
126 return "type TMA coproc";
128 return "type A650E ";
130 return "type TMA coproc Australian";
132 return "type A650A ";
134 return "type TMA coproc European";
138 return "type A655A ";
140 return "type A655E ";
144 return "type A670E ";
146 return "type A670A ";
150 return "type A411TA";
156 return "type A412TA";
158 return "type A411TE";
160 return "type A412TE";
162 return "type A671T ";
164 return "type A671TA ";
166 return "type A671TE ";
168 return "type A415T ";
170 return "type A415TA ";
172 return "type A415TE ";
176 return "type A672A ";
180 return "type IC2200";
185 #ifdef ARLAN_DEBUGGING
186 static void arlan_print_diagnostic_info(struct net_device *dev)
189 u_char diagnosticInfo;
190 u_short diagnosticOffset;
192 volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card;
194 // ARLAN_DEBUG_ENTRY("arlan_print_diagnostic_info");
196 if (READSHMB(arlan->configuredStatusFlag) == 0)
197 printk("Arlan: Card NOT configured\n");
199 printk("Arlan: Card is configured\n");
201 READSHM(diagnosticInfo, arlan->diagnosticInfo, u_char);
202 READSHM(diagnosticOffset, arlan->diagnosticOffset, u_short);
204 printk(KERN_INFO "%s\n", arlan_diagnostic_info_string(dev));
206 if (diagnosticInfo != 0xff)
207 printk("%s arlan: Diagnostic Offset %d \n", dev->name, diagnosticOffset);
209 printk("arlan: LAN CODE ID = ");
210 for (i = 0; i < 6; i++)
211 DEBUGSHM(1, "%03d:", arlan->lanCardNodeId[i], u_char);
214 printk("arlan: Arlan BroadCast address = ");
215 for (i = 0; i < 6; i++)
216 DEBUGSHM(1, "%03d:", arlan->broadcastAddress[i], u_char);
219 READSHM(hardwareType, arlan->hardwareType, u_char);
220 printk(KERN_INFO "%s\n", arlan_hardware_type_string(dev));
223 DEBUGSHM(1, "arlan: channelNumber=%d\n", arlan->channelNumber, u_char);
224 DEBUGSHM(1, "arlan: channelSet=%d\n", arlan->channelSet, u_char);
225 DEBUGSHM(1, "arlan: spreadingCode=%d\n", arlan->spreadingCode, u_char);
226 DEBUGSHM(1, "arlan: radioNodeId=%d\n", arlan->radioNodeId, u_short);
227 DEBUGSHM(1, "arlan: SID =%d\n", arlan->SID, u_short);
228 DEBUGSHM(1, "arlan: rxOffset=%d\n", arlan->rxOffset, u_short);
230 DEBUGSHM(1, "arlan: registration mode is %d\n", arlan->registrationMode, u_char);
232 printk("arlan: name= ");
235 for (i = 0; i < 16; i++)
238 READSHM(c, arlan->name[i], char);
244 // ARLAN_DEBUG_EXIT("arlan_print_diagnostic_info");
249 /****************************** TEST MEMORY **************/
251 static int arlan_hw_test_memory(struct net_device *dev)
255 int memlen = sizeof(struct arlan_shmem) - 0xF; /* avoid control register */
256 volatile char *arlan_mem = (char *) (dev->mem_start);
257 volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card;
262 /* hold card in reset state */
263 setHardwareReset(dev);
267 for (i = 0; i < memlen; i++)
268 WRITESHM(arlan_mem[i], ((u_char) pattern++), u_char);
271 for (i = 0; i < memlen; i++)
274 READSHM(res, arlan_mem[i], char);
275 if (res != pattern++)
277 printk(KERN_ERR "Arlan driver memory test 1 failed \n");
283 for (i = 0; i < memlen; i++)
284 WRITESHM(arlan_mem[i], ~(pattern++), char);
287 for (i = 0; i < memlen; i++)
290 READSHM(res, arlan_mem[i], char);
291 if (res != ~(pattern++))
293 printk(KERN_ERR "Arlan driver memory test 2 failed \n");
299 for (i = 0; i < memlen; i++)
300 WRITESHM(arlan_mem[i], 0x00, char);
302 IFDEBUG(1) printk(KERN_INFO "Arlan: memory tests ok\n");
304 /* set reset flag and then release reset */
305 WRITESHM(arlan->resetFlag, 0xff, u_char);
307 clearChannelAttention(dev);
308 clearHardwareReset(dev);
310 /* wait for reset flag to become zero, we'll wait for two seconds */
311 if (arlan_command(dev, ARLAN_COMMAND_LONG_WAIT_NOW))
313 printk(KERN_ERR "%s arlan: failed to come back from memory test\n", dev->name);
319 static int arlan_setup_card_by_book(struct net_device *dev)
321 u_char irqLevel, configuredStatusFlag;
322 volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card;
324 // ARLAN_DEBUG_ENTRY("arlan_setup_card");
326 READSHM(configuredStatusFlag, arlan->configuredStatusFlag, u_char);
329 if (configuredStatusFlag != 0)
330 IFDEBUG(10) printk("arlan: CARD IS CONFIGURED\n");
332 IFDEBUG(10) printk("arlan: card is NOT configured\n");
334 if (testMemory || (READSHMB(arlan->diagnosticInfo) != 0xff))
335 if (arlan_hw_test_memory(dev))
338 DEBUGSHM(4, "arlan configuredStatus = %d \n", arlan->configuredStatusFlag, u_char);
339 DEBUGSHM(4, "arlan driver diagnostic: 0x%2x\n", arlan->diagnosticInfo, u_char);
341 /* issue nop command - no interrupt */
342 arlan_command(dev, ARLAN_COMMAND_NOOP);
343 if (arlan_command(dev, ARLAN_COMMAND_WAIT_NOW) != 0)
346 IFDEBUG(50) printk("1st Noop successfully executed !!\n");
348 /* try to turn on the arlan interrupts */
349 clearClearInterrupt(dev);
350 setClearInterrupt(dev);
351 setInterruptEnable(dev);
353 /* issue nop command - with interrupt */
355 arlan_command(dev, ARLAN_COMMAND_NOOPINT);
356 if (arlan_command(dev, ARLAN_COMMAND_WAIT_NOW) != 0)
360 IFDEBUG(50) printk("2nd Noop successfully executed !!\n");
362 READSHM(irqLevel, arlan->irqLevel, u_char)
364 if (irqLevel != dev->irq)
366 IFDEBUG(1) printk(KERN_WARNING "arlan dip switches set irq to %d\n", irqLevel);
367 printk(KERN_WARNING "device driver irq set to %d - does not match\n", dev->irq);
371 IFDEBUG(2) printk("irq level is OK\n");
374 IFDEBUG(3) arlan_print_diagnostic_info(dev);
376 arlan_command(dev, ARLAN_COMMAND_CONF);
378 READSHM(configuredStatusFlag, arlan->configuredStatusFlag, u_char);
379 if (configuredStatusFlag == 0)
381 printk(KERN_WARNING "arlan configure failed\n");
384 arlan_command(dev, ARLAN_COMMAND_LONG_WAIT_NOW);
385 arlan_command(dev, ARLAN_COMMAND_RX);
386 arlan_command(dev, ARLAN_COMMAND_LONG_WAIT_NOW);
387 printk(KERN_NOTICE "%s: arlan driver version %s loaded\n",
388 dev->name, arlan_version);
390 // ARLAN_DEBUG_EXIT("arlan_setup_card");
392 return 0; /* no errors */
396 #ifdef ARLAN_PROC_INTERFACE
397 #ifdef ARLAN_PROC_SHM_DUMP
399 static char arlan_drive_info[ARLAN_STR_SIZE] = "A655\n\0";
401 static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp,
402 void *buffer, size_t * lenp)
405 int retv, pos, devnum;
406 struct arlan_private *priva = NULL;
407 struct net_device *dev;
412 for (i = 0; i < 100; i++)
413 printk("adi %x \n", arlan_drive_info[i]);
415 if (ctl->procname == NULL || arlan_drive_info == NULL)
417 printk(KERN_WARNING " procname is NULL in sysctl_table or arlan_drive_info is NULL \n at arlan module\n ");
420 devnum = ctl->procname[5] - '0';
421 if (devnum < 0 || devnum > MAX_ARLANS - 1)
423 printk(KERN_WARNING "too strange devnum in procfs parse\n ");
426 else if (arlan_device[devnum] == NULL)
429 pos += sprintf(arlan_drive_info + pos, "\t%s\n\n", ctl->procname);
430 pos += sprintf(arlan_drive_info + pos, "No device found here \n");
434 priva = arlan_device[devnum]->priv;
438 printk(KERN_WARNING " Could not find the device private in arlan procsys, bad\n ");
441 dev = arlan_device[devnum];
443 memcpy_fromio(priva->conf, priva->card, sizeof(struct arlan_shmem));
445 pos = sprintf(arlan_drive_info, "Arlan info \n");
446 /* Header Signature */
447 SARLSTR(textRegion, 48);
449 pos += sprintf(arlan_drive_info + pos, "diagnosticInfo\t=\t%s \n", arlan_diagnostic_info_string(dev));
450 SARLUC(diagnosticInfo);
451 SARLUS(diagnosticOffset);
453 SARLUCN(lanCardNodeId, 6);
454 SARLUCN(broadcastAddress, 6);
455 pos += sprintf(arlan_drive_info + pos, "hardwareType =\t %s \n", arlan_hardware_type_string(dev));
456 SARLUC(hardwareType);
457 SARLUC(majorHardwareVersion);
458 SARLUC(minorHardwareVersion);
460 SARLUC(defaultChannelSet);
463 /* Control/Status Block - 0x0080 */
464 SARLUC(interruptInProgress);
465 SARLUC(cntrlRegImage);
469 SARLUCN(commandParameter, 15);
471 /* Receive Status - 0x00a0 */
477 SARLUC(rxBroadcastFlag);
482 /* Transmit Status - 0x00b0 */
484 SARLUC(txAckQuality);
487 SARLUCN(registeredRouter, 6);
488 SARLUCN(backboneRouter, 6);
489 SARLUC(registrationStatus);
490 SARLUC(configuredStatusFlag);
492 SARLUCN(ultimateDestAddress, 6);
493 SARLUCN(immedDestAddress, 6);
494 SARLUCN(immedSrcAddress, 6);
495 SARLUS(rxSequenceNumber);
496 SARLUC(assignedLocaltalkAddress);
499 /* System Parameter Block */
501 /* - Driver Parameters (Novell Specific) */
504 SARLUS(transportTime);
507 /* - Configuration Parameters */
509 SARLUC(spreadingCode);
511 SARLUC(channelNumber);
514 SARLUC(scramblingDisable);
518 SARLUC(txAttenuation);
520 SARLUS(globalChecksum);
522 SARLUS(maxDatagramSize);
523 SARLUS(maxFrameSize);
527 SARLUC(rootOrRepeater);
528 SARLUCN(specifiedRouter, 6);
529 SARLUS(fastPollPeriod);
531 SARLUSA(fastPollDelay);
532 SARLUC(arlThreshold);
535 SARLUS(specRouterTimeout);
540 SARLUCN(encryptionKey, 12);
546 SARLUS(sectionChecksum);
548 SARLUC(registrationMode);
549 SARLUC(registrationFill);
551 SARLUS(refreshPeriod);
554 SARLUC(localTalkAddress);
563 /* SARLUCN( _16, 0x140);
565 /* Statistics Block - 0x0300 */
568 SARLUCN(resetTime, 18);
569 SARLUIA(numDatagramsTransmitted);
570 SARLUIA(numReTransmissions);
571 SARLUIA(numFramesDiscarded);
572 SARLUIA(numDatagramsReceived);
573 SARLUIA(numDuplicateReceivedFrames);
574 SARLUIA(numDatagramsDiscarded);
575 SARLUS(maxNumReTransmitDatagram);
576 SARLUS(maxNumReTransmitFrames);
577 SARLUS(maxNumConsecutiveDuplicateFrames);
578 /* misaligned here so we have to go to characters */
579 SARLUIA(numBytesTransmitted);
580 SARLUIA(numBytesReceived);
581 SARLUIA(numCRCErrors);
582 SARLUIA(numLengthErrors);
583 SARLUIA(numAbortErrors);
584 SARLUIA(numTXUnderruns);
585 SARLUIA(numRXOverruns);
586 SARLUIA(numHoldOffs);
587 SARLUIA(numFramesTransmitted);
588 SARLUIA(numFramesReceived);
589 SARLUIA(numReceiveFramesLost);
590 SARLUIA(numRXBufferOverflows);
591 SARLUIA(numFramesDiscardedAddrMismatch);
592 SARLUIA(numFramesDiscardedSIDMismatch);
593 SARLUIA(numPollsTransmistted);
594 SARLUIA(numPollAcknowledges);
595 SARLUIA(numStatusTimeouts);
596 SARLUIA(numNACKReceived);
602 /* next 4 seems too long for procfs, over single page ?
604 SARLUCN( txBuffer, 0x800);
605 SARLUCN( rxBuffer, 0x800);
606 SARLUCN( _18, 0x0bff);
609 pos += sprintf(arlan_drive_info + pos, "rxRing\t=\t0x");
610 for (i = 0; i < 0x50; i++)
611 pos += sprintf(arlan_drive_info + pos, "%02x", ((char *) priva->conf)[priva->conf->rxOffset + i]);
612 pos += sprintf(arlan_drive_info + pos, "\n");
614 SARLUC(configStatus);
618 SARLUC(controlRegister);
620 pos += sprintf(arlan_drive_info + pos, " total %d chars\n", pos);
623 pos += sprintf(arlan_drive_info + pos, " driver name : %s\n", ctl->procname);
628 retv = proc_dostring(ctl, write, filp, buffer, lenp);
638 static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp,
639 void *buffer, size_t * lenp)
642 int retv, pos, devnum;
643 struct arlan_private *priva = NULL;
646 devnum = ctl->procname[5] - '0';
647 if (arlan_device[devnum] == NULL)
649 pos += sprintf(arlan_drive_info + pos, "No device found here \n");
653 priva = arlan_device[devnum]->priv;
656 printk(KERN_WARNING " Could not find the device private in arlan procsys, bad\n ");
659 memcpy_fromio(priva->conf, priva->card, sizeof(struct arlan_shmem));
668 retv = proc_dostring(ctl, write, filp, buffer, lenp);
672 static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp,
673 void *buffer, size_t * lenp)
676 int retv, pos, devnum;
677 struct arlan_private *priva = NULL;
680 devnum = ctl->procname[5] - '0';
681 if (arlan_device[devnum] == NULL)
683 pos += sprintf(arlan_drive_info + pos, "No device found here \n");
687 priva = arlan_device[devnum]->priv;
690 printk(KERN_WARNING " Could not find the device private in arlan procsys, bad\n ");
693 memcpy_fromio(priva->conf, priva->card, sizeof(struct arlan_shmem));
694 SARLBNpln(u_char, txBuffer, 0x800);
697 retv = proc_dostring(ctl, write, filp, buffer, lenp);
701 static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp,
702 void *buffer, size_t * lenp)
705 int retv, pos, devnum;
706 struct arlan_private *priva = NULL;
709 devnum = ctl->procname[5] - '0';
710 if (arlan_device[devnum] == NULL)
712 pos += sprintf(arlan_drive_info + pos, "No device found here \n");
715 priva = arlan_device[devnum]->priv;
718 printk(KERN_WARNING " Could not find the device private in arlan procsys, bad\n ");
721 memcpy_fromio(priva->conf, priva->card, sizeof(struct arlan_shmem));
722 SARLBNpln(u_char, rxBuffer, 0x800);
725 retv = proc_dostring(ctl, write, filp, buffer, lenp);
729 static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
730 void *buffer, size_t * lenp)
733 int retv, pos, devnum;
734 struct arlan_private *priva = NULL;
737 devnum = ctl->procname[5] - '0';
738 if (arlan_device[devnum] == NULL)
740 pos += sprintf(arlan_drive_info + pos, "No device found here \n");
744 priva = arlan_device[devnum]->priv;
747 printk(KERN_WARNING " Could not find the device private in arlan procsys, bad\n ");
750 memcpy_fromio(priva->conf, priva->card, sizeof(struct arlan_shmem));
751 SARLBNpln(u_char, _18, 0x800);
755 retv = proc_dostring(ctl, write, filp, buffer, lenp);
760 #endif /* #ifdef ARLAN_PROC_SHM_DUMP */
763 static char conf_reset_result[200];
765 static int arlan_configure(ctl_table * ctl, int write, struct file *filp,
766 void *buffer, size_t * lenp)
769 int devnum = ctl->procname[6] - '0';
770 struct arlan_private *priv;
772 if (devnum < 0 || devnum > MAX_ARLANS - 1)
774 printk(KERN_WARNING "too strange devnum in procfs parse\n ");
777 else if (arlan_device[devnum] != NULL)
779 priv = arlan_device[devnum]->priv;
781 arlan_command(arlan_device[devnum], ARLAN_COMMAND_CLEAN_AND_CONF);
787 return proc_dostring(ctl, write, filp, buffer, lenp);
790 static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
791 void *buffer, size_t * lenp)
794 int devnum = ctl->procname[5] - '0';
795 struct arlan_private *priv;
797 if (devnum < 0 || devnum > MAX_ARLANS - 1)
799 printk(KERN_WARNING "too strange devnum in procfs parse\n ");
802 else if (arlan_device[devnum] != NULL)
804 priv = arlan_device[devnum]->priv;
805 arlan_command(arlan_device[devnum], ARLAN_COMMAND_CLEAN_AND_RESET);
810 return proc_dostring(ctl, write, filp, buffer, lenp);
814 /* Place files in /proc/sys/dev/arlan */
815 #define CTBLN(num,card,nam) \
818 .data = &(arlan_conf[card].nam),\
819 .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec}
820 #ifdef ARLAN_DEBUGGING
822 #define ARLAN_PROC_DEBUG_ENTRIES \
823 { .ctl_name = 48, .procname = "entry_exit_debug",\
824 .data = &arlan_entry_and_exit_debug,\
825 .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\
826 { .ctl_name = 49, .procname = "debug", .data = &arlan_debug,\
827 .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},
829 #define ARLAN_PROC_DEBUG_ENTRIES
832 #define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\
833 CTBLN(1,cardNo,spreadingCode),\
834 CTBLN(2,cardNo, channelNumber),\
835 CTBLN(3,cardNo, scramblingDisable),\
836 CTBLN(4,cardNo, txAttenuation),\
837 CTBLN(5,cardNo, systemId), \
838 CTBLN(6,cardNo, maxDatagramSize),\
839 CTBLN(7,cardNo, maxFrameSize),\
840 CTBLN(8,cardNo, maxRetries),\
841 CTBLN(9,cardNo, receiveMode),\
842 CTBLN(10,cardNo, priority),\
843 CTBLN(11,cardNo, rootOrRepeater),\
844 CTBLN(12,cardNo, SID),\
845 CTBLN(13,cardNo, registrationMode),\
846 CTBLN(14,cardNo, registrationFill),\
847 CTBLN(15,cardNo, localTalkAddress),\
848 CTBLN(16,cardNo, codeFormat),\
849 CTBLN(17,cardNo, numChannels),\
850 CTBLN(18,cardNo, channel1),\
851 CTBLN(19,cardNo, channel2),\
852 CTBLN(20,cardNo, channel3),\
853 CTBLN(21,cardNo, channel4),\
854 CTBLN(22,cardNo, txClear),\
855 CTBLN(23,cardNo, txRetries),\
856 CTBLN(24,cardNo, txRouting),\
857 CTBLN(25,cardNo, txScrambled),\
858 CTBLN(26,cardNo, rxParameter),\
859 CTBLN(27,cardNo, txTimeoutMs),\
860 CTBLN(28,cardNo, waitCardTimeout),\
861 CTBLN(29,cardNo, channelSet), \
862 {.ctl_name = 30, .procname = "name",\
863 .data = arlan_conf[cardNo].siteName,\
864 .maxlen = 16, .mode = 0600, .proc_handler = &proc_dostring},\
865 CTBLN(31,cardNo,waitTime),\
866 CTBLN(32,cardNo,lParameter),\
867 CTBLN(33,cardNo,_15),\
868 CTBLN(34,cardNo,headerSize),\
869 CTBLN(36,cardNo,tx_delay_ms),\
870 CTBLN(37,cardNo,retries),\
871 CTBLN(38,cardNo,ReTransmitPacketMaxSize),\
872 CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\
873 CTBLN(40,cardNo,fastReTransCount),\
874 CTBLN(41,cardNo,driverRetransmissions),\
875 CTBLN(42,cardNo,txAckTimeoutMs),\
876 CTBLN(43,cardNo,registrationInterrupts),\
877 CTBLN(44,cardNo,hardwareType),\
878 CTBLN(45,cardNo,radioType),\
879 CTBLN(46,cardNo,writeEEPROM),\
880 CTBLN(47,cardNo,writeRadioType),\
881 ARLAN_PROC_DEBUG_ENTRIES\
882 CTBLN(50,cardNo,in_speed),\
883 CTBLN(51,cardNo,out_speed),\
884 CTBLN(52,cardNo,in_speed10),\
885 CTBLN(53,cardNo,out_speed10),\
886 CTBLN(54,cardNo,in_speed_max),\
887 CTBLN(55,cardNo,out_speed_max),\
888 CTBLN(56,cardNo,measure_rate),\
889 CTBLN(57,cardNo,pre_Command_Wait),\
890 CTBLN(58,cardNo,rx_tweak1),\
891 CTBLN(59,cardNo,rx_tweak2),\
892 CTBLN(60,cardNo,tx_queue_len),\
896 static ctl_table arlan_conf_table0[] =
898 ARLAN_SYSCTL_TABLE_TOTAL(0)
900 #ifdef ARLAN_PROC_SHM_DUMP
903 .procname = "arlan0-txRing",
904 .data = &arlan_drive_info,
905 .maxlen = ARLAN_STR_SIZE,
907 .proc_handler = &arlan_sysctl_infotxRing,
911 .procname = "arlan0-rxRing",
912 .data = &arlan_drive_info,
913 .maxlen = ARLAN_STR_SIZE,
915 .proc_handler = &arlan_sysctl_inforxRing,
919 .procname = "arlan0-18",
920 .data = &arlan_drive_info,
921 .maxlen = ARLAN_STR_SIZE,
923 .proc_handler = &arlan_sysctl_info18,
927 .procname = "arlan0-ring",
928 .data = &arlan_drive_info,
929 .maxlen = ARLAN_STR_SIZE,
931 .proc_handler = &arlan_sysctl_info161719,
935 .procname = "arlan0-shm-cpy",
936 .data = &arlan_drive_info,
937 .maxlen = ARLAN_STR_SIZE,
939 .proc_handler = &arlan_sysctl_info,
944 .procname = "config0",
945 .data = &conf_reset_result,
948 .proc_handler = &arlan_configure
952 .procname = "reset0",
953 .data = &conf_reset_result,
956 .proc_handler = &arlan_sysctl_reset,
961 static ctl_table arlan_conf_table1[] =
964 ARLAN_SYSCTL_TABLE_TOTAL(1)
966 #ifdef ARLAN_PROC_SHM_DUMP
969 .procname = "arlan1-txRing",
970 .data = &arlan_drive_info,
971 .maxlen = ARLAN_STR_SIZE,
973 .proc_handler = &arlan_sysctl_infotxRing,
977 .procname = "arlan1-rxRing",
978 .data = &arlan_drive_info,
979 .maxlen = ARLAN_STR_SIZE,
981 .proc_handler = &arlan_sysctl_inforxRing,
985 .procname = "arlan1-18",
986 .data = &arlan_drive_info,
987 .maxlen = ARLAN_STR_SIZE,
989 .proc_handler = &arlan_sysctl_info18,
993 .procname = "arlan1-ring",
994 .data = &arlan_drive_info,
995 .maxlen = ARLAN_STR_SIZE,
997 .proc_handler = &arlan_sysctl_info161719,
1001 .procname = "arlan1-shm-cpy",
1002 .data = &arlan_drive_info,
1003 .maxlen = ARLAN_STR_SIZE,
1005 .proc_handler = &arlan_sysctl_info,
1010 .procname = "config1",
1011 .data = &conf_reset_result,
1014 .proc_handler = &arlan_configure,
1018 .procname = "reset1",
1019 .data = &conf_reset_result,
1022 .proc_handler = &arlan_sysctl_reset,
1027 static ctl_table arlan_conf_table2[] =
1030 ARLAN_SYSCTL_TABLE_TOTAL(2)
1032 #ifdef ARLAN_PROC_SHM_DUMP
1035 .procname = "arlan2-txRing",
1036 .data = &arlan_drive_info,
1037 .maxlen = ARLAN_STR_SIZE,
1039 .proc_handler = &arlan_sysctl_infotxRing,
1043 .procname = "arlan2-rxRing",
1044 .data = &arlan_drive_info,
1045 .maxlen = ARLAN_STR_SIZE,
1047 .proc_handler = &arlan_sysctl_inforxRing,
1051 .procname = "arlan2-18",
1052 .data = &arlan_drive_info,
1053 .maxlen = ARLAN_STR_SIZE,
1055 .proc_handler = &arlan_sysctl_info18,
1059 .procname = "arlan2-ring",
1060 .data = &arlan_drive_info,
1061 .maxlen = ARLAN_STR_SIZE,
1063 .proc_handler = &arlan_sysctl_info161719,
1067 .procname = "arlan2-shm-cpy",
1068 .data = &arlan_drive_info,
1069 .maxlen = ARLAN_STR_SIZE,
1071 .proc_handler = &arlan_sysctl_info,
1076 .procname = "config2",
1077 .data = &conf_reset_result,
1080 .proc_handler = &arlan_configure,
1084 .procname = "reset2",
1085 .data = &conf_reset_result,
1088 .proc_handler = &arlan_sysctl_reset,
1093 static ctl_table arlan_conf_table3[] =
1096 ARLAN_SYSCTL_TABLE_TOTAL(3)
1098 #ifdef ARLAN_PROC_SHM_DUMP
1101 .procname = "arlan3-txRing",
1102 .data = &arlan_drive_info,
1103 .maxlen = ARLAN_STR_SIZE,
1105 .proc_handler = &arlan_sysctl_infotxRing,
1109 .procname = "arlan3-rxRing",
1110 .data = &arlan_drive_info,
1111 .maxlen = ARLAN_STR_SIZE,
1113 .proc_handler = &arlan_sysctl_inforxRing,
1117 .procname = "arlan3-18",
1118 .data = &arlan_drive_info,
1119 .maxlen = ARLAN_STR_SIZE,
1121 .proc_handler = &arlan_sysctl_info18,
1125 .procname = "arlan3-ring",
1126 .data = &arlan_drive_info,
1127 .maxlen = ARLAN_STR_SIZE,
1129 .proc_handler = &arlan_sysctl_info161719,
1133 .procname = "arlan3-shm-cpy",
1134 .data = &arlan_drive_info,
1135 .maxlen = ARLAN_STR_SIZE,
1137 .proc_handler = &arlan_sysctl_info,
1142 .procname = "config3",
1143 .data = &conf_reset_result,
1146 .proc_handler = &arlan_configure,
1150 .procname = "reset3",
1151 .data = &conf_reset_result,
1154 .proc_handler = &arlan_sysctl_reset,
1161 static ctl_table arlan_table[] =
1165 .procname = "arlan0",
1168 .child = arlan_conf_table0,
1172 .procname = "arlan1",
1175 .child = arlan_conf_table1,
1179 .procname = "arlan2",
1182 .child = arlan_conf_table2,
1186 .procname = "arlan3",
1189 .child = arlan_conf_table3,
1196 static ctl_table arlan_table[MAX_ARLANS + 1] =
1203 static ctl_table arlan_table[MAX_ARLANS + 1] =
1210 // static int mmtu = 1234;
1212 static ctl_table arlan_root_table[] =
1216 .procname = "arlan",
1219 .child = arlan_table,
1224 /* Make sure that /proc/sys/dev is there */
1225 //static ctl_table arlan_device_root_table[] =
1227 // {CTL_DEV, "dev", NULL, 0, 0555, arlan_root_table},
1232 #ifdef CONFIG_PROC_FS
1233 static struct ctl_table_header *arlan_device_sysctl_header;
1235 int __init init_arlan_proc(void)
1239 if (arlan_device_sysctl_header)
1241 for (i = 0; i < MAX_ARLANS && arlan_device[i]; i++)
1242 arlan_table[i].ctl_name = i + 1;
1243 arlan_device_sysctl_header = register_sysctl_table(arlan_root_table, 0);
1244 if (!arlan_device_sysctl_header)
1251 void __exit cleanup_arlan_proc(void)
1253 unregister_sysctl_table(arlan_device_sysctl_header);
1254 arlan_device_sysctl_header = NULL;