diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-01-27 00:52:07 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-01-27 00:52:07 -0500 |
commit | d057f0a4efe441842adb2d263e50173b7e0e7e38 (patch) | |
tree | a89e3b12ce00d220bef827e9b34daea5611a1720 | |
parent | 01e2ffac7dbc0700c972eb38619870034a0b3418 (diff) |
solos: Add initial list of parameters
I don't much like the trick with multiple inclusions of solos-attrlist.c
but don't really see a saner way to do it without repeating the list.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | drivers/atm/solos-attrlist.c | 70 | ||||
-rw-r--r-- | drivers/atm/solos-pci.c | 30 |
2 files changed, 94 insertions, 6 deletions
diff --git a/drivers/atm/solos-attrlist.c b/drivers/atm/solos-attrlist.c new file mode 100644 index 000000000000..efa2808dd94d --- /dev/null +++ b/drivers/atm/solos-attrlist.c | |||
@@ -0,0 +1,70 @@ | |||
1 | SOLOS_ATTR_RO(DriverVersion) | ||
2 | SOLOS_ATTR_RO(APIVersion) | ||
3 | SOLOS_ATTR_RO(FirmwareVersion) | ||
4 | // SOLOS_ATTR_RO(DspVersion) | ||
5 | // SOLOS_ATTR_RO(CommonHandshake) | ||
6 | SOLOS_ATTR_RO(Connected) | ||
7 | SOLOS_ATTR_RO(OperationalMode) | ||
8 | SOLOS_ATTR_RO(State) | ||
9 | SOLOS_ATTR_RO(Watchdog) | ||
10 | SOLOS_ATTR_RO(OperationProgress) | ||
11 | SOLOS_ATTR_RO(LastFailed) | ||
12 | SOLOS_ATTR_RO(TxBitRate) | ||
13 | SOLOS_ATTR_RO(RxBitRate) | ||
14 | // SOLOS_ATTR_RO(DeltACTATPds) | ||
15 | // SOLOS_ATTR_RO(DeltACTATPus) | ||
16 | SOLOS_ATTR_RO(TxATTNDR) | ||
17 | SOLOS_ATTR_RO(RxATTNDR) | ||
18 | SOLOS_ATTR_RO(AnnexType) | ||
19 | SOLOS_ATTR_RO(GeneralFailure) | ||
20 | SOLOS_ATTR_RO(InterleaveDpDn) | ||
21 | SOLOS_ATTR_RO(InterleaveDpUp) | ||
22 | SOLOS_ATTR_RO(RSCorrectedErrorsDn) | ||
23 | SOLOS_ATTR_RO(RSUnCorrectedErrorsDn) | ||
24 | SOLOS_ATTR_RO(RSCorrectedErrorsUp) | ||
25 | SOLOS_ATTR_RO(RSUnCorrectedErrorsUp) | ||
26 | SOLOS_ATTR_RO(InterleaveRDn) | ||
27 | SOLOS_ATTR_RO(InterleaveRUp) | ||
28 | SOLOS_ATTR_RO(ShowtimeStart) | ||
29 | SOLOS_ATTR_RO(ATURVendor) | ||
30 | SOLOS_ATTR_RO(ATUCCountry) | ||
31 | SOLOS_ATTR_RO(ATURANSIRev) | ||
32 | SOLOS_ATTR_RO(ATURANSISTD) | ||
33 | SOLOS_ATTR_RO(ATUCANSIRev) | ||
34 | SOLOS_ATTR_RO(ATUCANSIId) | ||
35 | SOLOS_ATTR_RO(ATUCANSISTD) | ||
36 | SOLOS_ATTR_RO(DataBoost) | ||
37 | SOLOS_ATTR_RO(LocalITUCountryCode) | ||
38 | SOLOS_ATTR_RO(LocalSEF) | ||
39 | SOLOS_ATTR_RO(LocalEndLOS) | ||
40 | SOLOS_ATTR_RO(LocalSNRMargin) | ||
41 | SOLOS_ATTR_RO(LocalLineAttn) | ||
42 | SOLOS_ATTR_RO(RawAttn) | ||
43 | SOLOS_ATTR_RO(LocalTxPower) | ||
44 | SOLOS_ATTR_RO(RemoteTxPower) | ||
45 | SOLOS_ATTR_RO(RemoteSEF) | ||
46 | SOLOS_ATTR_RO(RemoteLOS) | ||
47 | SOLOS_ATTR_RO(RemoteLineAttn) | ||
48 | SOLOS_ATTR_RO(RemoteSNRMargin) | ||
49 | SOLOS_ATTR_RO(LineUpCount) | ||
50 | SOLOS_ATTR_RO(SRACnt) | ||
51 | SOLOS_ATTR_RO(SRACntUp) | ||
52 | SOLOS_ATTR_RO(ProfileStatus) | ||
53 | SOLOS_ATTR_RW(Action) | ||
54 | SOLOS_ATTR_RW(ActivateLine) | ||
55 | SOLOS_ATTR_RO(LineStatus) | ||
56 | SOLOS_ATTR_RW(HostControl) | ||
57 | SOLOS_ATTR_RW(AutoStart) | ||
58 | SOLOS_ATTR_RW(Failsafe) | ||
59 | SOLOS_ATTR_RW(ShowtimeLed) | ||
60 | SOLOS_ATTR_RW(Retrain) | ||
61 | SOLOS_ATTR_RW(Defaults) | ||
62 | SOLOS_ATTR_RW(LineMode) | ||
63 | SOLOS_ATTR_RW(Profile) | ||
64 | SOLOS_ATTR_RW(DetectNoise) | ||
65 | SOLOS_ATTR_RO(SupportedAnnexes) | ||
66 | SOLOS_ATTR_RO(Status) | ||
67 | SOLOS_ATTR_RO(TotalStart) | ||
68 | SOLOS_ATTR_RO(RecentShowtimeStart) | ||
69 | SOLOS_ATTR_RO(TotalRxBlocks) | ||
70 | SOLOS_ATTR_RO(TotalTxBlocks) | ||
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index d9262a428dd6..b0c4676296ba 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c | |||
@@ -371,8 +371,28 @@ static ssize_t console_store(struct device *dev, struct device_attribute *attr, | |||
371 | } | 371 | } |
372 | 372 | ||
373 | static DEVICE_ATTR(console, 0644, console_show, console_store); | 373 | static DEVICE_ATTR(console, 0644, console_show, console_store); |
374 | static DEVICE_ATTR(OperationalMode, 0444, solos_param_show, NULL); | 374 | |
375 | static DEVICE_ATTR(AutoStart, 0644, solos_param_show, solos_param_store); | 375 | |
376 | #define SOLOS_ATTR_RO(x) static DEVICE_ATTR(x, 0444, solos_param_show, NULL); | ||
377 | #define SOLOS_ATTR_RW(x) static DEVICE_ATTR(x, 0644, solos_param_show, solos_param_store); | ||
378 | |||
379 | #include "solos-attrlist.c" | ||
380 | |||
381 | #undef SOLOS_ATTR_RO | ||
382 | #undef SOLOS_ATTR_RW | ||
383 | |||
384 | #define SOLOS_ATTR_RO(x) &dev_attr_##x.attr, | ||
385 | #define SOLOS_ATTR_RW(x) &dev_attr_##x.attr, | ||
386 | |||
387 | static struct attribute *solos_attrs[] = { | ||
388 | #include "solos-attrlist.c" | ||
389 | NULL | ||
390 | }; | ||
391 | |||
392 | static struct attribute_group solos_attr_group = { | ||
393 | .attrs = solos_attrs, | ||
394 | .name = "parameters", | ||
395 | }; | ||
376 | 396 | ||
377 | static int flash_upgrade(struct solos_card *card, int chip) | 397 | static int flash_upgrade(struct solos_card *card, int chip) |
378 | { | 398 | { |
@@ -987,10 +1007,8 @@ static int atm_init(struct solos_card *card) | |||
987 | } | 1007 | } |
988 | if (device_create_file(&card->atmdev[i]->class_dev, &dev_attr_console)) | 1008 | if (device_create_file(&card->atmdev[i]->class_dev, &dev_attr_console)) |
989 | dev_err(&card->dev->dev, "Could not register console for ATM device %d\n", i); | 1009 | dev_err(&card->dev->dev, "Could not register console for ATM device %d\n", i); |
990 | if (device_create_file(&card->atmdev[i]->class_dev, &dev_attr_OperationalMode)) | 1010 | if (sysfs_create_group(&card->atmdev[i]->class_dev.kobj, &solos_attr_group)) |
991 | dev_err(&card->dev->dev, "Could not register opmode attr for ATM device %d\n", i); | 1011 | dev_err(&card->dev->dev, "Could not register parameter group for ATM device %d\n", i); |
992 | if (device_create_file(&card->atmdev[i]->class_dev, &dev_attr_AutoStart)) | ||
993 | dev_err(&card->dev->dev, "Could not register autostart attr for ATM device %d\n", i); | ||
994 | 1012 | ||
995 | dev_info(&card->dev->dev, "Registered ATM device %d\n", card->atmdev[i]->number); | 1013 | dev_info(&card->dev->dev, "Registered ATM device %d\n", card->atmdev[i]->number); |
996 | 1014 | ||