~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to net/atm/atm_sysfs.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* ATM driver model support. */
2
2
 
3
3
#include <linux/kernel.h>
 
4
#include <linux/slab.h>
4
5
#include <linux/init.h>
5
6
#include <linux/kobject.h>
6
7
#include <linux/atmdev.h>
42
43
 
43
44
        spin_lock_irqsave(&adev->lock, flags);
44
45
        list_for_each_entry(aaddr, &adev->local, entry) {
45
 
                for(i = 0, j = 0; i < ATM_ESA_LEN; ++i, ++j) {
 
46
                for (i = 0, j = 0; i < ATM_ESA_LEN; ++i, ++j) {
46
47
                        if (j == *fmt) {
47
48
                                pos += sprintf(pos, ".");
48
49
                                ++fmt;
49
50
                                j = 0;
50
51
                        }
51
 
                        pos += sprintf(pos, "%02x", aaddr->addr.sas_addr.prv[i]);
 
52
                        pos += sprintf(pos, "%02x",
 
53
                                       aaddr->addr.sas_addr.prv[i]);
52
54
                }
53
55
                pos += sprintf(pos, "\n");
54
56
        }
78
80
 
79
81
        /* show the link rate, not the data rate */
80
82
        switch (adev->link_rate) {
81
 
                case ATM_OC3_PCR:
82
 
                        link_rate = 155520000;
83
 
                        break;
84
 
                case ATM_OC12_PCR:
85
 
                        link_rate = 622080000;
86
 
                        break;
87
 
                case ATM_25_PCR:
88
 
                        link_rate = 25600000;
89
 
                        break;
90
 
                default:
91
 
                        link_rate = adev->link_rate * 8 * 53;
 
83
        case ATM_OC3_PCR:
 
84
                link_rate = 155520000;
 
85
                break;
 
86
        case ATM_OC12_PCR:
 
87
                link_rate = 622080000;
 
88
                break;
 
89
        case ATM_25_PCR:
 
90
                link_rate = 25600000;
 
91
                break;
 
92
        default:
 
93
                link_rate = adev->link_rate * 8 * 53;
92
94
        }
93
95
        pos += sprintf(pos, "%d\n", link_rate);
94
96
 
141
143
        .dev_uevent             = atm_uevent,
142
144
};
143
145
 
144
 
int atm_register_sysfs(struct atm_dev *adev)
 
146
int atm_register_sysfs(struct atm_dev *adev, struct device *parent)
145
147
{
146
148
        struct device *cdev = &adev->class_dev;
147
149
        int i, j, err;
148
150
 
149
151
        cdev->class = &atm_class;
 
152
        cdev->parent = parent;
150
153
        dev_set_drvdata(cdev, adev);
151
154
 
152
155
        dev_set_name(cdev, "%s%d", adev->type, adev->number);