diff options
author | Tony Jones <tonyj@suse.de> | 2008-02-21 18:13:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-19 22:10:33 -0400 |
commit | ee959b00c335d7780136c5abda37809191fe52c3 (patch) | |
tree | 7775f3b274fd8caf5e7e5154fea89e96f2babd94 /drivers/scsi/lpfc/lpfc_attr.c | |
parent | 56d110e852b0b1c85ad6c9bfe1cb4473ceb16402 (diff) |
SCSI: convert struct class_device to struct device
It's big, but there doesn't seem to be a way to split it up smaller...
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 484 |
1 files changed, 257 insertions, 227 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 74c9fc204211..a9fbb3f88659 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -66,23 +66,26 @@ lpfc_jedec_to_ascii(int incr, char hdw[]) | |||
66 | } | 66 | } |
67 | 67 | ||
68 | static ssize_t | 68 | static ssize_t |
69 | lpfc_drvr_version_show(struct class_device *cdev, char *buf) | 69 | lpfc_drvr_version_show(struct device *dev, struct device_attribute *attr, |
70 | char *buf) | ||
70 | { | 71 | { |
71 | return snprintf(buf, PAGE_SIZE, LPFC_MODULE_DESC "\n"); | 72 | return snprintf(buf, PAGE_SIZE, LPFC_MODULE_DESC "\n"); |
72 | } | 73 | } |
73 | 74 | ||
74 | static ssize_t | 75 | static ssize_t |
75 | lpfc_info_show(struct class_device *cdev, char *buf) | 76 | lpfc_info_show(struct device *dev, struct device_attribute *attr, |
77 | char *buf) | ||
76 | { | 78 | { |
77 | struct Scsi_Host *host = class_to_shost(cdev); | 79 | struct Scsi_Host *host = class_to_shost(dev); |
78 | 80 | ||
79 | return snprintf(buf, PAGE_SIZE, "%s\n",lpfc_info(host)); | 81 | return snprintf(buf, PAGE_SIZE, "%s\n",lpfc_info(host)); |
80 | } | 82 | } |
81 | 83 | ||
82 | static ssize_t | 84 | static ssize_t |
83 | lpfc_serialnum_show(struct class_device *cdev, char *buf) | 85 | lpfc_serialnum_show(struct device *dev, struct device_attribute *attr, |
86 | char *buf) | ||
84 | { | 87 | { |
85 | struct Scsi_Host *shost = class_to_shost(cdev); | 88 | struct Scsi_Host *shost = class_to_shost(dev); |
86 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 89 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
87 | struct lpfc_hba *phba = vport->phba; | 90 | struct lpfc_hba *phba = vport->phba; |
88 | 91 | ||
@@ -90,18 +93,20 @@ lpfc_serialnum_show(struct class_device *cdev, char *buf) | |||
90 | } | 93 | } |
91 | 94 | ||
92 | static ssize_t | 95 | static ssize_t |
93 | lpfc_temp_sensor_show(struct class_device *cdev, char *buf) | 96 | lpfc_temp_sensor_show(struct device *dev, struct device_attribute *attr, |
97 | char *buf) | ||
94 | { | 98 | { |
95 | struct Scsi_Host *shost = class_to_shost(cdev); | 99 | struct Scsi_Host *shost = class_to_shost(dev); |
96 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 100 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
97 | struct lpfc_hba *phba = vport->phba; | 101 | struct lpfc_hba *phba = vport->phba; |
98 | return snprintf(buf, PAGE_SIZE, "%d\n",phba->temp_sensor_support); | 102 | return snprintf(buf, PAGE_SIZE, "%d\n",phba->temp_sensor_support); |
99 | } | 103 | } |
100 | 104 | ||
101 | static ssize_t | 105 | static ssize_t |
102 | lpfc_modeldesc_show(struct class_device *cdev, char *buf) | 106 | lpfc_modeldesc_show(struct device *dev, struct device_attribute *attr, |
107 | char *buf) | ||
103 | { | 108 | { |
104 | struct Scsi_Host *shost = class_to_shost(cdev); | 109 | struct Scsi_Host *shost = class_to_shost(dev); |
105 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 110 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
106 | struct lpfc_hba *phba = vport->phba; | 111 | struct lpfc_hba *phba = vport->phba; |
107 | 112 | ||
@@ -109,9 +114,10 @@ lpfc_modeldesc_show(struct class_device *cdev, char *buf) | |||
109 | } | 114 | } |
110 | 115 | ||
111 | static ssize_t | 116 | static ssize_t |
112 | lpfc_modelname_show(struct class_device *cdev, char *buf) | 117 | lpfc_modelname_show(struct device *dev, struct device_attribute *attr, |
118 | char *buf) | ||
113 | { | 119 | { |
114 | struct Scsi_Host *shost = class_to_shost(cdev); | 120 | struct Scsi_Host *shost = class_to_shost(dev); |
115 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 121 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
116 | struct lpfc_hba *phba = vport->phba; | 122 | struct lpfc_hba *phba = vport->phba; |
117 | 123 | ||
@@ -119,9 +125,10 @@ lpfc_modelname_show(struct class_device *cdev, char *buf) | |||
119 | } | 125 | } |
120 | 126 | ||
121 | static ssize_t | 127 | static ssize_t |
122 | lpfc_programtype_show(struct class_device *cdev, char *buf) | 128 | lpfc_programtype_show(struct device *dev, struct device_attribute *attr, |
129 | char *buf) | ||
123 | { | 130 | { |
124 | struct Scsi_Host *shost = class_to_shost(cdev); | 131 | struct Scsi_Host *shost = class_to_shost(dev); |
125 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 132 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
126 | struct lpfc_hba *phba = vport->phba; | 133 | struct lpfc_hba *phba = vport->phba; |
127 | 134 | ||
@@ -129,9 +136,10 @@ lpfc_programtype_show(struct class_device *cdev, char *buf) | |||
129 | } | 136 | } |
130 | 137 | ||
131 | static ssize_t | 138 | static ssize_t |
132 | lpfc_vportnum_show(struct class_device *cdev, char *buf) | 139 | lpfc_vportnum_show(struct device *dev, struct device_attribute *attr, |
140 | char *buf) | ||
133 | { | 141 | { |
134 | struct Scsi_Host *shost = class_to_shost(cdev); | 142 | struct Scsi_Host *shost = class_to_shost(dev); |
135 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 143 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
136 | struct lpfc_hba *phba = vport->phba; | 144 | struct lpfc_hba *phba = vport->phba; |
137 | 145 | ||
@@ -139,9 +147,10 @@ lpfc_vportnum_show(struct class_device *cdev, char *buf) | |||
139 | } | 147 | } |
140 | 148 | ||
141 | static ssize_t | 149 | static ssize_t |
142 | lpfc_fwrev_show(struct class_device *cdev, char *buf) | 150 | lpfc_fwrev_show(struct device *dev, struct device_attribute *attr, |
151 | char *buf) | ||
143 | { | 152 | { |
144 | struct Scsi_Host *shost = class_to_shost(cdev); | 153 | struct Scsi_Host *shost = class_to_shost(dev); |
145 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 154 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
146 | struct lpfc_hba *phba = vport->phba; | 155 | struct lpfc_hba *phba = vport->phba; |
147 | char fwrev[32]; | 156 | char fwrev[32]; |
@@ -151,10 +160,10 @@ lpfc_fwrev_show(struct class_device *cdev, char *buf) | |||
151 | } | 160 | } |
152 | 161 | ||
153 | static ssize_t | 162 | static ssize_t |
154 | lpfc_hdw_show(struct class_device *cdev, char *buf) | 163 | lpfc_hdw_show(struct device *dev, struct device_attribute *attr, char *buf) |
155 | { | 164 | { |
156 | char hdw[9]; | 165 | char hdw[9]; |
157 | struct Scsi_Host *shost = class_to_shost(cdev); | 166 | struct Scsi_Host *shost = class_to_shost(dev); |
158 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 167 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
159 | struct lpfc_hba *phba = vport->phba; | 168 | struct lpfc_hba *phba = vport->phba; |
160 | lpfc_vpd_t *vp = &phba->vpd; | 169 | lpfc_vpd_t *vp = &phba->vpd; |
@@ -163,18 +172,20 @@ lpfc_hdw_show(struct class_device *cdev, char *buf) | |||
163 | return snprintf(buf, PAGE_SIZE, "%s\n", hdw); | 172 | return snprintf(buf, PAGE_SIZE, "%s\n", hdw); |
164 | } | 173 | } |
165 | static ssize_t | 174 | static ssize_t |
166 | lpfc_option_rom_version_show(struct class_device *cdev, char *buf) | 175 | lpfc_option_rom_version_show(struct device *dev, struct device_attribute *attr, |
176 | char *buf) | ||
167 | { | 177 | { |
168 | struct Scsi_Host *shost = class_to_shost(cdev); | 178 | struct Scsi_Host *shost = class_to_shost(dev); |
169 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 179 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
170 | struct lpfc_hba *phba = vport->phba; | 180 | struct lpfc_hba *phba = vport->phba; |
171 | 181 | ||
172 | return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion); | 182 | return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion); |
173 | } | 183 | } |
174 | static ssize_t | 184 | static ssize_t |
175 | lpfc_state_show(struct class_device *cdev, char *buf) | 185 | lpfc_state_show(struct device *dev, struct device_attribute *attr, |
186 | char *buf) | ||
176 | { | 187 | { |
177 | struct Scsi_Host *shost = class_to_shost(cdev); | 188 | struct Scsi_Host *shost = class_to_shost(dev); |
178 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 189 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
179 | struct lpfc_hba *phba = vport->phba; | 190 | struct lpfc_hba *phba = vport->phba; |
180 | int len = 0; | 191 | int len = 0; |
@@ -243,9 +254,10 @@ lpfc_state_show(struct class_device *cdev, char *buf) | |||
243 | } | 254 | } |
244 | 255 | ||
245 | static ssize_t | 256 | static ssize_t |
246 | lpfc_num_discovered_ports_show(struct class_device *cdev, char *buf) | 257 | lpfc_num_discovered_ports_show(struct device *dev, |
258 | struct device_attribute *attr, char *buf) | ||
247 | { | 259 | { |
248 | struct Scsi_Host *shost = class_to_shost(cdev); | 260 | struct Scsi_Host *shost = class_to_shost(dev); |
249 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 261 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
250 | 262 | ||
251 | return snprintf(buf, PAGE_SIZE, "%d\n", | 263 | return snprintf(buf, PAGE_SIZE, "%d\n", |
@@ -367,9 +379,10 @@ lpfc_selective_reset(struct lpfc_hba *phba) | |||
367 | } | 379 | } |
368 | 380 | ||
369 | static ssize_t | 381 | static ssize_t |
370 | lpfc_issue_reset(struct class_device *cdev, const char *buf, size_t count) | 382 | lpfc_issue_reset(struct device *dev, struct device_attribute *attr, |
383 | const char *buf, size_t count) | ||
371 | { | 384 | { |
372 | struct Scsi_Host *shost = class_to_shost(cdev); | 385 | struct Scsi_Host *shost = class_to_shost(dev); |
373 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 386 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
374 | struct lpfc_hba *phba = vport->phba; | 387 | struct lpfc_hba *phba = vport->phba; |
375 | 388 | ||
@@ -385,9 +398,10 @@ lpfc_issue_reset(struct class_device *cdev, const char *buf, size_t count) | |||
385 | } | 398 | } |
386 | 399 | ||
387 | static ssize_t | 400 | static ssize_t |
388 | lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf) | 401 | lpfc_nport_evt_cnt_show(struct device *dev, struct device_attribute *attr, |
402 | char *buf) | ||
389 | { | 403 | { |
390 | struct Scsi_Host *shost = class_to_shost(cdev); | 404 | struct Scsi_Host *shost = class_to_shost(dev); |
391 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 405 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
392 | struct lpfc_hba *phba = vport->phba; | 406 | struct lpfc_hba *phba = vport->phba; |
393 | 407 | ||
@@ -395,9 +409,10 @@ lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf) | |||
395 | } | 409 | } |
396 | 410 | ||
397 | static ssize_t | 411 | static ssize_t |
398 | lpfc_board_mode_show(struct class_device *cdev, char *buf) | 412 | lpfc_board_mode_show(struct device *dev, struct device_attribute *attr, |
413 | char *buf) | ||
399 | { | 414 | { |
400 | struct Scsi_Host *shost = class_to_shost(cdev); | 415 | struct Scsi_Host *shost = class_to_shost(dev); |
401 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 416 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
402 | struct lpfc_hba *phba = vport->phba; | 417 | struct lpfc_hba *phba = vport->phba; |
403 | char * state; | 418 | char * state; |
@@ -415,9 +430,10 @@ lpfc_board_mode_show(struct class_device *cdev, char *buf) | |||
415 | } | 430 | } |
416 | 431 | ||
417 | static ssize_t | 432 | static ssize_t |
418 | lpfc_board_mode_store(struct class_device *cdev, const char *buf, size_t count) | 433 | lpfc_board_mode_store(struct device *dev, struct device_attribute *attr, |
434 | const char *buf, size_t count) | ||
419 | { | 435 | { |
420 | struct Scsi_Host *shost = class_to_shost(cdev); | 436 | struct Scsi_Host *shost = class_to_shost(dev); |
421 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 437 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
422 | struct lpfc_hba *phba = vport->phba; | 438 | struct lpfc_hba *phba = vport->phba; |
423 | struct completion online_compl; | 439 | struct completion online_compl; |
@@ -509,9 +525,10 @@ lpfc_get_hba_info(struct lpfc_hba *phba, | |||
509 | } | 525 | } |
510 | 526 | ||
511 | static ssize_t | 527 | static ssize_t |
512 | lpfc_max_rpi_show(struct class_device *cdev, char *buf) | 528 | lpfc_max_rpi_show(struct device *dev, struct device_attribute *attr, |
529 | char *buf) | ||
513 | { | 530 | { |
514 | struct Scsi_Host *shost = class_to_shost(cdev); | 531 | struct Scsi_Host *shost = class_to_shost(dev); |
515 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 532 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
516 | struct lpfc_hba *phba = vport->phba; | 533 | struct lpfc_hba *phba = vport->phba; |
517 | uint32_t cnt; | 534 | uint32_t cnt; |
@@ -522,9 +539,10 @@ lpfc_max_rpi_show(struct class_device *cdev, char *buf) | |||
522 | } | 539 | } |
523 | 540 | ||
524 | static ssize_t | 541 | static ssize_t |
525 | lpfc_used_rpi_show(struct class_device *cdev, char *buf) | 542 | lpfc_used_rpi_show(struct device *dev, struct device_attribute *attr, |
543 | char *buf) | ||
526 | { | 544 | { |
527 | struct Scsi_Host *shost = class_to_shost(cdev); | 545 | struct Scsi_Host *shost = class_to_shost(dev); |
528 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 546 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
529 | struct lpfc_hba *phba = vport->phba; | 547 | struct lpfc_hba *phba = vport->phba; |
530 | uint32_t cnt, acnt; | 548 | uint32_t cnt, acnt; |
@@ -535,9 +553,10 @@ lpfc_used_rpi_show(struct class_device *cdev, char *buf) | |||
535 | } | 553 | } |
536 | 554 | ||
537 | static ssize_t | 555 | static ssize_t |
538 | lpfc_max_xri_show(struct class_device *cdev, char *buf) | 556 | lpfc_max_xri_show(struct device *dev, struct device_attribute *attr, |
557 | char *buf) | ||
539 | { | 558 | { |
540 | struct Scsi_Host *shost = class_to_shost(cdev); | 559 | struct Scsi_Host *shost = class_to_shost(dev); |
541 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 560 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
542 | struct lpfc_hba *phba = vport->phba; | 561 | struct lpfc_hba *phba = vport->phba; |
543 | uint32_t cnt; | 562 | uint32_t cnt; |
@@ -548,9 +567,10 @@ lpfc_max_xri_show(struct class_device *cdev, char *buf) | |||
548 | } | 567 | } |
549 | 568 | ||
550 | static ssize_t | 569 | static ssize_t |
551 | lpfc_used_xri_show(struct class_device *cdev, char *buf) | 570 | lpfc_used_xri_show(struct device *dev, struct device_attribute *attr, |
571 | char *buf) | ||
552 | { | 572 | { |
553 | struct Scsi_Host *shost = class_to_shost(cdev); | 573 | struct Scsi_Host *shost = class_to_shost(dev); |
554 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 574 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
555 | struct lpfc_hba *phba = vport->phba; | 575 | struct lpfc_hba *phba = vport->phba; |
556 | uint32_t cnt, acnt; | 576 | uint32_t cnt, acnt; |
@@ -561,9 +581,10 @@ lpfc_used_xri_show(struct class_device *cdev, char *buf) | |||
561 | } | 581 | } |
562 | 582 | ||
563 | static ssize_t | 583 | static ssize_t |
564 | lpfc_max_vpi_show(struct class_device *cdev, char *buf) | 584 | lpfc_max_vpi_show(struct device *dev, struct device_attribute *attr, |
585 | char *buf) | ||
565 | { | 586 | { |
566 | struct Scsi_Host *shost = class_to_shost(cdev); | 587 | struct Scsi_Host *shost = class_to_shost(dev); |
567 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 588 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
568 | struct lpfc_hba *phba = vport->phba; | 589 | struct lpfc_hba *phba = vport->phba; |
569 | uint32_t cnt; | 590 | uint32_t cnt; |
@@ -574,9 +595,10 @@ lpfc_max_vpi_show(struct class_device *cdev, char *buf) | |||
574 | } | 595 | } |
575 | 596 | ||
576 | static ssize_t | 597 | static ssize_t |
577 | lpfc_used_vpi_show(struct class_device *cdev, char *buf) | 598 | lpfc_used_vpi_show(struct device *dev, struct device_attribute *attr, |
599 | char *buf) | ||
578 | { | 600 | { |
579 | struct Scsi_Host *shost = class_to_shost(cdev); | 601 | struct Scsi_Host *shost = class_to_shost(dev); |
580 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 602 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
581 | struct lpfc_hba *phba = vport->phba; | 603 | struct lpfc_hba *phba = vport->phba; |
582 | uint32_t cnt, acnt; | 604 | uint32_t cnt, acnt; |
@@ -587,9 +609,10 @@ lpfc_used_vpi_show(struct class_device *cdev, char *buf) | |||
587 | } | 609 | } |
588 | 610 | ||
589 | static ssize_t | 611 | static ssize_t |
590 | lpfc_npiv_info_show(struct class_device *cdev, char *buf) | 612 | lpfc_npiv_info_show(struct device *dev, struct device_attribute *attr, |
613 | char *buf) | ||
591 | { | 614 | { |
592 | struct Scsi_Host *shost = class_to_shost(cdev); | 615 | struct Scsi_Host *shost = class_to_shost(dev); |
593 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 616 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
594 | struct lpfc_hba *phba = vport->phba; | 617 | struct lpfc_hba *phba = vport->phba; |
595 | 618 | ||
@@ -601,9 +624,10 @@ lpfc_npiv_info_show(struct class_device *cdev, char *buf) | |||
601 | } | 624 | } |
602 | 625 | ||
603 | static ssize_t | 626 | static ssize_t |
604 | lpfc_poll_show(struct class_device *cdev, char *buf) | 627 | lpfc_poll_show(struct device *dev, struct device_attribute *attr, |
628 | char *buf) | ||
605 | { | 629 | { |
606 | struct Scsi_Host *shost = class_to_shost(cdev); | 630 | struct Scsi_Host *shost = class_to_shost(dev); |
607 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 631 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
608 | struct lpfc_hba *phba = vport->phba; | 632 | struct lpfc_hba *phba = vport->phba; |
609 | 633 | ||
@@ -611,10 +635,10 @@ lpfc_poll_show(struct class_device *cdev, char *buf) | |||
611 | } | 635 | } |
612 | 636 | ||
613 | static ssize_t | 637 | static ssize_t |
614 | lpfc_poll_store(struct class_device *cdev, const char *buf, | 638 | lpfc_poll_store(struct device *dev, struct device_attribute *attr, |
615 | size_t count) | 639 | const char *buf, size_t count) |
616 | { | 640 | { |
617 | struct Scsi_Host *shost = class_to_shost(cdev); | 641 | struct Scsi_Host *shost = class_to_shost(dev); |
618 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 642 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
619 | struct lpfc_hba *phba = vport->phba; | 643 | struct lpfc_hba *phba = vport->phba; |
620 | uint32_t creg_val; | 644 | uint32_t creg_val; |
@@ -670,9 +694,10 @@ lpfc_poll_store(struct class_device *cdev, const char *buf, | |||
670 | 694 | ||
671 | #define lpfc_param_show(attr) \ | 695 | #define lpfc_param_show(attr) \ |
672 | static ssize_t \ | 696 | static ssize_t \ |
673 | lpfc_##attr##_show(struct class_device *cdev, char *buf) \ | 697 | lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \ |
698 | char *buf) \ | ||
674 | { \ | 699 | { \ |
675 | struct Scsi_Host *shost = class_to_shost(cdev);\ | 700 | struct Scsi_Host *shost = class_to_shost(dev);\ |
676 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ | 701 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ |
677 | struct lpfc_hba *phba = vport->phba;\ | 702 | struct lpfc_hba *phba = vport->phba;\ |
678 | int val = 0;\ | 703 | int val = 0;\ |
@@ -683,9 +708,10 @@ lpfc_##attr##_show(struct class_device *cdev, char *buf) \ | |||
683 | 708 | ||
684 | #define lpfc_param_hex_show(attr) \ | 709 | #define lpfc_param_hex_show(attr) \ |
685 | static ssize_t \ | 710 | static ssize_t \ |
686 | lpfc_##attr##_show(struct class_device *cdev, char *buf) \ | 711 | lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \ |
712 | char *buf) \ | ||
687 | { \ | 713 | { \ |
688 | struct Scsi_Host *shost = class_to_shost(cdev);\ | 714 | struct Scsi_Host *shost = class_to_shost(dev);\ |
689 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ | 715 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ |
690 | struct lpfc_hba *phba = vport->phba;\ | 716 | struct lpfc_hba *phba = vport->phba;\ |
691 | int val = 0;\ | 717 | int val = 0;\ |
@@ -725,9 +751,10 @@ lpfc_##attr##_set(struct lpfc_hba *phba, int val) \ | |||
725 | 751 | ||
726 | #define lpfc_param_store(attr) \ | 752 | #define lpfc_param_store(attr) \ |
727 | static ssize_t \ | 753 | static ssize_t \ |
728 | lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \ | 754 | lpfc_##attr##_store(struct device *dev, struct device_attribute *attr, \ |
755 | const char *buf, size_t count) \ | ||
729 | { \ | 756 | { \ |
730 | struct Scsi_Host *shost = class_to_shost(cdev);\ | 757 | struct Scsi_Host *shost = class_to_shost(dev);\ |
731 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ | 758 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ |
732 | struct lpfc_hba *phba = vport->phba;\ | 759 | struct lpfc_hba *phba = vport->phba;\ |
733 | int val=0;\ | 760 | int val=0;\ |
@@ -743,9 +770,10 @@ lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \ | |||
743 | 770 | ||
744 | #define lpfc_vport_param_show(attr) \ | 771 | #define lpfc_vport_param_show(attr) \ |
745 | static ssize_t \ | 772 | static ssize_t \ |
746 | lpfc_##attr##_show(struct class_device *cdev, char *buf) \ | 773 | lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \ |
774 | char *buf) \ | ||
747 | { \ | 775 | { \ |
748 | struct Scsi_Host *shost = class_to_shost(cdev);\ | 776 | struct Scsi_Host *shost = class_to_shost(dev);\ |
749 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ | 777 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ |
750 | int val = 0;\ | 778 | int val = 0;\ |
751 | val = vport->cfg_##attr;\ | 779 | val = vport->cfg_##attr;\ |
@@ -754,9 +782,10 @@ lpfc_##attr##_show(struct class_device *cdev, char *buf) \ | |||
754 | 782 | ||
755 | #define lpfc_vport_param_hex_show(attr) \ | 783 | #define lpfc_vport_param_hex_show(attr) \ |
756 | static ssize_t \ | 784 | static ssize_t \ |
757 | lpfc_##attr##_show(struct class_device *cdev, char *buf) \ | 785 | lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \ |
786 | char *buf) \ | ||
758 | { \ | 787 | { \ |
759 | struct Scsi_Host *shost = class_to_shost(cdev);\ | 788 | struct Scsi_Host *shost = class_to_shost(dev);\ |
760 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ | 789 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ |
761 | int val = 0;\ | 790 | int val = 0;\ |
762 | val = vport->cfg_##attr;\ | 791 | val = vport->cfg_##attr;\ |
@@ -794,9 +823,10 @@ lpfc_##attr##_set(struct lpfc_vport *vport, int val) \ | |||
794 | 823 | ||
795 | #define lpfc_vport_param_store(attr) \ | 824 | #define lpfc_vport_param_store(attr) \ |
796 | static ssize_t \ | 825 | static ssize_t \ |
797 | lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \ | 826 | lpfc_##attr##_store(struct device *dev, struct device_attribute *attr, \ |
827 | const char *buf, size_t count) \ | ||
798 | { \ | 828 | { \ |
799 | struct Scsi_Host *shost = class_to_shost(cdev);\ | 829 | struct Scsi_Host *shost = class_to_shost(dev);\ |
800 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ | 830 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ |
801 | int val=0;\ | 831 | int val=0;\ |
802 | if (!isdigit(buf[0]))\ | 832 | if (!isdigit(buf[0]))\ |
@@ -822,7 +852,7 @@ module_param(lpfc_##name, int, 0);\ | |||
822 | MODULE_PARM_DESC(lpfc_##name, desc);\ | 852 | MODULE_PARM_DESC(lpfc_##name, desc);\ |
823 | lpfc_param_show(name)\ | 853 | lpfc_param_show(name)\ |
824 | lpfc_param_init(name, defval, minval, maxval)\ | 854 | lpfc_param_init(name, defval, minval, maxval)\ |
825 | static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL) | 855 | static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL) |
826 | 856 | ||
827 | #define LPFC_ATTR_RW(name, defval, minval, maxval, desc) \ | 857 | #define LPFC_ATTR_RW(name, defval, minval, maxval, desc) \ |
828 | static int lpfc_##name = defval;\ | 858 | static int lpfc_##name = defval;\ |
@@ -832,8 +862,8 @@ lpfc_param_show(name)\ | |||
832 | lpfc_param_init(name, defval, minval, maxval)\ | 862 | lpfc_param_init(name, defval, minval, maxval)\ |
833 | lpfc_param_set(name, defval, minval, maxval)\ | 863 | lpfc_param_set(name, defval, minval, maxval)\ |
834 | lpfc_param_store(name)\ | 864 | lpfc_param_store(name)\ |
835 | static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\ | 865 | static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\ |
836 | lpfc_##name##_show, lpfc_##name##_store) | 866 | lpfc_##name##_show, lpfc_##name##_store) |
837 | 867 | ||
838 | #define LPFC_ATTR_HEX_R(name, defval, minval, maxval, desc) \ | 868 | #define LPFC_ATTR_HEX_R(name, defval, minval, maxval, desc) \ |
839 | static int lpfc_##name = defval;\ | 869 | static int lpfc_##name = defval;\ |
@@ -841,7 +871,7 @@ module_param(lpfc_##name, int, 0);\ | |||
841 | MODULE_PARM_DESC(lpfc_##name, desc);\ | 871 | MODULE_PARM_DESC(lpfc_##name, desc);\ |
842 | lpfc_param_hex_show(name)\ | 872 | lpfc_param_hex_show(name)\ |
843 | lpfc_param_init(name, defval, minval, maxval)\ | 873 | lpfc_param_init(name, defval, minval, maxval)\ |
844 | static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL) | 874 | static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL) |
845 | 875 | ||
846 | #define LPFC_ATTR_HEX_RW(name, defval, minval, maxval, desc) \ | 876 | #define LPFC_ATTR_HEX_RW(name, defval, minval, maxval, desc) \ |
847 | static int lpfc_##name = defval;\ | 877 | static int lpfc_##name = defval;\ |
@@ -851,8 +881,8 @@ lpfc_param_hex_show(name)\ | |||
851 | lpfc_param_init(name, defval, minval, maxval)\ | 881 | lpfc_param_init(name, defval, minval, maxval)\ |
852 | lpfc_param_set(name, defval, minval, maxval)\ | 882 | lpfc_param_set(name, defval, minval, maxval)\ |
853 | lpfc_param_store(name)\ | 883 | lpfc_param_store(name)\ |
854 | static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\ | 884 | static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\ |
855 | lpfc_##name##_show, lpfc_##name##_store) | 885 | lpfc_##name##_show, lpfc_##name##_store) |
856 | 886 | ||
857 | #define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \ | 887 | #define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \ |
858 | static int lpfc_##name = defval;\ | 888 | static int lpfc_##name = defval;\ |
@@ -866,7 +896,7 @@ module_param(lpfc_##name, int, 0);\ | |||
866 | MODULE_PARM_DESC(lpfc_##name, desc);\ | 896 | MODULE_PARM_DESC(lpfc_##name, desc);\ |
867 | lpfc_vport_param_show(name)\ | 897 | lpfc_vport_param_show(name)\ |
868 | lpfc_vport_param_init(name, defval, minval, maxval)\ | 898 | lpfc_vport_param_init(name, defval, minval, maxval)\ |
869 | static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL) | 899 | static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL) |
870 | 900 | ||
871 | #define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \ | 901 | #define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \ |
872 | static int lpfc_##name = defval;\ | 902 | static int lpfc_##name = defval;\ |
@@ -876,8 +906,8 @@ lpfc_vport_param_show(name)\ | |||
876 | lpfc_vport_param_init(name, defval, minval, maxval)\ | 906 | lpfc_vport_param_init(name, defval, minval, maxval)\ |
877 | lpfc_vport_param_set(name, defval, minval, maxval)\ | 907 | lpfc_vport_param_set(name, defval, minval, maxval)\ |
878 | lpfc_vport_param_store(name)\ | 908 | lpfc_vport_param_store(name)\ |
879 | static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\ | 909 | static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\ |
880 | lpfc_##name##_show, lpfc_##name##_store) | 910 | lpfc_##name##_show, lpfc_##name##_store) |
881 | 911 | ||
882 | #define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \ | 912 | #define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \ |
883 | static int lpfc_##name = defval;\ | 913 | static int lpfc_##name = defval;\ |
@@ -885,7 +915,7 @@ module_param(lpfc_##name, int, 0);\ | |||
885 | MODULE_PARM_DESC(lpfc_##name, desc);\ | 915 | MODULE_PARM_DESC(lpfc_##name, desc);\ |
886 | lpfc_vport_param_hex_show(name)\ | 916 | lpfc_vport_param_hex_show(name)\ |
887 | lpfc_vport_param_init(name, defval, minval, maxval)\ | 917 | lpfc_vport_param_init(name, defval, minval, maxval)\ |
888 | static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL) | 918 | static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL) |
889 | 919 | ||
890 | #define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \ | 920 | #define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \ |
891 | static int lpfc_##name = defval;\ | 921 | static int lpfc_##name = defval;\ |
@@ -895,46 +925,44 @@ lpfc_vport_param_hex_show(name)\ | |||
895 | lpfc_vport_param_init(name, defval, minval, maxval)\ | 925 | lpfc_vport_param_init(name, defval, minval, maxval)\ |
896 | lpfc_vport_param_set(name, defval, minval, maxval)\ | 926 | lpfc_vport_param_set(name, defval, minval, maxval)\ |
897 | lpfc_vport_param_store(name)\ | 927 | lpfc_vport_param_store(name)\ |
898 | static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\ | 928 | static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\ |
899 | lpfc_##name##_show, lpfc_##name##_store) | 929 | lpfc_##name##_show, lpfc_##name##_store) |
900 | 930 | ||
901 | static CLASS_DEVICE_ATTR(info, S_IRUGO, lpfc_info_show, NULL); | 931 | static DEVICE_ATTR(info, S_IRUGO, lpfc_info_show, NULL); |
902 | static CLASS_DEVICE_ATTR(serialnum, S_IRUGO, lpfc_serialnum_show, NULL); | 932 | static DEVICE_ATTR(serialnum, S_IRUGO, lpfc_serialnum_show, NULL); |
903 | static CLASS_DEVICE_ATTR(modeldesc, S_IRUGO, lpfc_modeldesc_show, NULL); | 933 | static DEVICE_ATTR(modeldesc, S_IRUGO, lpfc_modeldesc_show, NULL); |
904 | static CLASS_DEVICE_ATTR(modelname, S_IRUGO, lpfc_modelname_show, NULL); | 934 | static DEVICE_ATTR(modelname, S_IRUGO, lpfc_modelname_show, NULL); |
905 | static CLASS_DEVICE_ATTR(programtype, S_IRUGO, lpfc_programtype_show, NULL); | 935 | static DEVICE_ATTR(programtype, S_IRUGO, lpfc_programtype_show, NULL); |
906 | static CLASS_DEVICE_ATTR(portnum, S_IRUGO, lpfc_vportnum_show, NULL); | 936 | static DEVICE_ATTR(portnum, S_IRUGO, lpfc_vportnum_show, NULL); |
907 | static CLASS_DEVICE_ATTR(fwrev, S_IRUGO, lpfc_fwrev_show, NULL); | 937 | static DEVICE_ATTR(fwrev, S_IRUGO, lpfc_fwrev_show, NULL); |
908 | static CLASS_DEVICE_ATTR(hdw, S_IRUGO, lpfc_hdw_show, NULL); | 938 | static DEVICE_ATTR(hdw, S_IRUGO, lpfc_hdw_show, NULL); |
909 | static CLASS_DEVICE_ATTR(state, S_IRUGO, lpfc_state_show, NULL); | 939 | static DEVICE_ATTR(state, S_IRUGO, lpfc_state_show, NULL); |
910 | static CLASS_DEVICE_ATTR(option_rom_version, S_IRUGO, | 940 | static DEVICE_ATTR(option_rom_version, S_IRUGO, |
911 | lpfc_option_rom_version_show, NULL); | 941 | lpfc_option_rom_version_show, NULL); |
912 | static CLASS_DEVICE_ATTR(num_discovered_ports, S_IRUGO, | 942 | static DEVICE_ATTR(num_discovered_ports, S_IRUGO, |
913 | lpfc_num_discovered_ports_show, NULL); | 943 | lpfc_num_discovered_ports_show, NULL); |
914 | static CLASS_DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL); | 944 | static DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL); |
915 | static CLASS_DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show, | 945 | static DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show, NULL); |
916 | NULL); | 946 | static DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR, |
917 | static CLASS_DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR, | 947 | lpfc_board_mode_show, lpfc_board_mode_store); |
918 | lpfc_board_mode_show, lpfc_board_mode_store); | 948 | static DEVICE_ATTR(issue_reset, S_IWUSR, NULL, lpfc_issue_reset); |
919 | static CLASS_DEVICE_ATTR(issue_reset, S_IWUSR, NULL, lpfc_issue_reset); | 949 | static DEVICE_ATTR(max_vpi, S_IRUGO, lpfc_max_vpi_show, NULL); |
920 | static CLASS_DEVICE_ATTR(max_vpi, S_IRUGO, lpfc_max_vpi_show, NULL); | 950 | static DEVICE_ATTR(used_vpi, S_IRUGO, lpfc_used_vpi_show, NULL); |
921 | static CLASS_DEVICE_ATTR(used_vpi, S_IRUGO, lpfc_used_vpi_show, NULL); | 951 | static DEVICE_ATTR(max_rpi, S_IRUGO, lpfc_max_rpi_show, NULL); |
922 | static CLASS_DEVICE_ATTR(max_rpi, S_IRUGO, lpfc_max_rpi_show, NULL); | 952 | static DEVICE_ATTR(used_rpi, S_IRUGO, lpfc_used_rpi_show, NULL); |
923 | static CLASS_DEVICE_ATTR(used_rpi, S_IRUGO, lpfc_used_rpi_show, NULL); | 953 | static DEVICE_ATTR(max_xri, S_IRUGO, lpfc_max_xri_show, NULL); |
924 | static CLASS_DEVICE_ATTR(max_xri, S_IRUGO, lpfc_max_xri_show, NULL); | 954 | static DEVICE_ATTR(used_xri, S_IRUGO, lpfc_used_xri_show, NULL); |
925 | static CLASS_DEVICE_ATTR(used_xri, S_IRUGO, lpfc_used_xri_show, NULL); | 955 | static DEVICE_ATTR(npiv_info, S_IRUGO, lpfc_npiv_info_show, NULL); |
926 | static CLASS_DEVICE_ATTR(npiv_info, S_IRUGO, lpfc_npiv_info_show, NULL); | 956 | static DEVICE_ATTR(lpfc_temp_sensor, S_IRUGO, lpfc_temp_sensor_show, NULL); |
927 | static CLASS_DEVICE_ATTR(lpfc_temp_sensor, S_IRUGO, lpfc_temp_sensor_show, | ||
928 | NULL); | ||
929 | 957 | ||
930 | 958 | ||
931 | static char *lpfc_soft_wwn_key = "C99G71SL8032A"; | 959 | static char *lpfc_soft_wwn_key = "C99G71SL8032A"; |
932 | 960 | ||
933 | static ssize_t | 961 | static ssize_t |
934 | lpfc_soft_wwn_enable_store(struct class_device *cdev, const char *buf, | 962 | lpfc_soft_wwn_enable_store(struct device *dev, struct device_attribute *attr, |
935 | size_t count) | 963 | const char *buf, size_t count) |
936 | { | 964 | { |
937 | struct Scsi_Host *shost = class_to_shost(cdev); | 965 | struct Scsi_Host *shost = class_to_shost(dev); |
938 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 966 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
939 | struct lpfc_hba *phba = vport->phba; | 967 | struct lpfc_hba *phba = vport->phba; |
940 | unsigned int cnt = count; | 968 | unsigned int cnt = count; |
@@ -963,13 +991,14 @@ lpfc_soft_wwn_enable_store(struct class_device *cdev, const char *buf, | |||
963 | phba->soft_wwn_enable = 1; | 991 | phba->soft_wwn_enable = 1; |
964 | return count; | 992 | return count; |
965 | } | 993 | } |
966 | static CLASS_DEVICE_ATTR(lpfc_soft_wwn_enable, S_IWUSR, NULL, | 994 | static DEVICE_ATTR(lpfc_soft_wwn_enable, S_IWUSR, NULL, |
967 | lpfc_soft_wwn_enable_store); | 995 | lpfc_soft_wwn_enable_store); |
968 | 996 | ||
969 | static ssize_t | 997 | static ssize_t |
970 | lpfc_soft_wwpn_show(struct class_device *cdev, char *buf) | 998 | lpfc_soft_wwpn_show(struct device *dev, struct device_attribute *attr, |
999 | char *buf) | ||
971 | { | 1000 | { |
972 | struct Scsi_Host *shost = class_to_shost(cdev); | 1001 | struct Scsi_Host *shost = class_to_shost(dev); |
973 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 1002 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
974 | struct lpfc_hba *phba = vport->phba; | 1003 | struct lpfc_hba *phba = vport->phba; |
975 | 1004 | ||
@@ -979,9 +1008,10 @@ lpfc_soft_wwpn_show(struct class_device *cdev, char *buf) | |||
979 | 1008 | ||
980 | 1009 | ||
981 | static ssize_t | 1010 | static ssize_t |
982 | lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count) | 1011 | lpfc_soft_wwpn_store(struct device *dev, struct device_attribute *attr, |
1012 | const char *buf, size_t count) | ||
983 | { | 1013 | { |
984 | struct Scsi_Host *shost = class_to_shost(cdev); | 1014 | struct Scsi_Host *shost = class_to_shost(dev); |
985 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 1015 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
986 | struct lpfc_hba *phba = vport->phba; | 1016 | struct lpfc_hba *phba = vport->phba; |
987 | struct completion online_compl; | 1017 | struct completion online_compl; |
@@ -1047,13 +1077,14 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count) | |||
1047 | "reinit adapter - %d\n", stat2); | 1077 | "reinit adapter - %d\n", stat2); |
1048 | return (stat1 || stat2) ? -EIO : count; | 1078 | return (stat1 || stat2) ? -EIO : count; |
1049 | } | 1079 | } |
1050 | static CLASS_DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,\ | 1080 | static DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,\ |
1051 | lpfc_soft_wwpn_show, lpfc_soft_wwpn_store); | 1081 | lpfc_soft_wwpn_show, lpfc_soft_wwpn_store); |
1052 | 1082 | ||
1053 | static ssize_t | 1083 | static ssize_t |
1054 | lpfc_soft_wwnn_show(struct class_device *cdev, char *buf) | 1084 | lpfc_soft_wwnn_show(struct device *dev, struct device_attribute *attr, |
1085 | char *buf) | ||
1055 | { | 1086 | { |
1056 | struct Scsi_Host *shost = class_to_shost(cdev); | 1087 | struct Scsi_Host *shost = class_to_shost(dev); |
1057 | struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; | 1088 | struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; |
1058 | return snprintf(buf, PAGE_SIZE, "0x%llx\n", | 1089 | return snprintf(buf, PAGE_SIZE, "0x%llx\n", |
1059 | (unsigned long long)phba->cfg_soft_wwnn); | 1090 | (unsigned long long)phba->cfg_soft_wwnn); |
@@ -1061,9 +1092,10 @@ lpfc_soft_wwnn_show(struct class_device *cdev, char *buf) | |||
1061 | 1092 | ||
1062 | 1093 | ||
1063 | static ssize_t | 1094 | static ssize_t |
1064 | lpfc_soft_wwnn_store(struct class_device *cdev, const char *buf, size_t count) | 1095 | lpfc_soft_wwnn_store(struct device *dev, struct device_attribute *attr, |
1096 | const char *buf, size_t count) | ||
1065 | { | 1097 | { |
1066 | struct Scsi_Host *shost = class_to_shost(cdev); | 1098 | struct Scsi_Host *shost = class_to_shost(dev); |
1067 | struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; | 1099 | struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; |
1068 | unsigned int i, j, cnt=count; | 1100 | unsigned int i, j, cnt=count; |
1069 | u8 wwnn[8]; | 1101 | u8 wwnn[8]; |
@@ -1107,8 +1139,8 @@ lpfc_soft_wwnn_store(struct class_device *cdev, const char *buf, size_t count) | |||
1107 | 1139 | ||
1108 | return count; | 1140 | return count; |
1109 | } | 1141 | } |
1110 | static CLASS_DEVICE_ATTR(lpfc_soft_wwnn, S_IRUGO | S_IWUSR,\ | 1142 | static DEVICE_ATTR(lpfc_soft_wwnn, S_IRUGO | S_IWUSR,\ |
1111 | lpfc_soft_wwnn_show, lpfc_soft_wwnn_store); | 1143 | lpfc_soft_wwnn_show, lpfc_soft_wwnn_store); |
1112 | 1144 | ||
1113 | 1145 | ||
1114 | static int lpfc_poll = 0; | 1146 | static int lpfc_poll = 0; |
@@ -1118,8 +1150,8 @@ MODULE_PARM_DESC(lpfc_poll, "FCP ring polling mode control:" | |||
1118 | " 1 - poll with interrupts enabled" | 1150 | " 1 - poll with interrupts enabled" |
1119 | " 3 - poll and disable FCP ring interrupts"); | 1151 | " 3 - poll and disable FCP ring interrupts"); |
1120 | 1152 | ||
1121 | static CLASS_DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR, | 1153 | static DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR, |
1122 | lpfc_poll_show, lpfc_poll_store); | 1154 | lpfc_poll_show, lpfc_poll_store); |
1123 | 1155 | ||
1124 | int lpfc_sli_mode = 0; | 1156 | int lpfc_sli_mode = 0; |
1125 | module_param(lpfc_sli_mode, int, 0); | 1157 | module_param(lpfc_sli_mode, int, 0); |
@@ -1133,7 +1165,7 @@ module_param(lpfc_enable_npiv, int, 0); | |||
1133 | MODULE_PARM_DESC(lpfc_enable_npiv, "Enable NPIV functionality"); | 1165 | MODULE_PARM_DESC(lpfc_enable_npiv, "Enable NPIV functionality"); |
1134 | lpfc_param_show(enable_npiv); | 1166 | lpfc_param_show(enable_npiv); |
1135 | lpfc_param_init(enable_npiv, 0, 0, 1); | 1167 | lpfc_param_init(enable_npiv, 0, 0, 1); |
1136 | static CLASS_DEVICE_ATTR(lpfc_enable_npiv, S_IRUGO, | 1168 | static DEVICE_ATTR(lpfc_enable_npiv, S_IRUGO, |
1137 | lpfc_enable_npiv_show, NULL); | 1169 | lpfc_enable_npiv_show, NULL); |
1138 | 1170 | ||
1139 | /* | 1171 | /* |
@@ -1147,9 +1179,10 @@ MODULE_PARM_DESC(lpfc_nodev_tmo, | |||
1147 | "Seconds driver will hold I/O waiting " | 1179 | "Seconds driver will hold I/O waiting " |
1148 | "for a device to come back"); | 1180 | "for a device to come back"); |
1149 | static ssize_t | 1181 | static ssize_t |
1150 | lpfc_nodev_tmo_show(struct class_device *cdev, char *buf) | 1182 | lpfc_nodev_tmo_show(struct device *dev, struct device_attribute *attr, |
1183 | char *buf) | ||
1151 | { | 1184 | { |
1152 | struct Scsi_Host *shost = class_to_shost(cdev); | 1185 | struct Scsi_Host *shost = class_to_shost(dev); |
1153 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 1186 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
1154 | int val = 0; | 1187 | int val = 0; |
1155 | val = vport->cfg_devloss_tmo; | 1188 | val = vport->cfg_devloss_tmo; |
@@ -1221,8 +1254,8 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val) | |||
1221 | 1254 | ||
1222 | lpfc_vport_param_store(nodev_tmo) | 1255 | lpfc_vport_param_store(nodev_tmo) |
1223 | 1256 | ||
1224 | static CLASS_DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR, | 1257 | static DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR, |
1225 | lpfc_nodev_tmo_show, lpfc_nodev_tmo_store); | 1258 | lpfc_nodev_tmo_show, lpfc_nodev_tmo_store); |
1226 | 1259 | ||
1227 | /* | 1260 | /* |
1228 | # lpfc_devloss_tmo: If set, it will hold all I/O errors on devices that | 1261 | # lpfc_devloss_tmo: If set, it will hold all I/O errors on devices that |
@@ -1255,8 +1288,8 @@ lpfc_devloss_tmo_set(struct lpfc_vport *vport, int val) | |||
1255 | } | 1288 | } |
1256 | 1289 | ||
1257 | lpfc_vport_param_store(devloss_tmo) | 1290 | lpfc_vport_param_store(devloss_tmo) |
1258 | static CLASS_DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR, | 1291 | static DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR, |
1259 | lpfc_devloss_tmo_show, lpfc_devloss_tmo_store); | 1292 | lpfc_devloss_tmo_show, lpfc_devloss_tmo_store); |
1260 | 1293 | ||
1261 | /* | 1294 | /* |
1262 | # lpfc_log_verbose: Only turn this flag on if you are willing to risk being | 1295 | # lpfc_log_verbose: Only turn this flag on if you are willing to risk being |
@@ -1374,8 +1407,8 @@ lpfc_restrict_login_set(struct lpfc_vport *vport, int val) | |||
1374 | return 0; | 1407 | return 0; |
1375 | } | 1408 | } |
1376 | lpfc_vport_param_store(restrict_login); | 1409 | lpfc_vport_param_store(restrict_login); |
1377 | static CLASS_DEVICE_ATTR(lpfc_restrict_login, S_IRUGO | S_IWUSR, | 1410 | static DEVICE_ATTR(lpfc_restrict_login, S_IRUGO | S_IWUSR, |
1378 | lpfc_restrict_login_show, lpfc_restrict_login_store); | 1411 | lpfc_restrict_login_show, lpfc_restrict_login_store); |
1379 | 1412 | ||
1380 | /* | 1413 | /* |
1381 | # Some disk devices have a "select ID" or "select Target" capability. | 1414 | # Some disk devices have a "select ID" or "select Target" capability. |
@@ -1433,7 +1466,7 @@ MODULE_PARM_DESC(lpfc_topology, "Select Fibre Channel topology"); | |||
1433 | lpfc_param_show(topology) | 1466 | lpfc_param_show(topology) |
1434 | lpfc_param_init(topology, 0, 0, 6) | 1467 | lpfc_param_init(topology, 0, 0, 6) |
1435 | lpfc_param_store(topology) | 1468 | lpfc_param_store(topology) |
1436 | static CLASS_DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR, | 1469 | static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR, |
1437 | lpfc_topology_show, lpfc_topology_store); | 1470 | lpfc_topology_show, lpfc_topology_store); |
1438 | 1471 | ||
1439 | /* | 1472 | /* |
@@ -1497,7 +1530,7 @@ lpfc_link_speed_init(struct lpfc_hba *phba, int val) | |||
1497 | } | 1530 | } |
1498 | 1531 | ||
1499 | lpfc_param_store(link_speed) | 1532 | lpfc_param_store(link_speed) |
1500 | static CLASS_DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR, | 1533 | static DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR, |
1501 | lpfc_link_speed_show, lpfc_link_speed_store); | 1534 | lpfc_link_speed_show, lpfc_link_speed_store); |
1502 | 1535 | ||
1503 | /* | 1536 | /* |
@@ -1623,82 +1656,81 @@ LPFC_ATTR_R(enable_hba_heartbeat, 1, 0, 1, "Enable HBA Heartbeat."); | |||
1623 | LPFC_ATTR_R(sg_seg_cnt, LPFC_DEFAULT_SG_SEG_CNT, LPFC_DEFAULT_SG_SEG_CNT, | 1656 | LPFC_ATTR_R(sg_seg_cnt, LPFC_DEFAULT_SG_SEG_CNT, LPFC_DEFAULT_SG_SEG_CNT, |
1624 | LPFC_MAX_SG_SEG_CNT, "Max Scatter Gather Segment Count"); | 1657 | LPFC_MAX_SG_SEG_CNT, "Max Scatter Gather Segment Count"); |
1625 | 1658 | ||
1626 | struct class_device_attribute *lpfc_hba_attrs[] = { | 1659 | struct device_attribute *lpfc_hba_attrs[] = { |
1627 | &class_device_attr_info, | 1660 | &dev_attr_info, |
1628 | &class_device_attr_serialnum, | 1661 | &dev_attr_serialnum, |
1629 | &class_device_attr_modeldesc, | 1662 | &dev_attr_modeldesc, |
1630 | &class_device_attr_modelname, | 1663 | &dev_attr_modelname, |
1631 | &class_device_attr_programtype, | 1664 | &dev_attr_programtype, |
1632 | &class_device_attr_portnum, | 1665 | &dev_attr_portnum, |
1633 | &class_device_attr_fwrev, | 1666 | &dev_attr_fwrev, |
1634 | &class_device_attr_hdw, | 1667 | &dev_attr_hdw, |
1635 | &class_device_attr_option_rom_version, | 1668 | &dev_attr_option_rom_version, |
1636 | &class_device_attr_state, | 1669 | &dev_attr_state, |
1637 | &class_device_attr_num_discovered_ports, | 1670 | &dev_attr_num_discovered_ports, |
1638 | &class_device_attr_lpfc_drvr_version, | 1671 | &dev_attr_lpfc_drvr_version, |
1639 | &class_device_attr_lpfc_temp_sensor, | 1672 | &dev_attr_lpfc_temp_sensor, |
1640 | &class_device_attr_lpfc_log_verbose, | 1673 | &dev_attr_lpfc_log_verbose, |
1641 | &class_device_attr_lpfc_lun_queue_depth, | 1674 | &dev_attr_lpfc_lun_queue_depth, |
1642 | &class_device_attr_lpfc_hba_queue_depth, | 1675 | &dev_attr_lpfc_hba_queue_depth, |
1643 | &class_device_attr_lpfc_peer_port_login, | 1676 | &dev_attr_lpfc_peer_port_login, |
1644 | &class_device_attr_lpfc_nodev_tmo, | 1677 | &dev_attr_lpfc_nodev_tmo, |
1645 | &class_device_attr_lpfc_devloss_tmo, | 1678 | &dev_attr_lpfc_devloss_tmo, |
1646 | &class_device_attr_lpfc_fcp_class, | 1679 | &dev_attr_lpfc_fcp_class, |
1647 | &class_device_attr_lpfc_use_adisc, | 1680 | &dev_attr_lpfc_use_adisc, |
1648 | &class_device_attr_lpfc_ack0, | 1681 | &dev_attr_lpfc_ack0, |
1649 | &class_device_attr_lpfc_topology, | 1682 | &dev_attr_lpfc_topology, |
1650 | &class_device_attr_lpfc_scan_down, | 1683 | &dev_attr_lpfc_scan_down, |
1651 | &class_device_attr_lpfc_link_speed, | 1684 | &dev_attr_lpfc_link_speed, |
1652 | &class_device_attr_lpfc_cr_delay, | 1685 | &dev_attr_lpfc_cr_delay, |
1653 | &class_device_attr_lpfc_cr_count, | 1686 | &dev_attr_lpfc_cr_count, |
1654 | &class_device_attr_lpfc_multi_ring_support, | 1687 | &dev_attr_lpfc_multi_ring_support, |
1655 | &class_device_attr_lpfc_multi_ring_rctl, | 1688 | &dev_attr_lpfc_multi_ring_rctl, |
1656 | &class_device_attr_lpfc_multi_ring_type, | 1689 | &dev_attr_lpfc_multi_ring_type, |
1657 | &class_device_attr_lpfc_fdmi_on, | 1690 | &dev_attr_lpfc_fdmi_on, |
1658 | &class_device_attr_lpfc_max_luns, | 1691 | &dev_attr_lpfc_max_luns, |
1659 | &class_device_attr_lpfc_enable_npiv, | 1692 | &dev_attr_lpfc_enable_npiv, |
1660 | &class_device_attr_nport_evt_cnt, | 1693 | &dev_attr_nport_evt_cnt, |
1661 | &class_device_attr_board_mode, | 1694 | &dev_attr_board_mode, |
1662 | &class_device_attr_max_vpi, | 1695 | &dev_attr_max_vpi, |
1663 | &class_device_attr_used_vpi, | 1696 | &dev_attr_used_vpi, |
1664 | &class_device_attr_max_rpi, | 1697 | &dev_attr_max_rpi, |
1665 | &class_device_attr_used_rpi, | 1698 | &dev_attr_used_rpi, |
1666 | &class_device_attr_max_xri, | 1699 | &dev_attr_max_xri, |
1667 | &class_device_attr_used_xri, | 1700 | &dev_attr_used_xri, |
1668 | &class_device_attr_npiv_info, | 1701 | &dev_attr_npiv_info, |
1669 | &class_device_attr_issue_reset, | 1702 | &dev_attr_issue_reset, |
1670 | &class_device_attr_lpfc_poll, | 1703 | &dev_attr_lpfc_poll, |
1671 | &class_device_attr_lpfc_poll_tmo, | 1704 | &dev_attr_lpfc_poll_tmo, |
1672 | &class_device_attr_lpfc_use_msi, | 1705 | &dev_attr_lpfc_use_msi, |
1673 | &class_device_attr_lpfc_soft_wwnn, | 1706 | &dev_attr_lpfc_soft_wwnn, |
1674 | &class_device_attr_lpfc_soft_wwpn, | 1707 | &dev_attr_lpfc_soft_wwpn, |
1675 | &class_device_attr_lpfc_soft_wwn_enable, | 1708 | &dev_attr_lpfc_soft_wwn_enable, |
1676 | &class_device_attr_lpfc_enable_hba_reset, | 1709 | &dev_attr_lpfc_enable_hba_reset, |
1677 | &class_device_attr_lpfc_enable_hba_heartbeat, | 1710 | &dev_attr_lpfc_enable_hba_heartbeat, |
1678 | &class_device_attr_lpfc_sg_seg_cnt, | 1711 | &dev_attr_lpfc_sg_seg_cnt, |
1679 | NULL, | 1712 | NULL, |
1680 | }; | 1713 | }; |
1681 | 1714 | ||
1682 | struct class_device_attribute *lpfc_vport_attrs[] = { | 1715 | struct device_attribute *lpfc_vport_attrs[] = { |
1683 | &class_device_attr_info, | 1716 | &dev_attr_info, |
1684 | &class_device_attr_state, | 1717 | &dev_attr_state, |
1685 | &class_device_attr_num_discovered_ports, | 1718 | &dev_attr_num_discovered_ports, |
1686 | &class_device_attr_lpfc_drvr_version, | 1719 | &dev_attr_lpfc_drvr_version, |
1687 | 1720 | &dev_attr_lpfc_log_verbose, | |
1688 | &class_device_attr_lpfc_log_verbose, | 1721 | &dev_attr_lpfc_lun_queue_depth, |
1689 | &class_device_attr_lpfc_lun_queue_depth, | 1722 | &dev_attr_lpfc_nodev_tmo, |
1690 | &class_device_attr_lpfc_nodev_tmo, | 1723 | &dev_attr_lpfc_devloss_tmo, |
1691 | &class_device_attr_lpfc_devloss_tmo, | 1724 | &dev_attr_lpfc_hba_queue_depth, |
1692 | &class_device_attr_lpfc_hba_queue_depth, | 1725 | &dev_attr_lpfc_peer_port_login, |
1693 | &class_device_attr_lpfc_peer_port_login, | 1726 | &dev_attr_lpfc_restrict_login, |
1694 | &class_device_attr_lpfc_restrict_login, | 1727 | &dev_attr_lpfc_fcp_class, |
1695 | &class_device_attr_lpfc_fcp_class, | 1728 | &dev_attr_lpfc_use_adisc, |
1696 | &class_device_attr_lpfc_use_adisc, | 1729 | &dev_attr_lpfc_fdmi_on, |
1697 | &class_device_attr_lpfc_fdmi_on, | 1730 | &dev_attr_lpfc_max_luns, |
1698 | &class_device_attr_lpfc_max_luns, | 1731 | &dev_attr_nport_evt_cnt, |
1699 | &class_device_attr_nport_evt_cnt, | 1732 | &dev_attr_npiv_info, |
1700 | &class_device_attr_npiv_info, | 1733 | &dev_attr_lpfc_enable_da_id, |
1701 | &class_device_attr_lpfc_enable_da_id, | ||
1702 | NULL, | 1734 | NULL, |
1703 | }; | 1735 | }; |
1704 | 1736 | ||
@@ -1707,9 +1739,8 @@ sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
1707 | char *buf, loff_t off, size_t count) | 1739 | char *buf, loff_t off, size_t count) |
1708 | { | 1740 | { |
1709 | size_t buf_off; | 1741 | size_t buf_off; |
1710 | struct class_device *cdev = container_of(kobj, struct class_device, | 1742 | struct device *dev = container_of(kobj, struct device, kobj); |
1711 | kobj); | 1743 | struct Scsi_Host *shost = class_to_shost(dev); |
1712 | struct Scsi_Host *shost = class_to_shost(cdev); | ||
1713 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 1744 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
1714 | struct lpfc_hba *phba = vport->phba; | 1745 | struct lpfc_hba *phba = vport->phba; |
1715 | 1746 | ||
@@ -1741,9 +1772,8 @@ sysfs_ctlreg_read(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
1741 | { | 1772 | { |
1742 | size_t buf_off; | 1773 | size_t buf_off; |
1743 | uint32_t * tmp_ptr; | 1774 | uint32_t * tmp_ptr; |
1744 | struct class_device *cdev = container_of(kobj, struct class_device, | 1775 | struct device *dev = container_of(kobj, struct device, kobj); |
1745 | kobj); | 1776 | struct Scsi_Host *shost = class_to_shost(dev); |
1746 | struct Scsi_Host *shost = class_to_shost(cdev); | ||
1747 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 1777 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
1748 | struct lpfc_hba *phba = vport->phba; | 1778 | struct lpfc_hba *phba = vport->phba; |
1749 | 1779 | ||
@@ -1798,9 +1828,8 @@ static ssize_t | |||
1798 | sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr, | 1828 | sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr, |
1799 | char *buf, loff_t off, size_t count) | 1829 | char *buf, loff_t off, size_t count) |
1800 | { | 1830 | { |
1801 | struct class_device *cdev = container_of(kobj, struct class_device, | 1831 | struct device *dev = container_of(kobj, struct device, kobj); |
1802 | kobj); | 1832 | struct Scsi_Host *shost = class_to_shost(dev); |
1803 | struct Scsi_Host *shost = class_to_shost(cdev); | ||
1804 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 1833 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
1805 | struct lpfc_hba *phba = vport->phba; | 1834 | struct lpfc_hba *phba = vport->phba; |
1806 | struct lpfcMboxq *mbox = NULL; | 1835 | struct lpfcMboxq *mbox = NULL; |
@@ -1853,9 +1882,8 @@ static ssize_t | |||
1853 | sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr, | 1882 | sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr, |
1854 | char *buf, loff_t off, size_t count) | 1883 | char *buf, loff_t off, size_t count) |
1855 | { | 1884 | { |
1856 | struct class_device *cdev = container_of(kobj, struct class_device, | 1885 | struct device *dev = container_of(kobj, struct device, kobj); |
1857 | kobj); | 1886 | struct Scsi_Host *shost = class_to_shost(dev); |
1858 | struct Scsi_Host *shost = class_to_shost(cdev); | ||
1859 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 1887 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
1860 | struct lpfc_hba *phba = vport->phba; | 1888 | struct lpfc_hba *phba = vport->phba; |
1861 | int rc; | 1889 | int rc; |
@@ -2038,19 +2066,19 @@ lpfc_alloc_sysfs_attr(struct lpfc_vport *vport) | |||
2038 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | 2066 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
2039 | int error; | 2067 | int error; |
2040 | 2068 | ||
2041 | error = sysfs_create_bin_file(&shost->shost_classdev.kobj, | 2069 | error = sysfs_create_bin_file(&shost->shost_dev.kobj, |
2042 | &sysfs_ctlreg_attr); | 2070 | &sysfs_ctlreg_attr); |
2043 | if (error) | 2071 | if (error) |
2044 | goto out; | 2072 | goto out; |
2045 | 2073 | ||
2046 | error = sysfs_create_bin_file(&shost->shost_classdev.kobj, | 2074 | error = sysfs_create_bin_file(&shost->shost_dev.kobj, |
2047 | &sysfs_mbox_attr); | 2075 | &sysfs_mbox_attr); |
2048 | if (error) | 2076 | if (error) |
2049 | goto out_remove_ctlreg_attr; | 2077 | goto out_remove_ctlreg_attr; |
2050 | 2078 | ||
2051 | return 0; | 2079 | return 0; |
2052 | out_remove_ctlreg_attr: | 2080 | out_remove_ctlreg_attr: |
2053 | sysfs_remove_bin_file(&shost->shost_classdev.kobj, &sysfs_ctlreg_attr); | 2081 | sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_ctlreg_attr); |
2054 | out: | 2082 | out: |
2055 | return error; | 2083 | return error; |
2056 | } | 2084 | } |
@@ -2060,8 +2088,8 @@ lpfc_free_sysfs_attr(struct lpfc_vport *vport) | |||
2060 | { | 2088 | { |
2061 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | 2089 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
2062 | 2090 | ||
2063 | sysfs_remove_bin_file(&shost->shost_classdev.kobj, &sysfs_mbox_attr); | 2091 | sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_mbox_attr); |
2064 | sysfs_remove_bin_file(&shost->shost_classdev.kobj, &sysfs_ctlreg_attr); | 2092 | sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_ctlreg_attr); |
2065 | } | 2093 | } |
2066 | 2094 | ||
2067 | 2095 | ||
@@ -2443,9 +2471,11 @@ lpfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) | |||
2443 | 2471 | ||
2444 | #define lpfc_rport_show_function(field, format_string, sz, cast) \ | 2472 | #define lpfc_rport_show_function(field, format_string, sz, cast) \ |
2445 | static ssize_t \ | 2473 | static ssize_t \ |
2446 | lpfc_show_rport_##field (struct class_device *cdev, char *buf) \ | 2474 | lpfc_show_rport_##field (struct device *dev, \ |
2475 | struct device_attribute *attr, \ | ||
2476 | char *buf) \ | ||
2447 | { \ | 2477 | { \ |
2448 | struct fc_rport *rport = transport_class_to_rport(cdev); \ | 2478 | struct fc_rport *rport = transport_class_to_rport(dev); \ |
2449 | struct lpfc_rport_data *rdata = rport->hostdata; \ | 2479 | struct lpfc_rport_data *rdata = rport->hostdata; \ |
2450 | return snprintf(buf, sz, format_string, \ | 2480 | return snprintf(buf, sz, format_string, \ |
2451 | (rdata->target) ? cast rdata->target->field : 0); \ | 2481 | (rdata->target) ? cast rdata->target->field : 0); \ |