blob: 9c86481f779f7901e3a615f4f24aa100ee4195d5 [file] [log] [blame]
Erich Chen1c57e862006-07-12 08:59:32 -07001/*
2*******************************************************************************
3** O.S : Linux
4** FILE NAME : arcmsr_attr.c
NickCheng97b99122011-01-06 17:32:41 +08005** BY : Nick Cheng
Erich Chen1c57e862006-07-12 08:59:32 -07006** Description: attributes exported to sysfs and device host
7*******************************************************************************
8** Copyright (C) 2002 - 2005, Areca Technology Corporation All rights reserved
9**
10** Web site: www.areca.com.tw
Nick Cheng1a4f5502007-09-13 17:26:40 +080011** E-mail: support@areca.com.tw
Erich Chen1c57e862006-07-12 08:59:32 -070012**
13** This program is free software; you can redistribute it and/or modify
14** it under the terms of the GNU General Public License version 2 as
15** published by the Free Software Foundation.
16** This program is distributed in the hope that it will be useful,
17** but WITHOUT ANY WARRANTY; without even the implied warranty of
18** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19** GNU General Public License for more details.
20*******************************************************************************
21** Redistribution and use in source and binary forms, with or without
22** modification, are permitted provided that the following conditions
23** are met:
24** 1. Redistributions of source code must retain the above copyright
25** notice, this list of conditions and the following disclaimer.
26** 2. Redistributions in binary form must reproduce the above copyright
27** notice, this list of conditions and the following disclaimer in the
28** documentation and/or other materials provided with the distribution.
29** 3. The name of the author may not be used to endorse or promote products
30** derived from this software without specific prior written permission.
31**
32** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
33** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
34** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
35** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
36** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING,BUT
37** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
38** DATA, OR PROFITS; OR BUSINESS INTERRUPTION)HOWEVER CAUSED AND ON ANY
39** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40** (INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY OUT OF THE USE OF
41** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42*******************************************************************************
43** For history of changes, see Documentation/scsi/ChangeLog.arcmsr
44** Firmware Specification, see Documentation/scsi/arcmsr_spec.txt
45*******************************************************************************
46*/
47#include <linux/module.h>
48#include <linux/kernel.h>
49#include <linux/init.h>
50#include <linux/errno.h>
51#include <linux/delay.h>
Nick Cheng1a4f5502007-09-13 17:26:40 +080052#include <linux/pci.h>
Ching Huang2e9feb42014-09-24 17:33:34 +080053#include <linux/circ_buf.h>
Erich Chen1c57e862006-07-12 08:59:32 -070054
55#include <scsi/scsi_cmnd.h>
56#include <scsi/scsi_device.h>
57#include <scsi/scsi_host.h>
58#include <scsi/scsi_transport.h>
59#include "arcmsr.h"
60
Tony Jonesee959b02008-02-22 00:13:36 +010061struct device_attribute *arcmsr_host_attrs[];
Erich Chen1c57e862006-07-12 08:59:32 -070062
Chris Wright2c3c8be2010-05-12 18:28:57 -070063static ssize_t arcmsr_sysfs_iop_message_read(struct file *filp,
64 struct kobject *kobj,
James Bottomley685b9e02007-09-15 11:41:53 -050065 struct bin_attribute *bin,
66 char *buf, loff_t off,
67 size_t count)
Erich Chen1c57e862006-07-12 08:59:32 -070068{
Tony Jonesee959b02008-02-22 00:13:36 +010069 struct device *dev = container_of(kobj,struct device,kobj);
70 struct Scsi_Host *host = class_to_shost(dev);
Erich Chen1c57e862006-07-12 08:59:32 -070071 struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
Ching Huang2e9feb42014-09-24 17:33:34 +080072 uint8_t *ptmpQbuffer;
Erich Chen1c57e862006-07-12 08:59:32 -070073 int32_t allxfer_len = 0;
Ching Huangbb263c42014-08-19 15:17:45 +080074 unsigned long flags;
Erich Chen1c57e862006-07-12 08:59:32 -070075
76 if (!capable(CAP_SYS_ADMIN))
77 return -EACCES;
78
79 /* do message unit read. */
80 ptmpQbuffer = (uint8_t *)buf;
Ching Huangbb263c42014-08-19 15:17:45 +080081 spin_lock_irqsave(&acb->rqbuffer_lock, flags);
Ching Huang2e9feb42014-09-24 17:33:34 +080082 if (acb->rqbuf_getIndex != acb->rqbuf_putIndex) {
83 unsigned int tail = acb->rqbuf_getIndex;
84 unsigned int head = acb->rqbuf_putIndex;
85 unsigned int cnt_to_end = CIRC_CNT_TO_END(head, tail, ARCMSR_MAX_QBUFFER);
86
87 allxfer_len = CIRC_CNT(head, tail, ARCMSR_MAX_QBUFFER);
88 if (allxfer_len > ARCMSR_API_DATA_BUFLEN)
89 allxfer_len = ARCMSR_API_DATA_BUFLEN;
90
91 if (allxfer_len <= cnt_to_end)
92 memcpy(ptmpQbuffer, acb->rqbuffer + tail, allxfer_len);
93 else {
94 memcpy(ptmpQbuffer, acb->rqbuffer + tail, cnt_to_end);
95 memcpy(ptmpQbuffer + cnt_to_end, acb->rqbuffer, allxfer_len - cnt_to_end);
Ching Huangbb263c42014-08-19 15:17:45 +080096 }
Ching Huang2e9feb42014-09-24 17:33:34 +080097 acb->rqbuf_getIndex = (acb->rqbuf_getIndex + allxfer_len) % ARCMSR_MAX_QBUFFER;
Erich Chen1c57e862006-07-12 08:59:32 -070098 }
99 if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
Al Viro80da1ad2007-10-29 05:08:28 +0000100 struct QBUFFER __iomem *prbuffer;
Erich Chen1c57e862006-07-12 08:59:32 -0700101 acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
Nick Cheng1a4f5502007-09-13 17:26:40 +0800102 prbuffer = arcmsr_get_iop_rqbuffer(acb);
Ching Huangbb263c42014-08-19 15:17:45 +0800103 if (arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0)
104 acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW;
Erich Chen1c57e862006-07-12 08:59:32 -0700105 }
Ching Huangbb263c42014-08-19 15:17:45 +0800106 spin_unlock_irqrestore(&acb->rqbuffer_lock, flags);
107 return allxfer_len;
Erich Chen1c57e862006-07-12 08:59:32 -0700108}
109
Chris Wright2c3c8be2010-05-12 18:28:57 -0700110static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp,
111 struct kobject *kobj,
James Bottomley685b9e02007-09-15 11:41:53 -0500112 struct bin_attribute *bin,
113 char *buf, loff_t off,
114 size_t count)
Erich Chen1c57e862006-07-12 08:59:32 -0700115{
Tony Jonesee959b02008-02-22 00:13:36 +0100116 struct device *dev = container_of(kobj,struct device,kobj);
117 struct Scsi_Host *host = class_to_shost(dev);
Erich Chen1c57e862006-07-12 08:59:32 -0700118 struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
Ching Huang2e9feb42014-09-24 17:33:34 +0800119 int32_t user_len, cnt2end;
Erich Chen1c57e862006-07-12 08:59:32 -0700120 uint8_t *pQbuffer, *ptmpuserbuffer;
Ching Huangbb263c42014-08-19 15:17:45 +0800121 unsigned long flags;
Erich Chen1c57e862006-07-12 08:59:32 -0700122
123 if (!capable(CAP_SYS_ADMIN))
124 return -EACCES;
Ching Huang2e9feb42014-09-24 17:33:34 +0800125 if (count > ARCMSR_API_DATA_BUFLEN)
Erich Chen1c57e862006-07-12 08:59:32 -0700126 return -EINVAL;
127 /* do message unit write. */
128 ptmpuserbuffer = (uint8_t *)buf;
129 user_len = (int32_t)count;
Ching Huangbb263c42014-08-19 15:17:45 +0800130 spin_lock_irqsave(&acb->wqbuffer_lock, flags);
Ching Huang2e9feb42014-09-24 17:33:34 +0800131 if (acb->wqbuf_putIndex != acb->wqbuf_getIndex) {
Ching Huangbb263c42014-08-19 15:17:45 +0800132 arcmsr_write_ioctldata2iop(acb);
133 spin_unlock_irqrestore(&acb->wqbuffer_lock, flags);
Erich Chen1c57e862006-07-12 08:59:32 -0700134 return 0; /*need retry*/
135 } else {
Ching Huang2e9feb42014-09-24 17:33:34 +0800136 pQbuffer = &acb->wqbuffer[acb->wqbuf_putIndex];
137 cnt2end = ARCMSR_MAX_QBUFFER - acb->wqbuf_putIndex;
138 if (user_len > cnt2end) {
139 memcpy(pQbuffer, ptmpuserbuffer, cnt2end);
140 ptmpuserbuffer += cnt2end;
141 user_len -= cnt2end;
142 acb->wqbuf_putIndex = 0;
143 pQbuffer = acb->wqbuffer;
Erich Chen1c57e862006-07-12 08:59:32 -0700144 }
Ching Huang2e9feb42014-09-24 17:33:34 +0800145 memcpy(pQbuffer, ptmpuserbuffer, user_len);
146 acb->wqbuf_putIndex += user_len;
147 acb->wqbuf_putIndex %= ARCMSR_MAX_QBUFFER;
148 if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_CLEARED) {
149 acb->acb_flags &=
150 ~ACB_F_MESSAGE_WQBUFFER_CLEARED;
151 arcmsr_write_ioctldata2iop(acb);
152 }
153 spin_unlock_irqrestore(&acb->wqbuffer_lock, flags);
154 return count;
Erich Chen1c57e862006-07-12 08:59:32 -0700155 }
156}
157
Chris Wright2c3c8be2010-05-12 18:28:57 -0700158static ssize_t arcmsr_sysfs_iop_message_clear(struct file *filp,
159 struct kobject *kobj,
James Bottomley685b9e02007-09-15 11:41:53 -0500160 struct bin_attribute *bin,
161 char *buf, loff_t off,
162 size_t count)
Erich Chen1c57e862006-07-12 08:59:32 -0700163{
Tony Jonesee959b02008-02-22 00:13:36 +0100164 struct device *dev = container_of(kobj,struct device,kobj);
165 struct Scsi_Host *host = class_to_shost(dev);
Erich Chen1c57e862006-07-12 08:59:32 -0700166 struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700167 uint8_t *pQbuffer;
Ching Huangbb263c42014-08-19 15:17:45 +0800168 unsigned long flags;
Erich Chen1c57e862006-07-12 08:59:32 -0700169
170 if (!capable(CAP_SYS_ADMIN))
171 return -EACCES;
172
Ching Huangbb263c42014-08-19 15:17:45 +0800173 arcmsr_clear_iop2drv_rqueue_buffer(acb);
Erich Chen1c57e862006-07-12 08:59:32 -0700174 acb->acb_flags |=
175 (ACB_F_MESSAGE_WQBUFFER_CLEARED
176 | ACB_F_MESSAGE_RQBUFFER_CLEARED
177 | ACB_F_MESSAGE_WQBUFFER_READED);
Ching Huangbb263c42014-08-19 15:17:45 +0800178 spin_lock_irqsave(&acb->rqbuffer_lock, flags);
Ching Huang2e9feb42014-09-24 17:33:34 +0800179 acb->rqbuf_getIndex = 0;
180 acb->rqbuf_putIndex = 0;
Ching Huangbb263c42014-08-19 15:17:45 +0800181 spin_unlock_irqrestore(&acb->rqbuffer_lock, flags);
182 spin_lock_irqsave(&acb->wqbuffer_lock, flags);
Ching Huang2e9feb42014-09-24 17:33:34 +0800183 acb->wqbuf_getIndex = 0;
184 acb->wqbuf_putIndex = 0;
Ching Huangbb263c42014-08-19 15:17:45 +0800185 spin_unlock_irqrestore(&acb->wqbuffer_lock, flags);
Erich Chen1c57e862006-07-12 08:59:32 -0700186 pQbuffer = acb->rqbuffer;
187 memset(pQbuffer, 0, sizeof (struct QBUFFER));
188 pQbuffer = acb->wqbuffer;
189 memset(pQbuffer, 0, sizeof (struct QBUFFER));
190 return 1;
191}
192
193static struct bin_attribute arcmsr_sysfs_message_read_attr = {
194 .attr = {
195 .name = "mu_read",
196 .mode = S_IRUSR ,
Erich Chen1c57e862006-07-12 08:59:32 -0700197 },
Ching Huang2e9feb42014-09-24 17:33:34 +0800198 .size = ARCMSR_API_DATA_BUFLEN,
Erich Chen1c57e862006-07-12 08:59:32 -0700199 .read = arcmsr_sysfs_iop_message_read,
200};
201
202static struct bin_attribute arcmsr_sysfs_message_write_attr = {
203 .attr = {
204 .name = "mu_write",
205 .mode = S_IWUSR,
Erich Chen1c57e862006-07-12 08:59:32 -0700206 },
Ching Huang2e9feb42014-09-24 17:33:34 +0800207 .size = ARCMSR_API_DATA_BUFLEN,
Erich Chen1c57e862006-07-12 08:59:32 -0700208 .write = arcmsr_sysfs_iop_message_write,
209};
210
211static struct bin_attribute arcmsr_sysfs_message_clear_attr = {
212 .attr = {
213 .name = "mu_clear",
214 .mode = S_IWUSR,
Erich Chen1c57e862006-07-12 08:59:32 -0700215 },
216 .size = 1,
217 .write = arcmsr_sysfs_iop_message_clear,
218};
219
220int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *acb)
221{
222 struct Scsi_Host *host = acb->host;
223 int error;
224
Tony Jonesee959b02008-02-22 00:13:36 +0100225 error = sysfs_create_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_read_attr);
Erich Chen1c57e862006-07-12 08:59:32 -0700226 if (error) {
227 printk(KERN_ERR "arcmsr: alloc sysfs mu_read failed\n");
228 goto error_bin_file_message_read;
229 }
Tony Jonesee959b02008-02-22 00:13:36 +0100230 error = sysfs_create_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_write_attr);
Erich Chen1c57e862006-07-12 08:59:32 -0700231 if (error) {
232 printk(KERN_ERR "arcmsr: alloc sysfs mu_write failed\n");
233 goto error_bin_file_message_write;
234 }
Tony Jonesee959b02008-02-22 00:13:36 +0100235 error = sysfs_create_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_clear_attr);
Erich Chen1c57e862006-07-12 08:59:32 -0700236 if (error) {
237 printk(KERN_ERR "arcmsr: alloc sysfs mu_clear failed\n");
238 goto error_bin_file_message_clear;
239 }
240 return 0;
241error_bin_file_message_clear:
Tony Jonesee959b02008-02-22 00:13:36 +0100242 sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_write_attr);
Erich Chen1c57e862006-07-12 08:59:32 -0700243error_bin_file_message_write:
Tony Jonesee959b02008-02-22 00:13:36 +0100244 sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_read_attr);
Erich Chen1c57e862006-07-12 08:59:32 -0700245error_bin_file_message_read:
246 return error;
247}
248
Tony Jonesee959b02008-02-22 00:13:36 +0100249void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb)
250{
Erich Chen1c57e862006-07-12 08:59:32 -0700251 struct Scsi_Host *host = acb->host;
Erich Chen1c57e862006-07-12 08:59:32 -0700252
Tony Jonesee959b02008-02-22 00:13:36 +0100253 sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_clear_attr);
254 sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_write_attr);
255 sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_read_attr);
Erich Chen1c57e862006-07-12 08:59:32 -0700256}
257
258
259static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100260arcmsr_attr_host_driver_version(struct device *dev,
261 struct device_attribute *attr, char *buf)
262{
Erich Chen1c57e862006-07-12 08:59:32 -0700263 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500264 "%s\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700265 ARCMSR_DRIVER_VERSION);
266}
267
268static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100269arcmsr_attr_host_driver_posted_cmd(struct device *dev,
270 struct device_attribute *attr, char *buf)
271{
272 struct Scsi_Host *host = class_to_shost(dev);
273 struct AdapterControlBlock *acb =
274 (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700275 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500276 "%4d\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700277 atomic_read(&acb->ccboutstandingcount));
278}
279
280static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100281arcmsr_attr_host_driver_reset(struct device *dev,
282 struct device_attribute *attr, char *buf)
283{
284 struct Scsi_Host *host = class_to_shost(dev);
285 struct AdapterControlBlock *acb =
286 (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700287 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500288 "%4d\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700289 acb->num_resets);
290}
291
292static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100293arcmsr_attr_host_driver_abort(struct device *dev,
294 struct device_attribute *attr, char *buf)
295{
296 struct Scsi_Host *host = class_to_shost(dev);
297 struct AdapterControlBlock *acb =
298 (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700299 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500300 "%4d\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700301 acb->num_aborts);
302}
303
304static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100305arcmsr_attr_host_fw_model(struct device *dev, struct device_attribute *attr,
306 char *buf)
307{
308 struct Scsi_Host *host = class_to_shost(dev);
309 struct AdapterControlBlock *acb =
310 (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700311 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500312 "%s\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700313 acb->firm_model);
314}
315
316static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100317arcmsr_attr_host_fw_version(struct device *dev,
318 struct device_attribute *attr, char *buf)
319{
320 struct Scsi_Host *host = class_to_shost(dev);
321 struct AdapterControlBlock *acb =
322 (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700323
324 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500325 "%s\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700326 acb->firm_version);
327}
328
329static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100330arcmsr_attr_host_fw_request_len(struct device *dev,
331 struct device_attribute *attr, char *buf)
332{
333 struct Scsi_Host *host = class_to_shost(dev);
334 struct AdapterControlBlock *acb =
335 (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700336
337 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500338 "%4d\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700339 acb->firm_request_len);
340}
341
342static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100343arcmsr_attr_host_fw_numbers_queue(struct device *dev,
344 struct device_attribute *attr, char *buf)
345{
346 struct Scsi_Host *host = class_to_shost(dev);
347 struct AdapterControlBlock *acb =
348 (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700349
350 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500351 "%4d\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700352 acb->firm_numbers_queue);
353}
354
355static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100356arcmsr_attr_host_fw_sdram_size(struct device *dev,
357 struct device_attribute *attr, char *buf)
358{
359 struct Scsi_Host *host = class_to_shost(dev);
360 struct AdapterControlBlock *acb =
361 (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700362
363 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500364 "%4d\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700365 acb->firm_sdram_size);
366}
367
368static ssize_t
Tony Jonesee959b02008-02-22 00:13:36 +0100369arcmsr_attr_host_fw_hd_channels(struct device *dev,
370 struct device_attribute *attr, char *buf)
371{
372 struct Scsi_Host *host = class_to_shost(dev);
373 struct AdapterControlBlock *acb =
374 (struct AdapterControlBlock *) host->hostdata;
Erich Chen1c57e862006-07-12 08:59:32 -0700375
376 return snprintf(buf, PAGE_SIZE,
James Bottomleyd67a70a2006-07-28 17:36:46 -0500377 "%4d\n",
Erich Chen1c57e862006-07-12 08:59:32 -0700378 acb->firm_hd_channels);
379}
380
Tony Jonesee959b02008-02-22 00:13:36 +0100381static DEVICE_ATTR(host_driver_version, S_IRUGO, arcmsr_attr_host_driver_version, NULL);
382static DEVICE_ATTR(host_driver_posted_cmd, S_IRUGO, arcmsr_attr_host_driver_posted_cmd, NULL);
383static DEVICE_ATTR(host_driver_reset, S_IRUGO, arcmsr_attr_host_driver_reset, NULL);
384static DEVICE_ATTR(host_driver_abort, S_IRUGO, arcmsr_attr_host_driver_abort, NULL);
385static DEVICE_ATTR(host_fw_model, S_IRUGO, arcmsr_attr_host_fw_model, NULL);
386static DEVICE_ATTR(host_fw_version, S_IRUGO, arcmsr_attr_host_fw_version, NULL);
387static DEVICE_ATTR(host_fw_request_len, S_IRUGO, arcmsr_attr_host_fw_request_len, NULL);
388static DEVICE_ATTR(host_fw_numbers_queue, S_IRUGO, arcmsr_attr_host_fw_numbers_queue, NULL);
389static DEVICE_ATTR(host_fw_sdram_size, S_IRUGO, arcmsr_attr_host_fw_sdram_size, NULL);
390static DEVICE_ATTR(host_fw_hd_channels, S_IRUGO, arcmsr_attr_host_fw_hd_channels, NULL);
Erich Chen1c57e862006-07-12 08:59:32 -0700391
Tony Jonesee959b02008-02-22 00:13:36 +0100392struct device_attribute *arcmsr_host_attrs[] = {
393 &dev_attr_host_driver_version,
394 &dev_attr_host_driver_posted_cmd,
395 &dev_attr_host_driver_reset,
396 &dev_attr_host_driver_abort,
397 &dev_attr_host_fw_model,
398 &dev_attr_host_fw_version,
399 &dev_attr_host_fw_request_len,
400 &dev_attr_host_fw_numbers_queue,
401 &dev_attr_host_fw_sdram_size,
402 &dev_attr_host_fw_hd_channels,
Erich Chen1c57e862006-07-12 08:59:32 -0700403 NULL,
404};