You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
staging: remove i2o subsystem
This subsystem isn't used anymore, and the hardware isn't around. It's been in staging for a while, and it's time for it to now be removed. Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -108,8 +108,6 @@ source "drivers/staging/clocking-wizard/Kconfig"
|
||||
|
||||
source "drivers/staging/fbtft/Kconfig"
|
||||
|
||||
source "drivers/staging/i2o/Kconfig"
|
||||
|
||||
source "drivers/staging/fsl-mc/Kconfig"
|
||||
|
||||
endif # STAGING
|
||||
|
||||
@@ -46,5 +46,4 @@ obj-$(CONFIG_CRYPTO_SKEIN) += skein/
|
||||
obj-$(CONFIG_UNISYSSPAR) += unisys/
|
||||
obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/
|
||||
obj-$(CONFIG_FB_TFT) += fbtft/
|
||||
obj-$(CONFIG_I2O) += i2o/
|
||||
obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
menuconfig I2O
|
||||
tristate "I2O device support"
|
||||
depends on PCI
|
||||
---help---
|
||||
The Intelligent Input/Output (I2O) architecture allows hardware
|
||||
drivers to be split into two parts: an operating system specific
|
||||
module called the OSM and an hardware specific module called the
|
||||
HDM. The OSM can talk to a whole range of HDM's, and ideally the
|
||||
HDM's are not OS dependent. This allows for the same HDM driver to
|
||||
be used under different operating systems if the relevant OSM is in
|
||||
place. In order for this to work, you need to have an I2O interface
|
||||
adapter card in your computer. This card contains a special I/O
|
||||
processor (IOP), thus allowing high speeds since the CPU does not
|
||||
have to deal with I/O.
|
||||
|
||||
If you say Y here, you will get a choice of interface adapter
|
||||
drivers and OSM's with the following questions.
|
||||
|
||||
To compile this support as a module, choose M here: the
|
||||
modules will be called i2o_core.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
if I2O
|
||||
|
||||
config I2O_LCT_NOTIFY_ON_CHANGES
|
||||
bool "Enable LCT notification"
|
||||
default y
|
||||
---help---
|
||||
Only say N here if you have a I2O controller from SUN. The SUN
|
||||
firmware doesn't support LCT notification on changes. If this option
|
||||
is enabled on such a controller the driver will hang up in a endless
|
||||
loop. On all other controllers say Y.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config I2O_EXT_ADAPTEC
|
||||
bool "Enable Adaptec extensions"
|
||||
default y
|
||||
---help---
|
||||
Say Y for support of raidutils for Adaptec I2O controllers. You also
|
||||
have to say Y to "I2O Configuration support", "I2O SCSI OSM" below
|
||||
and to "SCSI generic support" under "SCSI device configuration".
|
||||
|
||||
config I2O_EXT_ADAPTEC_DMA64
|
||||
bool "Enable 64-bit DMA"
|
||||
depends on I2O_EXT_ADAPTEC && ( 64BIT || HIGHMEM64G )
|
||||
default y
|
||||
---help---
|
||||
Say Y for support of 64-bit DMA transfer mode on Adaptec I2O
|
||||
controllers.
|
||||
Note: You need at least firmware version 3709.
|
||||
|
||||
config I2O_CONFIG
|
||||
tristate "I2O Configuration support"
|
||||
depends on VIRT_TO_BUS
|
||||
---help---
|
||||
Say Y for support of the configuration interface for the I2O adapters.
|
||||
If you have a RAID controller from Adaptec and you want to use the
|
||||
raidutils to manage your RAID array, you have to say Y here.
|
||||
|
||||
To compile this support as a module, choose M here: the
|
||||
module will be called i2o_config.
|
||||
|
||||
Note: If you want to use the new API you have to download the
|
||||
i2o_config patch from http://i2o.shadowconnect.com/
|
||||
|
||||
config I2O_CONFIG_OLD_IOCTL
|
||||
bool "Enable ioctls (OBSOLETE)"
|
||||
depends on I2O_CONFIG
|
||||
default y
|
||||
---help---
|
||||
Enables old ioctls.
|
||||
|
||||
config I2O_BUS
|
||||
tristate "I2O Bus Adapter OSM"
|
||||
---help---
|
||||
Include support for the I2O Bus Adapter OSM. The Bus Adapter OSM
|
||||
provides access to the busses on the I2O controller. The main purpose
|
||||
is to rescan the bus to find new devices.
|
||||
|
||||
To compile this support as a module, choose M here: the
|
||||
module will be called i2o_bus.
|
||||
|
||||
config I2O_BLOCK
|
||||
tristate "I2O Block OSM"
|
||||
depends on BLOCK
|
||||
---help---
|
||||
Include support for the I2O Block OSM. The Block OSM presents disk
|
||||
and other structured block devices to the operating system. If you
|
||||
are using an RAID controller, you could access the array only by
|
||||
the Block OSM driver. But it is possible to access the single disks
|
||||
by the SCSI OSM driver, for example to monitor the disks.
|
||||
|
||||
To compile this support as a module, choose M here: the
|
||||
module will be called i2o_block.
|
||||
|
||||
config I2O_SCSI
|
||||
tristate "I2O SCSI OSM"
|
||||
depends on SCSI
|
||||
---help---
|
||||
Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel
|
||||
I2O controller. You can use both the SCSI and Block OSM together if
|
||||
you wish. To access a RAID array, you must use the Block OSM driver.
|
||||
But you could use the SCSI OSM driver to monitor the single disks.
|
||||
|
||||
To compile this support as a module, choose M here: the
|
||||
module will be called i2o_scsi.
|
||||
|
||||
config I2O_PROC
|
||||
tristate "I2O /proc support"
|
||||
---help---
|
||||
If you say Y here and to "/proc file system support", you will be
|
||||
able to read I2O related information from the virtual directory
|
||||
/proc/i2o.
|
||||
|
||||
To compile this support as a module, choose M here: the
|
||||
module will be called i2o_proc.
|
||||
|
||||
endif # I2O
|
||||
@@ -1,16 +0,0 @@
|
||||
#
|
||||
# Makefile for the kernel I2O OSM.
|
||||
#
|
||||
# Note : at this point, these files are compiled on all systems.
|
||||
# In the future, some of these should be built conditionally.
|
||||
#
|
||||
|
||||
i2o_core-y += iop.o driver.o device.o debug.o pci.o exec-osm.o memory.o
|
||||
i2o_bus-y += bus-osm.o
|
||||
i2o_config-y += config-osm.o
|
||||
obj-$(CONFIG_I2O) += i2o_core.o
|
||||
obj-$(CONFIG_I2O_CONFIG)+= i2o_config.o
|
||||
obj-$(CONFIG_I2O_BUS) += i2o_bus.o
|
||||
obj-$(CONFIG_I2O_BLOCK) += i2o_block.o
|
||||
obj-$(CONFIG_I2O_SCSI) += i2o_scsi.o
|
||||
obj-$(CONFIG_I2O_PROC) += i2o_proc.o
|
||||
@@ -1,98 +0,0 @@
|
||||
|
||||
Linux I2O Support (c) Copyright 1999 Red Hat Software
|
||||
and others.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version
|
||||
2 of the License, or (at your option) any later version.
|
||||
|
||||
AUTHORS (so far)
|
||||
|
||||
Alan Cox, Building Number Three Ltd.
|
||||
Core code, SCSI and Block OSMs
|
||||
|
||||
Steve Ralston, LSI Logic Corp.
|
||||
Debugging SCSI and Block OSM
|
||||
|
||||
Deepak Saxena, Intel Corp.
|
||||
Various core/block extensions
|
||||
/proc interface, bug fixes
|
||||
Ioctl interfaces for control
|
||||
Debugging LAN OSM
|
||||
|
||||
Philip Rumpf
|
||||
Fixed assorted dumb SMP locking bugs
|
||||
|
||||
Juha Sievanen, University of Helsinki Finland
|
||||
LAN OSM code
|
||||
/proc interface to LAN class
|
||||
Bug fixes
|
||||
Core code extensions
|
||||
|
||||
Auvo Häkkinen, University of Helsinki Finland
|
||||
LAN OSM code
|
||||
/Proc interface to LAN class
|
||||
Bug fixes
|
||||
Core code extensions
|
||||
|
||||
Taneli Vähäkangas, University of Helsinki Finland
|
||||
Fixes to i2o_config
|
||||
|
||||
CREDITS
|
||||
|
||||
This work was made possible by
|
||||
|
||||
Red Hat Software
|
||||
Funding for the Building #3 part of the project
|
||||
|
||||
Symbios Logic (Now LSI)
|
||||
Host adapters, hints, known to work platforms when I hit
|
||||
compatibility problems
|
||||
|
||||
BoxHill Corporation
|
||||
Loan of initial FibreChannel disk array used for development work.
|
||||
|
||||
European Commission
|
||||
Funding the work done by the University of Helsinki
|
||||
|
||||
SysKonnect
|
||||
Loan of FDDI and Gigabit Ethernet cards
|
||||
|
||||
ASUSTeK
|
||||
Loan of I2O motherboard
|
||||
|
||||
STATUS:
|
||||
|
||||
o The core setup works within limits.
|
||||
o The scsi layer seems to almost work.
|
||||
I'm still chasing down the hang bug.
|
||||
o The block OSM is mostly functional
|
||||
o LAN OSM works with FDDI and Ethernet cards.
|
||||
|
||||
TO DO:
|
||||
|
||||
General:
|
||||
o Provide hidden address space if asked
|
||||
o Long term message flow control
|
||||
o PCI IOP's without interrupts are not supported yet
|
||||
o Push FAIL handling into the core
|
||||
o DDM control interfaces for module load etc
|
||||
o Add I2O 2.0 support (Deffered to 2.5 kernel)
|
||||
|
||||
Block:
|
||||
o Multiple major numbers
|
||||
o Read ahead and cache handling stuff. Talk to Ingo and people
|
||||
o Power management
|
||||
o Finish Media changers
|
||||
|
||||
SCSI:
|
||||
o Find the right way to associate drives/luns/busses
|
||||
|
||||
Lan:
|
||||
o Performance tuning
|
||||
o Test Fibre Channel code
|
||||
|
||||
Tape:
|
||||
o Anyone seen anything implementing this ?
|
||||
(D.S: Will attempt to do so if spare cycles permit)
|
||||
@@ -1,394 +0,0 @@
|
||||
|
||||
Linux I2O User Space Interface
|
||||
rev 0.3 - 04/20/99
|
||||
|
||||
=============================================================================
|
||||
Originally written by Deepak Saxena(deepak@plexity.net)
|
||||
Currently maintained by Deepak Saxena(deepak@plexity.net)
|
||||
=============================================================================
|
||||
|
||||
I. Introduction
|
||||
|
||||
The Linux I2O subsystem provides a set of ioctl() commands that can be
|
||||
utilized by user space applications to communicate with IOPs and devices
|
||||
on individual IOPs. This document defines the specific ioctl() commands
|
||||
that are available to the user and provides examples of their uses.
|
||||
|
||||
This document assumes the reader is familiar with or has access to the
|
||||
I2O specification as no I2O message parameters are outlined. For information
|
||||
on the specification, see http://www.i2osig.org
|
||||
|
||||
This document and the I2O user space interface are currently maintained
|
||||
by Deepak Saxena. Please send all comments, errata, and bug fixes to
|
||||
deepak@csociety.purdue.edu
|
||||
|
||||
II. IOP Access
|
||||
|
||||
Access to the I2O subsystem is provided through the device file named
|
||||
/dev/i2o/ctl. This file is a character file with major number 10 and minor
|
||||
number 166. It can be created through the following command:
|
||||
|
||||
mknod /dev/i2o/ctl c 10 166
|
||||
|
||||
III. Determining the IOP Count
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OGETIOPS, int *count);
|
||||
|
||||
u8 count[MAX_I2O_CONTROLLERS];
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function returns the system's active IOP table. count should
|
||||
point to a buffer containing MAX_I2O_CONTROLLERS entries. Upon
|
||||
returning, each entry will contain a non-zero value if the given
|
||||
IOP unit is active, and NULL if it is inactive or non-existent.
|
||||
|
||||
RETURN VALUE.
|
||||
|
||||
Returns 0 if no errors occur, and -1 otherwise. If an error occurs,
|
||||
errno is set appropriately:
|
||||
|
||||
EFAULT Invalid user space pointer was passed
|
||||
|
||||
IV. Getting Hardware Resource Table
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OHRTGET, struct i2o_cmd_hrt *hrt);
|
||||
|
||||
struct i2o_cmd_hrtlct
|
||||
{
|
||||
u32 iop; /* IOP unit number */
|
||||
void *resbuf; /* Buffer for result */
|
||||
u32 *reslen; /* Buffer length in bytes */
|
||||
};
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function returns the Hardware Resource Table of the IOP specified
|
||||
by hrt->iop in the buffer pointed to by hrt->resbuf. The actual size of
|
||||
the data is written into *(hrt->reslen).
|
||||
|
||||
RETURNS
|
||||
|
||||
This function returns 0 if no errors occur. If an error occurs, -1
|
||||
is returned and errno is set appropriately:
|
||||
|
||||
EFAULT Invalid user space pointer was passed
|
||||
ENXIO Invalid IOP number
|
||||
ENOBUFS Buffer not large enough. If this occurs, the required
|
||||
buffer length is written into *(hrt->reslen)
|
||||
|
||||
V. Getting Logical Configuration Table
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OLCTGET, struct i2o_cmd_lct *lct);
|
||||
|
||||
struct i2o_cmd_hrtlct
|
||||
{
|
||||
u32 iop; /* IOP unit number */
|
||||
void *resbuf; /* Buffer for result */
|
||||
u32 *reslen; /* Buffer length in bytes */
|
||||
};
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function returns the Logical Configuration Table of the IOP specified
|
||||
by lct->iop in the buffer pointed to by lct->resbuf. The actual size of
|
||||
the data is written into *(lct->reslen).
|
||||
|
||||
RETURNS
|
||||
|
||||
This function returns 0 if no errors occur. If an error occurs, -1
|
||||
is returned and errno is set appropriately:
|
||||
|
||||
EFAULT Invalid user space pointer was passed
|
||||
ENXIO Invalid IOP number
|
||||
ENOBUFS Buffer not large enough. If this occurs, the required
|
||||
buffer length is written into *(lct->reslen)
|
||||
|
||||
VI. Setting Parameters
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OPARMSET, struct i2o_parm_setget *ops);
|
||||
|
||||
struct i2o_cmd_psetget
|
||||
{
|
||||
u32 iop; /* IOP unit number */
|
||||
u32 tid; /* Target device TID */
|
||||
void *opbuf; /* Operation List buffer */
|
||||
u32 oplen; /* Operation List buffer length in bytes */
|
||||
void *resbuf; /* Result List buffer */
|
||||
u32 *reslen; /* Result List buffer length in bytes */
|
||||
};
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function posts a UtilParamsSet message to the device identified
|
||||
by ops->iop and ops->tid. The operation list for the message is
|
||||
sent through the ops->opbuf buffer, and the result list is written
|
||||
into the buffer pointed to by ops->resbuf. The number of bytes
|
||||
written is placed into *(ops->reslen).
|
||||
|
||||
RETURNS
|
||||
|
||||
The return value is the size in bytes of the data written into
|
||||
ops->resbuf if no errors occur. If an error occurs, -1 is returned
|
||||
and errno is set appropriately:
|
||||
|
||||
EFAULT Invalid user space pointer was passed
|
||||
ENXIO Invalid IOP number
|
||||
ENOBUFS Buffer not large enough. If this occurs, the required
|
||||
buffer length is written into *(ops->reslen)
|
||||
ETIMEDOUT Timeout waiting for reply message
|
||||
ENOMEM Kernel memory allocation error
|
||||
|
||||
A return value of 0 does not mean that the value was actually
|
||||
changed properly on the IOP. The user should check the result
|
||||
list to determine the specific status of the transaction.
|
||||
|
||||
VII. Getting Parameters
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OPARMGET, struct i2o_parm_setget *ops);
|
||||
|
||||
struct i2o_parm_setget
|
||||
{
|
||||
u32 iop; /* IOP unit number */
|
||||
u32 tid; /* Target device TID */
|
||||
void *opbuf; /* Operation List buffer */
|
||||
u32 oplen; /* Operation List buffer length in bytes */
|
||||
void *resbuf; /* Result List buffer */
|
||||
u32 *reslen; /* Result List buffer length in bytes */
|
||||
};
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function posts a UtilParamsGet message to the device identified
|
||||
by ops->iop and ops->tid. The operation list for the message is
|
||||
sent through the ops->opbuf buffer, and the result list is written
|
||||
into the buffer pointed to by ops->resbuf. The actual size of data
|
||||
written is placed into *(ops->reslen).
|
||||
|
||||
RETURNS
|
||||
|
||||
EFAULT Invalid user space pointer was passed
|
||||
ENXIO Invalid IOP number
|
||||
ENOBUFS Buffer not large enough. If this occurs, the required
|
||||
buffer length is written into *(ops->reslen)
|
||||
ETIMEDOUT Timeout waiting for reply message
|
||||
ENOMEM Kernel memory allocation error
|
||||
|
||||
A return value of 0 does not mean that the value was actually
|
||||
properly retrieved. The user should check the result list
|
||||
to determine the specific status of the transaction.
|
||||
|
||||
VIII. Downloading Software
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OSWDL, struct i2o_sw_xfer *sw);
|
||||
|
||||
struct i2o_sw_xfer
|
||||
{
|
||||
u32 iop; /* IOP unit number */
|
||||
u8 flags; /* DownloadFlags field */
|
||||
u8 sw_type; /* Software type */
|
||||
u32 sw_id; /* Software ID */
|
||||
void *buf; /* Pointer to software buffer */
|
||||
u32 *swlen; /* Length of software buffer */
|
||||
u32 *maxfrag; /* Number of fragments */
|
||||
u32 *curfrag; /* Current fragment number */
|
||||
};
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function downloads a software fragment pointed by sw->buf
|
||||
to the iop identified by sw->iop. The DownloadFlags, SwID, SwType
|
||||
and SwSize fields of the ExecSwDownload message are filled in with
|
||||
the values of sw->flags, sw->sw_id, sw->sw_type and *(sw->swlen).
|
||||
|
||||
The fragments _must_ be sent in order and be 8K in size. The last
|
||||
fragment _may_ be shorter, however. The kernel will compute its
|
||||
size based on information in the sw->swlen field.
|
||||
|
||||
Please note that SW transfers can take a long time.
|
||||
|
||||
RETURNS
|
||||
|
||||
This function returns 0 no errors occur. If an error occurs, -1
|
||||
is returned and errno is set appropriately:
|
||||
|
||||
EFAULT Invalid user space pointer was passed
|
||||
ENXIO Invalid IOP number
|
||||
ETIMEDOUT Timeout waiting for reply message
|
||||
ENOMEM Kernel memory allocation error
|
||||
|
||||
IX. Uploading Software
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OSWUL, struct i2o_sw_xfer *sw);
|
||||
|
||||
struct i2o_sw_xfer
|
||||
{
|
||||
u32 iop; /* IOP unit number */
|
||||
u8 flags; /* UploadFlags */
|
||||
u8 sw_type; /* Software type */
|
||||
u32 sw_id; /* Software ID */
|
||||
void *buf; /* Pointer to software buffer */
|
||||
u32 *swlen; /* Length of software buffer */
|
||||
u32 *maxfrag; /* Number of fragments */
|
||||
u32 *curfrag; /* Current fragment number */
|
||||
};
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function uploads a software fragment from the IOP identified
|
||||
by sw->iop, sw->sw_type, sw->sw_id and optionally sw->swlen fields.
|
||||
The UploadFlags, SwID, SwType and SwSize fields of the ExecSwUpload
|
||||
message are filled in with the values of sw->flags, sw->sw_id,
|
||||
sw->sw_type and *(sw->swlen).
|
||||
|
||||
The fragments _must_ be requested in order and be 8K in size. The
|
||||
user is responsible for allocating memory pointed by sw->buf. The
|
||||
last fragment _may_ be shorter.
|
||||
|
||||
Please note that SW transfers can take a long time.
|
||||
|
||||
RETURNS
|
||||
|
||||
This function returns 0 if no errors occur. If an error occurs, -1
|
||||
is returned and errno is set appropriately:
|
||||
|
||||
EFAULT Invalid user space pointer was passed
|
||||
ENXIO Invalid IOP number
|
||||
ETIMEDOUT Timeout waiting for reply message
|
||||
ENOMEM Kernel memory allocation error
|
||||
|
||||
X. Removing Software
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OSWDEL, struct i2o_sw_xfer *sw);
|
||||
|
||||
struct i2o_sw_xfer
|
||||
{
|
||||
u32 iop; /* IOP unit number */
|
||||
u8 flags; /* RemoveFlags */
|
||||
u8 sw_type; /* Software type */
|
||||
u32 sw_id; /* Software ID */
|
||||
void *buf; /* Unused */
|
||||
u32 *swlen; /* Length of the software data */
|
||||
u32 *maxfrag; /* Unused */
|
||||
u32 *curfrag; /* Unused */
|
||||
};
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function removes software from the IOP identified by sw->iop.
|
||||
The RemoveFlags, SwID, SwType and SwSize fields of the ExecSwRemove message
|
||||
are filled in with the values of sw->flags, sw->sw_id, sw->sw_type and
|
||||
*(sw->swlen). Give zero in *(sw->len) if the value is unknown. IOP uses
|
||||
*(sw->swlen) value to verify correct identication of the module to remove.
|
||||
The actual size of the module is written into *(sw->swlen).
|
||||
|
||||
RETURNS
|
||||
|
||||
This function returns 0 if no errors occur. If an error occurs, -1
|
||||
is returned and errno is set appropriately:
|
||||
|
||||
EFAULT Invalid user space pointer was passed
|
||||
ENXIO Invalid IOP number
|
||||
ETIMEDOUT Timeout waiting for reply message
|
||||
ENOMEM Kernel memory allocation error
|
||||
|
||||
X. Validating Configuration
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OVALIDATE, int *iop);
|
||||
u32 iop;
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function posts an ExecConfigValidate message to the controller
|
||||
identified by iop. This message indicates that the current
|
||||
configuration is accepted. The iop changes the status of suspect drivers
|
||||
to valid and may delete old drivers from its store.
|
||||
|
||||
RETURNS
|
||||
|
||||
This function returns 0 if no erro occur. If an error occurs, -1 is
|
||||
returned and errno is set appropriately:
|
||||
|
||||
ETIMEDOUT Timeout waiting for reply message
|
||||
ENXIO Invalid IOP number
|
||||
|
||||
XI. Configuration Dialog
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
ioctl(fd, I2OHTML, struct i2o_html *htquery);
|
||||
struct i2o_html
|
||||
{
|
||||
u32 iop; /* IOP unit number */
|
||||
u32 tid; /* Target device ID */
|
||||
u32 page; /* HTML page */
|
||||
void *resbuf; /* Buffer for reply HTML page */
|
||||
u32 *reslen; /* Length in bytes of reply buffer */
|
||||
void *qbuf; /* Pointer to HTTP query string */
|
||||
u32 qlen; /* Length in bytes of query string buffer */
|
||||
};
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This function posts an UtilConfigDialog message to the device identified
|
||||
by htquery->iop and htquery->tid. The requested HTML page number is
|
||||
provided by the htquery->page field, and the resultant data is stored
|
||||
in the buffer pointed to by htquery->resbuf. If there is an HTTP query
|
||||
string that is to be sent to the device, it should be sent in the buffer
|
||||
pointed to by htquery->qbuf. If there is no query string, this field
|
||||
should be set to NULL. The actual size of the reply received is written
|
||||
into *(htquery->reslen).
|
||||
|
||||
RETURNS
|
||||
|
||||
This function returns 0 if no error occur. If an error occurs, -1
|
||||
is returned and errno is set appropriately:
|
||||
|
||||
EFAULT Invalid user space pointer was passed
|
||||
ENXIO Invalid IOP number
|
||||
ENOBUFS Buffer not large enough. If this occurs, the required
|
||||
buffer length is written into *(ops->reslen)
|
||||
ETIMEDOUT Timeout waiting for reply message
|
||||
ENOMEM Kernel memory allocation error
|
||||
|
||||
XII. Events
|
||||
|
||||
In the process of determining this. Current idea is to have use
|
||||
the select() interface to allow user apps to periodically poll
|
||||
the /dev/i2o/ctl device for events. When select() notifies the user
|
||||
that an event is available, the user would call read() to retrieve
|
||||
a list of all the events that are pending for the specific device.
|
||||
|
||||
=============================================================================
|
||||
Revision History
|
||||
=============================================================================
|
||||
|
||||
Rev 0.1 - 04/01/99
|
||||
- Initial revision
|
||||
|
||||
Rev 0.2 - 04/06/99
|
||||
- Changed return values to match UNIX ioctl() standard. Only return values
|
||||
are 0 and -1. All errors are reported through errno.
|
||||
- Added summary of proposed possible event interfaces
|
||||
|
||||
Rev 0.3 - 04/20/99
|
||||
- Changed all ioctls() to use pointers to user data instead of actual data
|
||||
- Updated error values to match the code
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
* Bus Adapter OSM
|
||||
*
|
||||
* Copyright (C) 2005 Markus Lidel <Markus.Lidel@shadowconnect.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Fixes/additions:
|
||||
* Markus Lidel <Markus.Lidel@shadowconnect.com>
|
||||
* initial version.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include "i2o.h"
|
||||
|
||||
#define OSM_NAME "bus-osm"
|
||||
#define OSM_VERSION "1.317"
|
||||
#define OSM_DESCRIPTION "I2O Bus Adapter OSM"
|
||||
|
||||
static struct i2o_driver i2o_bus_driver;
|
||||
|
||||
/* Bus OSM class handling definition */
|
||||
static struct i2o_class_id i2o_bus_class_id[] = {
|
||||
{I2O_CLASS_BUS_ADAPTER},
|
||||
{I2O_CLASS_END}
|
||||
};
|
||||
|
||||
/**
|
||||
* i2o_bus_scan - Scan the bus for new devices
|
||||
* @dev: I2O device of the bus, which should be scanned
|
||||
*
|
||||
* Scans the bus dev for new / removed devices. After the scan a new LCT
|
||||
* will be fetched automatically.
|
||||
*
|
||||
* Returns 0 on success or negative error code on failure.
|
||||
*/
|
||||
static int i2o_bus_scan(struct i2o_device *dev)
|
||||
{
|
||||
struct i2o_message *msg;
|
||||
|
||||
msg = i2o_msg_get_wait(dev->iop, I2O_TIMEOUT_MESSAGE_GET);
|
||||
if (IS_ERR(msg))
|
||||
return -ETIMEDOUT;
|
||||
|
||||
msg->u.head[0] = cpu_to_le32(FIVE_WORD_MSG_SIZE | SGL_OFFSET_0);
|
||||
msg->u.head[1] =
|
||||
cpu_to_le32(I2O_CMD_BUS_SCAN << 24 | HOST_TID << 12 | dev->lct_data.
|
||||
tid);
|
||||
|
||||
return i2o_msg_post_wait(dev->iop, msg, 60);
|
||||
};
|
||||
|
||||
/**
|
||||
* i2o_bus_store_scan - Scan the I2O Bus Adapter
|
||||
* @d: device which should be scanned
|
||||
* @attr: device_attribute
|
||||
* @buf: output buffer
|
||||
* @count: buffer size
|
||||
*
|
||||
* Returns count.
|
||||
*/
|
||||
static ssize_t i2o_bus_store_scan(struct device *d,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct i2o_device *i2o_dev = to_i2o_device(d);
|
||||
int rc;
|
||||
|
||||
rc = i2o_bus_scan(i2o_dev);
|
||||
if (rc)
|
||||
osm_warn("bus scan failed %d\n", rc);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Bus Adapter OSM device attributes */
|
||||
static DEVICE_ATTR(scan, S_IWUSR, NULL, i2o_bus_store_scan);
|
||||
|
||||
/**
|
||||
* i2o_bus_probe - verify if dev is a I2O Bus Adapter device and install it
|
||||
* @dev: device to verify if it is a I2O Bus Adapter device
|
||||
*
|
||||
* Because we want all Bus Adapters always return 0.
|
||||
* Except when we fail. Then we are sad.
|
||||
*
|
||||
* Returns 0, except when we fail to excel.
|
||||
*/
|
||||
static int i2o_bus_probe(struct device *dev)
|
||||
{
|
||||
struct i2o_device *i2o_dev = to_i2o_device(get_device(dev));
|
||||
int rc;
|
||||
|
||||
rc = device_create_file(dev, &dev_attr_scan);
|
||||
if (rc)
|
||||
goto err_out;
|
||||
|
||||
osm_info("device added (TID: %03x)\n", i2o_dev->lct_data.tid);
|
||||
|
||||
return 0;
|
||||
|
||||
err_out:
|
||||
put_device(dev);
|
||||
return rc;
|
||||
};
|
||||
|
||||
/**
|
||||
* i2o_bus_remove - remove the I2O Bus Adapter device from the system again
|
||||
* @dev: I2O Bus Adapter device which should be removed
|
||||
*
|
||||
* Always returns 0.
|
||||
*/
|
||||
static int i2o_bus_remove(struct device *dev)
|
||||
{
|
||||
struct i2o_device *i2o_dev = to_i2o_device(dev);
|
||||
|
||||
device_remove_file(dev, &dev_attr_scan);
|
||||
|
||||
put_device(dev);
|
||||
|
||||
osm_info("device removed (TID: %03x)\n", i2o_dev->lct_data.tid);
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
/* Bus Adapter OSM driver struct */
|
||||
static struct i2o_driver i2o_bus_driver = {
|
||||
.name = OSM_NAME,
|
||||
.classes = i2o_bus_class_id,
|
||||
.driver = {
|
||||
.probe = i2o_bus_probe,
|
||||
.remove = i2o_bus_remove,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* i2o_bus_init - Bus Adapter OSM initialization function
|
||||
*
|
||||
* Only register the Bus Adapter OSM in the I2O core.
|
||||
*
|
||||
* Returns 0 on success or negative error code on failure.
|
||||
*/
|
||||
static int __init i2o_bus_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n");
|
||||
|
||||
/* Register Bus Adapter OSM into I2O core */
|
||||
rc = i2o_driver_register(&i2o_bus_driver);
|
||||
if (rc) {
|
||||
osm_err("Could not register Bus Adapter OSM\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* i2o_bus_exit - Bus Adapter OSM exit function
|
||||
*
|
||||
* Unregisters Bus Adapter OSM from I2O core.
|
||||
*/
|
||||
static void __exit i2o_bus_exit(void)
|
||||
{
|
||||
i2o_driver_unregister(&i2o_bus_driver);
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Markus Lidel <Markus.Lidel@shadowconnect.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION(OSM_DESCRIPTION);
|
||||
MODULE_VERSION(OSM_VERSION);
|
||||
|
||||
module_init(i2o_bus_init);
|
||||
module_exit(i2o_bus_exit);
|
||||
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Configuration OSM
|
||||
*
|
||||
* Copyright (C) 2005 Markus Lidel <Markus.Lidel@shadowconnect.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Fixes/additions:
|
||||
* Markus Lidel <Markus.Lidel@shadowconnect.com>
|
||||
* initial version.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include "i2o.h"
|
||||
#include <linux/dcache.h>
|
||||
#include <linux/namei.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
#define OSM_NAME "config-osm"
|
||||
#define OSM_VERSION "1.323"
|
||||
#define OSM_DESCRIPTION "I2O Configuration OSM"
|
||||
|
||||
/* access mode user rw */
|
||||
#define S_IWRSR (S_IRUSR | S_IWUSR)
|
||||
|
||||
static struct i2o_driver i2o_config_driver;
|
||||
|
||||
/* Config OSM driver struct */
|
||||
static struct i2o_driver i2o_config_driver = {
|
||||
.name = OSM_NAME,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL
|
||||
#include "i2o_config.c"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* i2o_config_init - Configuration OSM initialization function
|
||||
*
|
||||
* Registers Configuration OSM in the I2O core and if old ioctl's are
|
||||
* compiled in initialize them.
|
||||
*
|
||||
* Returns 0 on success or negative error code on failure.
|
||||
*/
|
||||
static int __init i2o_config_init(void)
|
||||
{
|
||||
printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n");
|
||||
|
||||
if (i2o_driver_register(&i2o_config_driver)) {
|
||||
osm_err("handler register failed.\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL
|
||||
if (i2o_config_old_init()) {
|
||||
osm_err("old config handler initialization failed\n");
|
||||
i2o_driver_unregister(&i2o_config_driver);
|
||||
return -EBUSY;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* i2o_config_exit - Configuration OSM exit function
|
||||
*
|
||||
* If old ioctl's are compiled in exit remove them and unregisters
|
||||
* Configuration OSM from I2O core.
|
||||
*/
|
||||
static void i2o_config_exit(void)
|
||||
{
|
||||
#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL
|
||||
i2o_config_old_exit();
|
||||
#endif
|
||||
|
||||
i2o_driver_unregister(&i2o_config_driver);
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("Markus Lidel <Markus.Lidel@shadowconnect.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION(OSM_DESCRIPTION);
|
||||
MODULE_VERSION(OSM_VERSION);
|
||||
|
||||
module_init(i2o_config_init);
|
||||
module_exit(i2o_config_exit);
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* I2O core internal declarations
|
||||
*
|
||||
* Copyright (C) 2005 Markus Lidel <Markus.Lidel@shadowconnect.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Fixes/additions:
|
||||
* Markus Lidel <Markus.Lidel@shadowconnect.com>
|
||||
* initial version.
|
||||
*/
|
||||
|
||||
/* Exec-OSM */
|
||||
extern struct i2o_driver i2o_exec_driver;
|
||||
extern int i2o_exec_lct_get(struct i2o_controller *);
|
||||
|
||||
extern int __init i2o_exec_init(void);
|
||||
extern void i2o_exec_exit(void);
|
||||
|
||||
/* driver */
|
||||
extern struct bus_type i2o_bus_type;
|
||||
|
||||
extern int i2o_driver_dispatch(struct i2o_controller *, u32);
|
||||
|
||||
extern int __init i2o_driver_init(void);
|
||||
extern void i2o_driver_exit(void);
|
||||
|
||||
/* PCI */
|
||||
extern int __init i2o_pci_init(void);
|
||||
extern void __exit i2o_pci_exit(void);
|
||||
|
||||
/* device */
|
||||
extern const struct attribute_group *i2o_device_groups[];
|
||||
|
||||
extern void i2o_device_remove(struct i2o_device *);
|
||||
extern int i2o_device_parse_lct(struct i2o_controller *);
|
||||
|
||||
int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist,
|
||||
int oplen, void *reslist, int reslen);
|
||||
|
||||
/* IOP */
|
||||
extern struct i2o_controller *i2o_iop_alloc(void);
|
||||
|
||||
/**
|
||||
* i2o_iop_free - Free the i2o_controller struct
|
||||
* @c: I2O controller to free
|
||||
*/
|
||||
static inline void i2o_iop_free(struct i2o_controller *c)
|
||||
{
|
||||
i2o_pool_free(&c->in_msg);
|
||||
kfree(c);
|
||||
}
|
||||
|
||||
extern int i2o_iop_add(struct i2o_controller *);
|
||||
extern void i2o_iop_remove(struct i2o_controller *);
|
||||
|
||||
/* control registers relative to c->base */
|
||||
#define I2O_IRQ_STATUS 0x30
|
||||
#define I2O_IRQ_MASK 0x34
|
||||
#define I2O_IN_PORT 0x40
|
||||
#define I2O_OUT_PORT 0x44
|
||||
|
||||
/* Motorola/Freescale specific register offset */
|
||||
#define I2O_MOTOROLA_PORT_OFFSET 0x10400
|
||||
|
||||
#define I2O_IRQ_OUTBOUND_POST 0x00000008
|
||||
@@ -1,473 +0,0 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/pci.h>
|
||||
#include "i2o.h"
|
||||
|
||||
static void i2o_report_util_cmd(u8 cmd);
|
||||
static void i2o_report_exec_cmd(u8 cmd);
|
||||
static void i2o_report_fail_status(u8 req_status, u32 *msg);
|
||||
static void i2o_report_common_status(u8 req_status);
|
||||
static void i2o_report_common_dsc(u16 detailed_status);
|
||||
|
||||
/*
|
||||
* Used for error reporting/debugging purposes.
|
||||
* Report Cmd name, Request status, Detailed Status.
|
||||
*/
|
||||
void i2o_report_status(const char *severity, const char *str,
|
||||
struct i2o_message *m)
|
||||
{
|
||||
u32 *msg = (u32 *) m;
|
||||
u8 cmd = (msg[1] >> 24) & 0xFF;
|
||||
u8 req_status = (msg[4] >> 24) & 0xFF;
|
||||
u16 detailed_status = msg[4] & 0xFFFF;
|
||||
|
||||
if (cmd == I2O_CMD_UTIL_EVT_REGISTER)
|
||||
return; /* No status in this reply */
|
||||
|
||||
printk("%s%s: ", severity, str);
|
||||
|
||||
if (cmd < 0x1F) // Utility cmd
|
||||
i2o_report_util_cmd(cmd);
|
||||
|
||||
else if (cmd >= 0xA0 && cmd <= 0xEF) // Executive cmd
|
||||
i2o_report_exec_cmd(cmd);
|
||||
else
|
||||
printk("Cmd = %0#2x, ", cmd); // Other cmds
|
||||
|
||||
if (msg[0] & MSG_FAIL) {
|
||||
i2o_report_fail_status(req_status, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
i2o_report_common_status(req_status);
|
||||
|
||||
if (cmd < 0x1F || (cmd >= 0xA0 && cmd <= 0xEF))
|
||||
i2o_report_common_dsc(detailed_status);
|
||||
else
|
||||
printk(" / DetailedStatus = %0#4x.\n",
|
||||
detailed_status);
|
||||
}
|
||||
|
||||
/* Used to dump a message to syslog during debugging */
|
||||
void i2o_dump_message(struct i2o_message *m)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
u32 *msg = (u32 *) m;
|
||||
int i;
|
||||
|
||||
printk(KERN_INFO "Dumping I2O message size %d @ %p\n",
|
||||
msg[0] >> 16 & 0xffff, msg);
|
||||
for (i = 0; i < ((msg[0] >> 16) & 0xffff); i++)
|
||||
printk(KERN_INFO " msg[%d] = %0#10x\n", i, msg[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Used for error reporting/debugging purposes.
|
||||
* Following fail status are common to all classes.
|
||||
* The preserved message must be handled in the reply handler.
|
||||
*/
|
||||
static void i2o_report_fail_status(u8 req_status, u32 *msg)
|
||||
{
|
||||
static char *FAIL_STATUS[] = {
|
||||
"0x80", /* not used */
|
||||
"SERVICE_SUSPENDED", /* 0x81 */
|
||||
"SERVICE_TERMINATED", /* 0x82 */
|
||||
"CONGESTION",
|
||||
"FAILURE",
|
||||
"STATE_ERROR",
|
||||
"TIME_OUT",
|
||||
"ROUTING_FAILURE",
|
||||
"INVALID_VERSION",
|
||||
"INVALID_OFFSET",
|
||||
"INVALID_MSG_FLAGS",
|
||||
"FRAME_TOO_SMALL",
|
||||
"FRAME_TOO_LARGE",
|
||||
"INVALID_TARGET_ID",
|
||||
"INVALID_INITIATOR_ID",
|
||||
"INVALID_INITIATOR_CONTEX", /* 0x8F */
|
||||
"UNKNOWN_FAILURE" /* 0xFF */
|
||||
};
|
||||
|
||||
if (req_status == I2O_FSC_TRANSPORT_UNKNOWN_FAILURE)
|
||||
printk("TRANSPORT_UNKNOWN_FAILURE (%0#2x).\n",
|
||||
req_status);
|
||||
else
|
||||
printk("TRANSPORT_%s.\n",
|
||||
FAIL_STATUS[req_status & 0x0F]);
|
||||
|
||||
/* Dump some details */
|
||||
|
||||
printk(KERN_ERR " InitiatorId = %d, TargetId = %d\n",
|
||||
(msg[1] >> 12) & 0xFFF, msg[1] & 0xFFF);
|
||||
printk(KERN_ERR " LowestVersion = 0x%02X, HighestVersion = 0x%02X\n",
|
||||
(msg[4] >> 8) & 0xFF, msg[4] & 0xFF);
|
||||
printk(KERN_ERR " FailingHostUnit = 0x%04X, FailingIOP = 0x%03X\n",
|
||||
msg[5] >> 16, msg[5] & 0xFFF);
|
||||
|
||||
printk(KERN_ERR " Severity: 0x%02X\n", (msg[4] >> 16) & 0xFF);
|
||||
if (msg[4] & (1 << 16))
|
||||
printk(KERN_DEBUG "(FormatError), "
|
||||
"this msg can never be delivered/processed.\n");
|
||||
if (msg[4] & (1 << 17))
|
||||
printk(KERN_DEBUG "(PathError), "
|
||||
"this msg can no longer be delivered/processed.\n");
|
||||
if (msg[4] & (1 << 18))
|
||||
printk(KERN_DEBUG "(PathState), "
|
||||
"the system state does not allow delivery.\n");
|
||||
if (msg[4] & (1 << 19))
|
||||
printk(KERN_DEBUG
|
||||
"(Congestion), resources temporarily not available;"
|
||||
"do not retry immediately.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Used for error reporting/debugging purposes.
|
||||
* Following reply status are common to all classes.
|
||||
*/
|
||||
static void i2o_report_common_status(u8 req_status)
|
||||
{
|
||||
static char *REPLY_STATUS[] = {
|
||||
"SUCCESS",
|
||||
"ABORT_DIRTY",
|
||||
"ABORT_NO_DATA_TRANSFER",
|
||||
"ABORT_PARTIAL_TRANSFER",
|
||||
"ERROR_DIRTY",
|
||||
"ERROR_NO_DATA_TRANSFER",
|
||||
"ERROR_PARTIAL_TRANSFER",
|
||||
"PROCESS_ABORT_DIRTY",
|
||||
"PROCESS_ABORT_NO_DATA_TRANSFER",
|
||||
"PROCESS_ABORT_PARTIAL_TRANSFER",
|
||||
"TRANSACTION_ERROR",
|
||||
"PROGRESS_REPORT"
|
||||
};
|
||||
|
||||
if (req_status >= ARRAY_SIZE(REPLY_STATUS))
|
||||
printk("RequestStatus = %0#2x", req_status);
|
||||
else
|
||||
printk("%s", REPLY_STATUS[req_status]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Used for error reporting/debugging purposes.
|
||||
* Following detailed status are valid for executive class,
|
||||
* utility class, DDM class and for transaction error replies.
|
||||
*/
|
||||
static void i2o_report_common_dsc(u16 detailed_status)
|
||||
{
|
||||
static char *COMMON_DSC[] = {
|
||||
"SUCCESS",
|
||||
"0x01", // not used
|
||||
"BAD_KEY",
|
||||
"TCL_ERROR",
|
||||
"REPLY_BUFFER_FULL",
|
||||
"NO_SUCH_PAGE",
|
||||
"INSUFFICIENT_RESOURCE_SOFT",
|
||||
"INSUFFICIENT_RESOURCE_HARD",
|
||||
"0x08", // not used
|
||||
"CHAIN_BUFFER_TOO_LARGE",
|
||||
"UNSUPPORTED_FUNCTION",
|
||||
"DEVICE_LOCKED",
|
||||
"DEVICE_RESET",
|
||||
"INAPPROPRIATE_FUNCTION",
|
||||
"INVALID_INITIATOR_ADDRESS",
|
||||
"INVALID_MESSAGE_FLAGS",
|
||||
"INVALID_OFFSET",
|
||||
"INVALID_PARAMETER",
|
||||
"INVALID_REQUEST",
|
||||
"INVALID_TARGET_ADDRESS",
|
||||
"MESSAGE_TOO_LARGE",
|
||||
"MESSAGE_TOO_SMALL",
|
||||
"MISSING_PARAMETER",
|
||||
"TIMEOUT",
|
||||
"UNKNOWN_ERROR",
|
||||
"UNKNOWN_FUNCTION",
|
||||
"UNSUPPORTED_VERSION",
|
||||
"DEVICE_BUSY",
|
||||
"DEVICE_NOT_AVAILABLE"
|
||||
};
|
||||
|
||||
if (detailed_status > I2O_DSC_DEVICE_NOT_AVAILABLE)
|
||||
printk(" / DetailedStatus = %0#4x.\n",
|
||||
detailed_status);
|
||||
else
|
||||
printk(" / %s.\n", COMMON_DSC[detailed_status]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Used for error reporting/debugging purposes
|
||||
*/
|
||||
static void i2o_report_util_cmd(u8 cmd)
|
||||
{
|
||||
switch (cmd) {
|
||||
case I2O_CMD_UTIL_NOP:
|
||||
printk("UTIL_NOP, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_ABORT:
|
||||
printk("UTIL_ABORT, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_CLAIM:
|
||||
printk("UTIL_CLAIM, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_RELEASE:
|
||||
printk("UTIL_CLAIM_RELEASE, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_CONFIG_DIALOG:
|
||||
printk("UTIL_CONFIG_DIALOG, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_DEVICE_RESERVE:
|
||||
printk("UTIL_DEVICE_RESERVE, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_DEVICE_RELEASE:
|
||||
printk("UTIL_DEVICE_RELEASE, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_EVT_ACK:
|
||||
printk("UTIL_EVENT_ACKNOWLEDGE, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_EVT_REGISTER:
|
||||
printk("UTIL_EVENT_REGISTER, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_LOCK:
|
||||
printk("UTIL_LOCK, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_LOCK_RELEASE:
|
||||
printk("UTIL_LOCK_RELEASE, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_PARAMS_GET:
|
||||
printk("UTIL_PARAMS_GET, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_PARAMS_SET:
|
||||
printk("UTIL_PARAMS_SET, ");
|
||||
break;
|
||||
case I2O_CMD_UTIL_REPLY_FAULT_NOTIFY:
|
||||
printk("UTIL_REPLY_FAULT_NOTIFY, ");
|
||||
break;
|
||||
default:
|
||||
printk("Cmd = %0#2x, ", cmd);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Used for error reporting/debugging purposes
|
||||
*/
|
||||
static void i2o_report_exec_cmd(u8 cmd)
|
||||
{
|
||||
switch (cmd) {
|
||||
case I2O_CMD_ADAPTER_ASSIGN:
|
||||
printk("EXEC_ADAPTER_ASSIGN, ");
|
||||
break;
|
||||
case I2O_CMD_ADAPTER_READ:
|
||||
printk("EXEC_ADAPTER_READ, ");
|
||||
break;
|
||||
case I2O_CMD_ADAPTER_RELEASE:
|
||||
printk("EXEC_ADAPTER_RELEASE, ");
|
||||
break;
|
||||
case I2O_CMD_BIOS_INFO_SET:
|
||||
printk("EXEC_BIOS_INFO_SET, ");
|
||||
break;
|
||||
case I2O_CMD_BOOT_DEVICE_SET:
|
||||
printk("EXEC_BOOT_DEVICE_SET, ");
|
||||
break;
|
||||
case I2O_CMD_CONFIG_VALIDATE:
|
||||
printk("EXEC_CONFIG_VALIDATE, ");
|
||||
break;
|
||||
case I2O_CMD_CONN_SETUP:
|
||||
printk("EXEC_CONN_SETUP, ");
|
||||
break;
|
||||
case I2O_CMD_DDM_DESTROY:
|
||||
printk("EXEC_DDM_DESTROY, ");
|
||||
break;
|
||||
case I2O_CMD_DDM_ENABLE:
|
||||
printk("EXEC_DDM_ENABLE, ");
|
||||
break;
|
||||
case I2O_CMD_DDM_QUIESCE:
|
||||
printk("EXEC_DDM_QUIESCE, ");
|
||||
break;
|
||||
case I2O_CMD_DDM_RESET:
|
||||
printk("EXEC_DDM_RESET, ");
|
||||
break;
|
||||
case I2O_CMD_DDM_SUSPEND:
|
||||
printk("EXEC_DDM_SUSPEND, ");
|
||||
break;
|
||||
case I2O_CMD_DEVICE_ASSIGN:
|
||||
printk("EXEC_DEVICE_ASSIGN, ");
|
||||
break;
|
||||
case I2O_CMD_DEVICE_RELEASE:
|
||||
printk("EXEC_DEVICE_RELEASE, ");
|
||||
break;
|
||||
case I2O_CMD_HRT_GET:
|
||||
printk("EXEC_HRT_GET, ");
|
||||
break;
|
||||
case I2O_CMD_ADAPTER_CLEAR:
|
||||
printk("EXEC_IOP_CLEAR, ");
|
||||
break;
|
||||
case I2O_CMD_ADAPTER_CONNECT:
|
||||
printk("EXEC_IOP_CONNECT, ");
|
||||
break;
|
||||
case I2O_CMD_ADAPTER_RESET:
|
||||
printk("EXEC_IOP_RESET, ");
|
||||
break;
|
||||
case I2O_CMD_LCT_NOTIFY:
|
||||
printk("EXEC_LCT_NOTIFY, ");
|
||||
break;
|
||||
case I2O_CMD_OUTBOUND_INIT:
|
||||
printk("EXEC_OUTBOUND_INIT, ");
|
||||
break;
|
||||
case I2O_CMD_PATH_ENABLE:
|
||||
printk("EXEC_PATH_ENABLE, ");
|
||||
break;
|
||||
case I2O_CMD_PATH_QUIESCE:
|
||||
printk("EXEC_PATH_QUIESCE, ");
|
||||
break;
|
||||
case I2O_CMD_PATH_RESET:
|
||||
printk("EXEC_PATH_RESET, ");
|
||||
break;
|
||||
case I2O_CMD_STATIC_MF_CREATE:
|
||||
printk("EXEC_STATIC_MF_CREATE, ");
|
||||
break;
|
||||
case I2O_CMD_STATIC_MF_RELEASE:
|
||||
printk("EXEC_STATIC_MF_RELEASE, ");
|
||||
break;
|
||||
case I2O_CMD_STATUS_GET:
|
||||
printk("EXEC_STATUS_GET, ");
|
||||
break;
|
||||
case I2O_CMD_SW_DOWNLOAD:
|
||||
printk("EXEC_SW_DOWNLOAD, ");
|
||||
break;
|
||||
case I2O_CMD_SW_UPLOAD:
|
||||
printk("EXEC_SW_UPLOAD, ");
|
||||
break;
|
||||
case I2O_CMD_SW_REMOVE:
|
||||
printk("EXEC_SW_REMOVE, ");
|
||||
break;
|
||||
case I2O_CMD_SYS_ENABLE:
|
||||
printk("EXEC_SYS_ENABLE, ");
|
||||
break;
|
||||
case I2O_CMD_SYS_MODIFY:
|
||||
printk("EXEC_SYS_MODIFY, ");
|
||||
break;
|
||||
case I2O_CMD_SYS_QUIESCE:
|
||||
printk("EXEC_SYS_QUIESCE, ");
|
||||
break;
|
||||
case I2O_CMD_SYS_TAB_SET:
|
||||
printk("EXEC_SYS_TAB_SET, ");
|
||||
break;
|
||||
default:
|
||||
printk("Cmd = %#02x, ", cmd);
|
||||
}
|
||||
}
|
||||
|
||||
void i2o_debug_state(struct i2o_controller *c)
|
||||
{
|
||||
printk(KERN_INFO "%s: State = ", c->name);
|
||||
switch (((i2o_status_block *) c->status_block.virt)->iop_state) {
|
||||
case 0x01:
|
||||
printk("INIT\n");
|
||||
break;
|
||||
case 0x02:
|
||||
printk("RESET\n");
|
||||
break;
|
||||
case 0x04:
|
||||
printk("HOLD\n");
|
||||
break;
|
||||
case 0x05:
|
||||
printk("READY\n");
|
||||
break;
|
||||
case 0x08:
|
||||
printk("OPERATIONAL\n");
|
||||
break;
|
||||
case 0x10:
|
||||
printk("FAILED\n");
|
||||
break;
|
||||
case 0x11:
|
||||
printk("FAULTED\n");
|
||||
break;
|
||||
default:
|
||||
printk("%x (unknown !!)\n",
|
||||
((i2o_status_block *) c->status_block.virt)->iop_state);
|
||||
}
|
||||
};
|
||||
|
||||
void i2o_dump_hrt(struct i2o_controller *c)
|
||||
{
|
||||
u32 *rows = (u32 *) c->hrt.virt;
|
||||
u8 *p = (u8 *) c->hrt.virt;
|
||||
u8 *d;
|
||||
int count;
|
||||
int length;
|
||||
int i;
|
||||
int state;
|
||||
|
||||
if (p[3] != 0) {
|
||||
printk(KERN_ERR
|
||||
"%s: HRT table for controller is too new a version.\n",
|
||||
c->name);
|
||||
return;
|
||||
}
|
||||
|
||||
count = p[0] | (p[1] << 8);
|
||||
length = p[2];
|
||||
|
||||
printk(KERN_INFO "%s: HRT has %d entries of %d bytes each.\n",
|
||||
c->name, count, length << 2);
|
||||
|
||||
rows += 2;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
printk(KERN_INFO "Adapter %08X: ", rows[0]);
|
||||
p = (u8 *) (rows + 1);
|
||||
d = (u8 *) (rows + 2);
|
||||
state = p[1] << 8 | p[0];
|
||||
|
||||
printk("TID %04X:[", state & 0xFFF);
|
||||
state >>= 12;
|
||||
if (state & (1 << 0))
|
||||
printk("H"); /* Hidden */
|
||||
if (state & (1 << 2)) {
|
||||
printk("P"); /* Present */
|
||||
if (state & (1 << 1))
|
||||
printk("C"); /* Controlled */
|
||||
}
|
||||
if (state > 9)
|
||||
printk("*"); /* Hard */
|
||||
|
||||
printk("]:");
|
||||
|
||||
switch (p[3] & 0xFFFF) {
|
||||
case 0:
|
||||
/* Adapter private bus - easy */
|
||||
printk("Local bus %d: I/O at 0x%04X Mem 0x%08X", p[2],
|
||||
d[1] << 8 | d[0], *(u32 *) (d + 4));
|
||||
break;
|
||||
case 1:
|
||||
/* ISA bus */
|
||||
printk("ISA %d: CSN %d I/O at 0x%04X Mem 0x%08X", p[2],
|
||||
d[2], d[1] << 8 | d[0], *(u32 *) (d + 4));
|
||||
break;
|
||||
|
||||
case 2: /* EISA bus */
|
||||
printk("EISA %d: Slot %d I/O at 0x%04X Mem 0x%08X",
|
||||
p[2], d[3], d[1] << 8 | d[0], *(u32 *) (d + 4));
|
||||
break;
|
||||
|
||||
case 3: /* MCA bus */
|
||||
printk("MCA %d: Slot %d I/O at 0x%04X Mem 0x%08X", p[2],
|
||||
d[3], d[1] << 8 | d[0], *(u32 *) (d + 4));
|
||||
break;
|
||||
|
||||
case 4: /* PCI bus */
|
||||
printk("PCI %d: Bus %d Device %d Function %d", p[2],
|
||||
d[2], d[1], d[0]);
|
||||
break;
|
||||
|
||||
case 0x80: /* Other */
|
||||
default:
|
||||
printk("Unsupported bus type.");
|
||||
break;
|
||||
}
|
||||
printk("\n");
|
||||
rows += length;
|
||||
}
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(i2o_dump_message);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,381 +0,0 @@
|
||||
/*
|
||||
* Functions to handle I2O drivers (OSMs) and I2O bus type for sysfs
|
||||
*
|
||||
* Copyright (C) 2004 Markus Lidel <Markus.Lidel@shadowconnect.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Fixes/additions:
|
||||
* Markus Lidel <Markus.Lidel@shadowconnect.com>
|
||||
* initial version.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/rwsem.h>
|
||||
#include "i2o.h"
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/slab.h>
|
||||
#include "core.h"
|
||||
|
||||
#define OSM_NAME "i2o"
|
||||
|
||||
/* max_drivers - Maximum I2O drivers (OSMs) which could be registered */
|
||||
static unsigned int i2o_max_drivers = I2O_MAX_DRIVERS;
|
||||
module_param_named(max_drivers, i2o_max_drivers, uint, 0);
|
||||
MODULE_PARM_DESC(max_drivers, "maximum number of OSM's to support");
|
||||
|
||||
/* I2O drivers lock and array */
|
||||
static spinlock_t i2o_drivers_lock;
|
||||
static struct i2o_driver **i2o_drivers;
|
||||
|
||||
/**
|
||||
* i2o_bus_match - Tell if I2O device class id matches the class ids of the I2O driver (OSM)
|
||||
* @dev: device which should be verified
|
||||
* @drv: the driver to match against
|
||||
*
|
||||
* Used by the bus to check if the driver wants to handle the device.
|
||||
*
|
||||
* Returns 1 if the class ids of the driver match the class id of the
|
||||
* device, otherwise 0.
|
||||
*/
|
||||
static int i2o_bus_match(struct device *dev, struct device_driver *drv)
|
||||
{
|
||||
struct i2o_device *i2o_dev = to_i2o_device(dev);
|
||||
struct i2o_driver *i2o_drv = to_i2o_driver(drv);
|
||||
struct i2o_class_id *ids = i2o_drv->classes;
|
||||
|
||||
if (ids)
|
||||
while (ids->class_id != I2O_CLASS_END) {
|
||||
if (ids->class_id == i2o_dev->lct_data.class_id)
|
||||
return 1;
|
||||
ids++;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
/* I2O bus type */
|
||||
struct bus_type i2o_bus_type = {
|
||||
.name = "i2o",
|
||||
.match = i2o_bus_match,
|
||||
.dev_groups = i2o_device_groups,
|
||||
};
|
||||
|
||||
/**
|
||||
* i2o_driver_register - Register a I2O driver (OSM) in the I2O core
|
||||
* @drv: I2O driver which should be registered
|
||||
*
|
||||
* Registers the OSM drv in the I2O core and creates an event queues if
|
||||
* necessary.
|
||||
*
|
||||
* Returns 0 on success or negative error code on failure.
|
||||
*/
|
||||
int i2o_driver_register(struct i2o_driver *drv)
|
||||
{
|
||||
struct i2o_controller *c;
|
||||
int i;
|
||||
int rc = 0;
|
||||
unsigned long flags;
|
||||
|
||||
osm_debug("Register driver %s\n", drv->name);
|
||||
|
||||
if (drv->event) {
|
||||
drv->event_queue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1,
|
||||
drv->name);
|
||||
if (!drv->event_queue) {
|
||||
osm_err("Could not initialize event queue for driver "
|
||||
"%s\n", drv->name);
|
||||
return -EFAULT;
|
||||
}
|
||||
osm_debug("Event queue initialized for driver %s\n", drv->name);
|
||||
} else
|
||||
drv->event_queue = NULL;
|
||||
|
||||
drv->driver.name = drv->name;
|
||||
drv->driver.bus = &i2o_bus_type;
|
||||
|
||||
spin_lock_irqsave(&i2o_drivers_lock, flags);
|
||||
|
||||
for (i = 0; i2o_drivers[i]; i++)
|
||||
if (i >= i2o_max_drivers) {
|
||||
osm_err("too many drivers registered, increase max_drivers\n");
|
||||
spin_unlock_irqrestore(&i2o_drivers_lock, flags);
|
||||
rc = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
drv->context = i;
|
||||
i2o_drivers[i] = drv;
|
||||
|
||||
spin_unlock_irqrestore(&i2o_drivers_lock, flags);
|
||||
|
||||
osm_debug("driver %s gets context id %d\n", drv->name, drv->context);
|
||||
|
||||
list_for_each_entry(c, &i2o_controllers, list) {
|
||||
struct i2o_device *i2o_dev;
|
||||
|
||||
i2o_driver_notify_controller_add(drv, c);
|
||||
list_for_each_entry(i2o_dev, &c->devices, list)
|
||||
i2o_driver_notify_device_add(drv, i2o_dev);
|
||||
}
|
||||
|
||||
rc = driver_register(&drv->driver);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
return 0;
|
||||
out:
|
||||
if (drv->event_queue) {
|
||||
destroy_workqueue(drv->event_queue);
|
||||
drv->event_queue = NULL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
};
|
||||
|
||||
/**
|
||||
* i2o_driver_unregister - Unregister a I2O driver (OSM) from the I2O core
|
||||
* @drv: I2O driver which should be unregistered
|
||||
*
|
||||
* Unregisters the OSM drv from the I2O core and cleanup event queues if
|
||||
* necessary.
|
||||
*/
|
||||
void i2o_driver_unregister(struct i2o_driver *drv)
|
||||
{
|
||||
struct i2o_controller *c;
|
||||
unsigned long flags;
|
||||
|
||||
osm_debug("unregister driver %s\n", drv->name);
|
||||
|
||||
driver_unregister(&drv->driver);
|
||||
|
||||
list_for_each_entry(c, &i2o_controllers, list) {
|
||||
struct i2o_device *i2o_dev;
|
||||
|
||||
list_for_each_entry(i2o_dev, &c->devices, list)
|
||||
i2o_driver_notify_device_remove(drv, i2o_dev);
|
||||
|
||||
i2o_driver_notify_controller_remove(drv, c);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&i2o_drivers_lock, flags);
|
||||
i2o_drivers[drv->context] = NULL;
|
||||
spin_unlock_irqrestore(&i2o_drivers_lock, flags);
|
||||
|
||||
if (drv->event_queue) {
|
||||
destroy_workqueue(drv->event_queue);
|
||||
drv->event_queue = NULL;
|
||||
osm_debug("event queue removed for %s\n", drv->name);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* i2o_driver_dispatch - dispatch an I2O reply message
|
||||
* @c: I2O controller of the message
|
||||
* @m: I2O message number
|
||||
*
|
||||
* The reply is delivered to the driver from which the original message
|
||||
* was. This function is only called from interrupt context.
|
||||
*
|
||||
* Returns 0 on success and the message should not be flushed. Returns > 0
|
||||
* on success and if the message should be flushed afterwords. Returns
|
||||
* negative error code on failure (the message will be flushed too).
|
||||
*/
|
||||
int i2o_driver_dispatch(struct i2o_controller *c, u32 m)
|
||||
{
|
||||
struct i2o_driver *drv;
|
||||
struct i2o_message *msg = i2o_msg_out_to_virt(c, m);
|
||||
u32 context = le32_to_cpu(msg->u.s.icntxt);
|
||||
unsigned long flags;
|
||||
|
||||
if (unlikely(context >= i2o_max_drivers)) {
|
||||
osm_warn("%s: Spurious reply to unknown driver %d\n", c->name,
|
||||
context);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&i2o_drivers_lock, flags);
|
||||
drv = i2o_drivers[context];
|
||||
spin_unlock_irqrestore(&i2o_drivers_lock, flags);
|
||||
|
||||
if (unlikely(!drv)) {
|
||||
osm_warn("%s: Spurious reply to unknown driver %d\n", c->name,
|
||||
context);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if ((le32_to_cpu(msg->u.head[1]) >> 24) == I2O_CMD_UTIL_EVT_REGISTER) {
|
||||
struct i2o_device *dev, *tmp;
|
||||
struct i2o_event *evt;
|
||||
u16 size;
|
||||
u16 tid = le32_to_cpu(msg->u.head[1]) & 0xfff;
|
||||
|
||||
osm_debug("event received from device %d\n", tid);
|
||||
|
||||
if (!drv->event)
|
||||
return -EIO;
|
||||
|
||||
/* cut of header from message size (in 32-bit words) */
|
||||
size = (le32_to_cpu(msg->u.head[0]) >> 16) - 5;
|
||||
|
||||
evt = kzalloc(size * 4 + sizeof(*evt), GFP_ATOMIC);
|
||||
if (!evt)
|
||||
return -ENOMEM;
|
||||
|
||||
evt->size = size;
|
||||
evt->tcntxt = le32_to_cpu(msg->u.s.tcntxt);
|
||||
evt->event_indicator = le32_to_cpu(msg->body[0]);
|
||||
memcpy(&evt->data, &msg->body[1], size * 4);
|
||||
|
||||
list_for_each_entry_safe(dev, tmp, &c->devices, list)
|
||||
if (dev->lct_data.tid == tid) {
|
||||
evt->i2o_dev = dev;
|
||||
break;
|
||||
}
|
||||
|
||||
INIT_WORK(&evt->work, drv->event);
|
||||
queue_work(drv->event_queue, &evt->work);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unlikely(!drv->reply)) {
|
||||
osm_debug("%s: Reply to driver %s, but no reply function defined!\n",
|
||||
c->name, drv->name);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return drv->reply(c, m, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* i2o_driver_notify_controller_add_all - Send notify of added controller
|
||||
* @c: newly added controller
|
||||
*
|
||||
* Send notifications to all registered drivers that a new controller was
|
||||
* added.
|
||||
*/
|
||||
void i2o_driver_notify_controller_add_all(struct i2o_controller *c)
|
||||
{
|
||||
int i;
|
||||
struct i2o_driver *drv;
|
||||
|
||||
for (i = 0; i < i2o_max_drivers; i++) {
|
||||
drv = i2o_drivers[i];
|
||||
|
||||
if (drv)
|
||||
i2o_driver_notify_controller_add(drv, c);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* i2o_driver_notify_controller_remove_all - Send notify of removed controller
|
||||
* @c: controller that is being removed
|
||||
*
|
||||
* Send notifications to all registered drivers that a controller was
|
||||
* removed.
|
||||
*/
|
||||
void i2o_driver_notify_controller_remove_all(struct i2o_controller *c)
|
||||
{
|
||||
int i;
|
||||
struct i2o_driver *drv;
|
||||
|
||||
for (i = 0; i < i2o_max_drivers; i++) {
|
||||
drv = i2o_drivers[i];
|
||||
|
||||
if (drv)
|
||||
i2o_driver_notify_controller_remove(drv, c);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* i2o_driver_notify_device_add_all - Send notify of added device
|
||||
* @i2o_dev: newly added I2O device
|
||||
*
|
||||
* Send notifications to all registered drivers that a device was added.
|
||||
*/
|
||||
void i2o_driver_notify_device_add_all(struct i2o_device *i2o_dev)
|
||||
{
|
||||
int i;
|
||||
struct i2o_driver *drv;
|
||||
|
||||
for (i = 0; i < i2o_max_drivers; i++) {
|
||||
drv = i2o_drivers[i];
|
||||
|
||||
if (drv)
|
||||
i2o_driver_notify_device_add(drv, i2o_dev);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* i2o_driver_notify_device_remove_all - Send notify of removed device
|
||||
* @i2o_dev: device that is being removed
|
||||
*
|
||||
* Send notifications to all registered drivers that a device was removed.
|
||||
*/
|
||||
void i2o_driver_notify_device_remove_all(struct i2o_device *i2o_dev)
|
||||
{
|
||||
int i;
|
||||
struct i2o_driver *drv;
|
||||
|
||||
for (i = 0; i < i2o_max_drivers; i++) {
|
||||
drv = i2o_drivers[i];
|
||||
|
||||
if (drv)
|
||||
i2o_driver_notify_device_remove(drv, i2o_dev);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* i2o_driver_init - initialize I2O drivers (OSMs)
|
||||
*
|
||||
* Registers the I2O bus and allocate memory for the array of OSMs.
|
||||
*
|
||||
* Returns 0 on success or negative error code on failure.
|
||||
*/
|
||||
int __init i2o_driver_init(void)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
spin_lock_init(&i2o_drivers_lock);
|
||||
|
||||
if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64)) {
|
||||
osm_warn("max_drivers set to %d, but must be >=2 and <= 64\n",
|
||||
i2o_max_drivers);
|
||||
i2o_max_drivers = I2O_MAX_DRIVERS;
|
||||
}
|
||||
osm_info("max drivers = %d\n", i2o_max_drivers);
|
||||
|
||||
i2o_drivers =
|
||||
kcalloc(i2o_max_drivers, sizeof(*i2o_drivers), GFP_KERNEL);
|
||||
if (!i2o_drivers)
|
||||
return -ENOMEM;
|
||||
|
||||
rc = bus_register(&i2o_bus_type);
|
||||
|
||||
if (rc < 0)
|
||||
kfree(i2o_drivers);
|
||||
|
||||
return rc;
|
||||
};
|
||||
|
||||
/**
|
||||
* i2o_driver_exit - clean up I2O drivers (OSMs)
|
||||
*
|
||||
* Unregisters the I2O bus and frees driver array.
|
||||
*/
|
||||
void i2o_driver_exit(void)
|
||||
{
|
||||
bus_unregister(&i2o_bus_type);
|
||||
kfree(i2o_drivers);
|
||||
};
|
||||
|
||||
EXPORT_SYMBOL(i2o_driver_register);
|
||||
EXPORT_SYMBOL(i2o_driver_unregister);
|
||||
EXPORT_SYMBOL(i2o_driver_notify_controller_add_all);
|
||||
EXPORT_SYMBOL(i2o_driver_notify_controller_remove_all);
|
||||
EXPORT_SYMBOL(i2o_driver_notify_device_add_all);
|
||||
EXPORT_SYMBOL(i2o_driver_notify_device_remove_all);
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,103 +0,0 @@
|
||||
/*
|
||||
* Block OSM structures/API
|
||||
*
|
||||
* Copyright (C) 1999-2002 Red Hat Software
|
||||
*
|
||||
* Written by Alan Cox, Building Number Three Ltd
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* For the purpose of avoiding doubt the preferred form of the work
|
||||
* for making modifications shall be a standards compliant form such
|
||||
* gzipped tar and not one requiring a proprietary or patent encumbered
|
||||
* tool to unpack.
|
||||
*
|
||||
* Fixes/additions:
|
||||
* Steve Ralston:
|
||||
* Multiple device handling error fixes,
|
||||
* Added a queue depth.
|
||||
* Alan Cox:
|
||||
* FC920 has an rmw bug. Dont or in the end marker.
|
||||
* Removed queue walk, fixed for 64bitness.
|
||||
* Rewrote much of the code over time
|
||||
* Added indirect block lists
|
||||
* Handle 64K limits on many controllers
|
||||
* Don't use indirects on the Promise (breaks)
|
||||
* Heavily chop down the queue depths
|
||||
* Deepak Saxena:
|
||||
* Independent queues per IOP
|
||||
* Support for dynamic device creation/deletion
|
||||
* Code cleanup
|
||||
* Support for larger I/Os through merge* functions
|
||||
* (taken from DAC960 driver)
|
||||
* Boji T Kannanthanam:
|
||||
* Set the I2O Block devices to be detected in increasing
|
||||
* order of TIDs during boot.
|
||||
* Search and set the I2O block device that we boot off
|
||||
* from as the first device to be claimed (as /dev/i2o/hda)
|
||||
* Properly attach/detach I2O gendisk structure from the
|
||||
* system gendisk list. The I2O block devices now appear in
|
||||
* /proc/partitions.
|
||||
* Markus Lidel <Markus.Lidel@shadowconnect.com>:
|
||||
* Minor bugfixes for 2.6.
|
||||
*/
|
||||
|
||||
#ifndef I2O_BLOCK_OSM_H
|
||||
#define I2O_BLOCK_OSM_H
|
||||
|
||||
#define I2O_BLOCK_RETRY_TIME HZ/4
|
||||
#define I2O_BLOCK_MAX_OPEN_REQUESTS 50
|
||||
|
||||
/* request queue sizes */
|
||||
#define I2O_BLOCK_REQ_MEMPOOL_SIZE 32
|
||||
|
||||
#define KERNEL_SECTOR_SHIFT 9
|
||||
#define KERNEL_SECTOR_SIZE (1 << KERNEL_SECTOR_SHIFT)
|
||||
|
||||
/* I2O Block OSM mempool struct */
|
||||
struct i2o_block_mempool {
|
||||
struct kmem_cache *slab;
|
||||
mempool_t *pool;
|
||||
};
|
||||
|
||||
/* I2O Block device descriptor */
|
||||
struct i2o_block_device {
|
||||
struct i2o_device *i2o_dev; /* pointer to I2O device */
|
||||
struct gendisk *gd;
|
||||
spinlock_t lock; /* queue lock */
|
||||
struct list_head open_queue; /* list of transferred, but unfinished
|
||||
requests */
|
||||
unsigned int open_queue_depth; /* number of requests in the queue */
|
||||
|
||||
int rcache; /* read cache flags */
|
||||
int wcache; /* write cache flags */
|
||||
int flags;
|
||||
u16 power; /* power state */
|
||||
int media_change_flag; /* media changed flag */
|
||||
};
|
||||
|
||||
/* I2O Block device request */
|
||||
struct i2o_block_request {
|
||||
struct list_head queue;
|
||||
struct request *req; /* corresponding request */
|
||||
struct i2o_block_device *i2o_blk_dev; /* I2O block device */
|
||||
struct device *dev; /* device used for DMA */
|
||||
int sg_nents; /* number of SG elements */
|
||||
struct scatterlist sg_table[I2O_MAX_PHYS_SEGMENTS]; /* SG table */
|
||||
};
|
||||
|
||||
/* I2O Block device delayed request */
|
||||
struct i2o_block_delayed_request {
|
||||
struct delayed_work work;
|
||||
struct request_queue *queue;
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user