aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-03-02 09:36:16 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-21 07:47:59 -0400
commit8cfc7ca40c41e6cb9ee96c149d5b928564d635e4 (patch)
tree7bb3eab7c0e5cddb884ab91cdcb84e9435592ceb
parentb6a895307a6a8d8c294c57d319ec05286d181dac (diff)
[PATCH] switch pf
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--drivers/block/paride/pf.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index e08ca5161ad8..bef3b997ba3e 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -201,13 +201,13 @@ module_param_array(drive3, int, NULL, 0);
201#define ATAPI_READ_10 0x28 201#define ATAPI_READ_10 0x28
202#define ATAPI_WRITE_10 0x2a 202#define ATAPI_WRITE_10 0x2a
203 203
204static int pf_open(struct inode *inode, struct file *file); 204static int pf_open(struct block_device *bdev, fmode_t mode);
205static void do_pf_request(struct request_queue * q); 205static void do_pf_request(struct request_queue * q);
206static int pf_ioctl(struct inode *inode, struct file *file, 206static int pf_ioctl(struct block_device *bdev, fmode_t mode,
207 unsigned int cmd, unsigned long arg); 207 unsigned int cmd, unsigned long arg);
208static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo); 208static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo);
209 209
210static int pf_release(struct inode *inode, struct file *file); 210static int pf_release(struct gendisk *disk, fmode_t mode);
211 211
212static int pf_detect(void); 212static int pf_detect(void);
213static void do_pf_read(void); 213static void do_pf_read(void);
@@ -264,9 +264,9 @@ static char *pf_buf; /* buffer for request in progress */
264 264
265static struct block_device_operations pf_fops = { 265static struct block_device_operations pf_fops = {
266 .owner = THIS_MODULE, 266 .owner = THIS_MODULE,
267 .__open = pf_open, 267 .open = pf_open,
268 .__release = pf_release, 268 .release = pf_release,
269 .__ioctl = pf_ioctl, 269 .locked_ioctl = pf_ioctl,
270 .getgeo = pf_getgeo, 270 .getgeo = pf_getgeo,
271 .media_changed = pf_check_media, 271 .media_changed = pf_check_media,
272}; 272};
@@ -296,16 +296,16 @@ static void __init pf_init_units(void)
296 } 296 }
297} 297}
298 298
299static int pf_open(struct inode *inode, struct file *file) 299static int pf_open(struct block_device *bdev, fmode_t mode)
300{ 300{
301 struct pf_unit *pf = inode->i_bdev->bd_disk->private_data; 301 struct pf_unit *pf = bdev->bd_disk->private_data;
302 302
303 pf_identify(pf); 303 pf_identify(pf);
304 304
305 if (pf->media_status == PF_NM) 305 if (pf->media_status == PF_NM)
306 return -ENODEV; 306 return -ENODEV;
307 307
308 if ((pf->media_status == PF_RO) && (file->f_mode & FMODE_WRITE)) 308 if ((pf->media_status == PF_RO) && (mode & FMODE_WRITE))
309 return -EROFS; 309 return -EROFS;
310 310
311 pf->access++; 311 pf->access++;
@@ -333,9 +333,9 @@ static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo)
333 return 0; 333 return 0;
334} 334}
335 335
336static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 336static int pf_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg)
337{ 337{
338 struct pf_unit *pf = inode->i_bdev->bd_disk->private_data; 338 struct pf_unit *pf = bdev->bd_disk->private_data;
339 339
340 if (cmd != CDROMEJECT) 340 if (cmd != CDROMEJECT)
341 return -EINVAL; 341 return -EINVAL;
@@ -346,9 +346,9 @@ static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
346 return 0; 346 return 0;
347} 347}
348 348
349static int pf_release(struct inode *inode, struct file *file) 349static int pf_release(struct gendisk *disk, fmode_t mode)
350{ 350{
351 struct pf_unit *pf = inode->i_bdev->bd_disk->private_data; 351 struct pf_unit *pf = disk->private_data;
352 352
353 if (pf->access <= 0) 353 if (pf->access <= 0)
354 return -EINVAL; 354 return -EINVAL;
set NULL here. Parameter: u_char* pointer to data. int length of data. int flag: 0 = call from within kernel-space. (HL-driver must use memcpy, may NOT use schedule()) 1 = call from user-space. (HL-driver must use memcpy_fromfs, use of schedule() allowed) int driver-Id. int channel-number locally to the HL-driver. (starts with 0) ***CHANGEI1.14: The driver-Id and channel-number are new since this revision. Returnvalue: Length of data on success, else error-code (-EINVAL etc.) char id[20]; ***CHANGE0.7: New since this version. This string has to be preset by the HL-driver. Its purpose is for identification of the driver by the user. Eg.: it is shown in the status-info of /dev/isdninfo. Furthermore it is used as Id for binding net-interfaces to a specific channel. If a string of length zero is given, upon return, isdn4linux will replace it by a generic name. (line0, line1 etc.) It is recommended to make this string configurable during module-load-time. (copy a global variable to this string.) For doing that, modules 1.2.8 or newer are necessary. 2. Description of the commands, a HL-driver has to support: All commands will be performed by calling the function command() described above from within the LL. The field command of the struct-parameter will contain the desired command, the field driver is always set to the appropriate driver-Id. Until now, the following commands are defined: ***CHANGEI1.34: The parameter "num" has been replaced by a union "parm" containing the old "num" and a new setup_type struct used for ISDN_CMD_DIAL and ISDN_STAT_ICALL callback. ISDN_CMD_IOCTL: This command is intended for performing ioctl-calls for configuring hardware or similar purposes (setting port-addresses, loading firmware etc.) For this purpose, in the LL all ioctl-calls with an argument >= IIOCDRVCTL (0x100) will be handed transparently to this function after subtracting 0x100 and placing the result in arg. Example: If a userlevel-program calls ioctl(0x101,...) the function gets called with the field command set to 1. Parameter: driver = driver-Id. command = ISDN_CMD_IOCTL arg = Original ioctl-cmd - IIOCDRVCTL parm.num = first bytes filled with (unsigned long)arg Returnvalue: Depending on driver. ISDN_CMD_DIAL: This command is used to tell the HL-driver it should dial a given number. Parameter: driver = driver-Id. command = ISDN_CMD_DIAL arg = channel-number locally to the driver. (starting with 0) parm.setup.phone = An ASCII-String containing the number to dial. parm.setup.eazmsn = An ASCII-Sting containing the own EAZ or MSN. parm.setup.si1 = The Service-Indicator. parm.setup.si2 = Additional Service-Indicator. If the Line has been designed as SPV (a special german feature, meaning semi-leased-line) the phone has to start with an "S". ***CHANGE0.6: In previous versions the EAZ has been given in the highbyte of arg. ***CHANGE0.7.1: New since this version: ServiceIndicator and AddInfo. ISDN_CMD_ACCEPTD: With this command, the HL-driver is told to accept a D-Channel-setup. (Response to an incoming call) Parameter: driver = driver-Id. command = ISDN_CMD_ACCEPTD arg = channel-number locally to the driver. (starting with 0) parm = unused. ISDN_CMD_ACCEPTB: With this command, the HL-driver is told to perform a B-Channel-setup. (after establishing D-Channel-Connection) Parameter: driver = driver-Id. command = ISDN_CMD_ACCEPTB arg = channel-number locally to the driver. (starting with 0) parm = unused. ISDN_CMD_HANGUP: With this command, the HL-driver is told to hangup (B-Channel if established first, then D-Channel). This command is also used for actively rejecting an incoming call. Parameter: driver = driver-Id. command = ISDN_CMD_HANGUP arg = channel-number locally to the driver. (starting with 0) parm = unused. ISDN_CMD_CLREAZ: With this command, the HL-driver is told not to signal incoming calls to the LL. Parameter: driver = driver-Id. command = ISDN_CMD_CLREAZ arg = channel-number locally to the driver. (starting with 0) parm = unused. ISDN_CMD_SETEAZ: With this command, the HL-driver is told to signal incoming calls for the given EAZs/MSNs to the LL. Parameter: driver = driver-Id. command = ISDN_CMD_SETEAZ arg = channel-number locally to the driver. (starting with 0) parm.num = ASCII-String, containing the desired EAZ's/MSN's (comma-separated). If an empty String is given, the HL-driver should respond to ALL incoming calls, regardless of the destination-address. ***CHANGE0.6: New since this version the "empty-string"-feature. ISDN_CMD_GETEAZ: (currently unused) With this command, the HL-driver is told to report the current setting given with ISDN_CMD_SETEAZ. Parameter: driver = driver-Id. command = ISDN_CMD_GETEAZ arg = channel-number locally to the driver. (starting with 0) parm.num = ASCII-String, containing the current EAZ's/MSN's ISDN_CMD_SETSIL: (currently unused) With this command, the HL-driver is told to signal only incoming calls with the given Service-Indicators. Parameter: driver = driver-Id. command = ISDN_CMD_SETSIL arg = channel-number locally to the driver. (starting with 0) parm.num = ASCII-String, containing the desired Service-Indicators. ISDN_CMD_GETSIL: (currently unused) With this command, the HL-driver is told to return the current Service-Indicators it will respond to. Parameter: driver = driver-Id. command = ISDN_CMD_SETSIL arg = channel-number locally to the driver. (starting with 0) parm.num = ASCII-String, containing the current Service-Indicators. ISDN_CMD_SETL2: With this command, the HL-driver is told to select the given Layer-2- protocol. This command is issued by the LL prior to ISDN_CMD_DIAL or ISDN_CMD_ACCEPTD. Parameter: driver = driver-Id. command = ISDN_CMD_SETL2 arg = channel-number locally to the driver. (starting with 0) logical or'ed with (protocol-Id << 8) protocol-Id is one of the constants ISDN_PROTO_L2... parm = unused. ISDN_CMD_GETL2: (currently unused) With this command, the HL-driver is told to return the current setting of the Layer-2-protocol. Parameter: driver = driver-Id. command = ISDN_CMD_GETL2 arg = channel-number locally to the driver. (starting with 0) parm = unused. Returnvalue: current protocol-Id (one of the constants ISDN_L2_PROTO) ISDN_CMD_SETL3: With this command, the HL-driver is told to select the given Layer-3- protocol. This command is issued by the LL prior to ISDN_CMD_DIAL or ISDN_CMD_ACCEPTD. Parameter: driver = driver-Id. command = ISDN_CMD_SETL3 arg = channel-number locally to the driver. (starting with 0) logical or'ed with (protocol-Id << 8) protocol-Id is one of the constants ISDN_PROTO_L3... parm.fax = Pointer to T30_s fax struct. (fax usage only) ISDN_CMD_GETL2: (currently unused) With this command, the HL-driver is told to return the current setting of the Layer-3-protocol. Parameter: driver = driver-Id. command = ISDN_CMD_GETL3 arg = channel-number locally to the driver. (starting with 0) parm = unused. Returnvalue: current protocol-Id (one of the constants ISDN_L3_PROTO) ISDN_CMD_PROCEED: With this command, the HL-driver is told to proceed with a incoming call. Parameter: driver = driver-Id. command = ISDN_CMD_PROCEED arg = channel-number locally to the driver. (starting with 0) setup.eazmsn= empty string or string send as uus1 in DSS1 with PROCEED message ISDN_CMD_ALERT: With this command, the HL-driver is told to alert a proceeding call. Parameter: driver = driver-Id. command = ISDN_CMD_ALERT arg = channel-number locally to the driver. (starting with 0) setup.eazmsn= empty string or string send as uus1 in DSS1 with ALERT message ISDN_CMD_REDIR: With this command, the HL-driver is told to redirect a call in proceeding or alerting state. Parameter: driver = driver-Id. command = ISDN_CMD_REDIR arg = channel-number locally to the driver. (starting with 0) setup.eazmsn= empty string or string send as uus1 in DSS1 protocol setup.screen= screening indicator setup.phone = redirected to party number ISDN_CMD_PROT_IO: With this call, the LL-driver invokes protocol specific features through the LL. The call is not implicitely bound to a connection. Parameter: driver = driver-Id command = ISDN_CMD_PROT_IO arg = The lower 8 Bits define the addressed protocol as defined in ISDN_PTYPE..., the upper bits are used to differentiate the protocol specific CMD. para = protocol and function specific. See isdnif.h for detail. ISDN_CMD_FAXCMD: With this command the HL-driver receives a fax sub-command. For details refer to INTERFACE.fax Parameter: driver = driver-Id. command = ISDN_CMD_FAXCMD arg = channel-number locally to the driver. (starting with 0) parm = unused. 3. Description of the events to be signaled by the HL-driver to the LL. All status-changes are signaled via calling the previously described function statcallb(). The field command of the struct isdn_cmd has to be set by the HL-driver with the appropriate Status-Id (event-number). The field arg has to be set to the channel-number (locally to the driver, starting with 0) to which this event applies. (Exception: STAVAIL-event) Until now, the following Status-Ids are defined: ISDN_STAT_AVAIL: With this call, the HL-driver signals the availability of new data for readstat(). Used only for debugging-purposes, see description of readstat(). Parameter: driver = driver-Id command = ISDN_STAT_STAVAIL arg = length of available data. parm = unused. ISDN_STAT_ICALL: ISDN_STAT_ICALLW: With this call, the HL-driver signals an incoming call to the LL. If ICALLW is signalled the incoming call is a waiting call without a available B-chan. Parameter: driver = driver-Id command = ISDN_STAT_ICALL arg = channel-number, locally to the driver. (starting with 0) para.setup.phone = Callernumber. para.setup.eazmsn = CalledNumber. para.setup.si1 = Service Indicator. para.setup.si2 = Additional Service Indicator. para.setup.plan = octet 3 from Calling party number Information Element. para.setup.screen = octet 3a from Calling party number Information Element. Return: 0 = No device matching this call. 1 = At least one device matching this call (RING on ttyI). HL-driver may send ALERTING on the D-channel in this case. 2 = Call will be rejected. 3 = Incoming called party number is currently incomplete. Additional digits are required. Used for signalling with PtP connections. 4 = Call will be held in a proceeding state (HL driver sends PROCEEDING) Used when a user space prog needs time to interpret a call para.setup.eazmsn may be filled with an uus1 message of 30 octets maximum. Empty string if no uus. 5 = Call will be actively deflected to another party Only available in DSS1/EURO protocol para.setup.phone must be set to destination party number para.setup.eazmsn may be filled with an uus1 message of 30 octets maximum. Empty string if no uus. -1 = An error happened. (Invalid parameters for example.) The keypad support now is included in the dial command. ISDN_STAT_RUN: With this call, the HL-driver signals availability of the ISDN-card. (after initializing, loading firmware) Parameter: driver = driver-Id command = ISDN_STAT_RUN arg = unused. parm = unused. ISDN_STAT_STOP: With this call, the HL-driver signals unavailability of the ISDN-card. (before unloading, while resetting/reconfiguring the card) Parameter: driver = driver-Id command = ISDN_STAT_STOP arg = unused. parm = unused. ISDN_STAT_DCONN: With this call, the HL-driver signals the successful establishment of a D-Channel-connection. (Response to ISDN_CMD_ACCEPTD or ISDN_CMD_DIAL) Parameter: driver = driver-Id command = ISDN_STAT_DCONN arg = channel-number, locally to the driver. (starting with 0) parm = unused. ISDN_STAT_BCONN: With this call, the HL-driver signals the successful establishment of a B-Channel-connection. (Response to ISDN_CMD_ACCEPTB or because the remote-station has initiated establishment) The HL driver should call this when the logical l2/l3 protocol connection on top of the physical B-channel is established. Parameter: driver = driver-Id command = ISDN_STAT_BCONN arg = channel-number, locally to the driver. (starting with 0) parm.num = ASCII-String, containing type of connection (for analog modem only). This will be appended to the CONNECT message e.g. 14400/V.32bis ISDN_STAT_DHUP: With this call, the HL-driver signals the shutdown of a D-Channel-connection. This could be a response to a prior ISDN_CMD_HANGUP, or caused by a remote-hangup or if the remote-station has actively rejected a call. Parameter: driver = driver-Id command = ISDN_STAT_DHUP arg = channel-number, locally to the driver. (starting with 0) parm = unused. ISDN_STAT_BHUP: With this call, the HL-driver signals the shutdown of a B-Channel-connection. This could be a response to a prior ISDN_CMD_HANGUP, or caused by a remote-hangup. The HL driver should call this as soon as the logical l2/l3 protocol connection on top of the physical B-channel is released. Parameter: driver = driver-Id command = ISDN_STAT_BHUP arg = channel-number, locally to the driver. (starting with 0) parm = unused. ISDN_STAT_CINF: With this call, the HL-driver delivers charge-unit information to the LL. Parameter: driver = driver-Id command = ISDN_STAT_CINF arg = channel-number, locally to the driver. (starting with 0) parm.num = ASCII string containing charge-units (digits only). ISDN_STAT_LOAD: (currently unused) ISDN_STAT_UNLOAD: With this call, the HL-driver signals that it will be unloaded now. This tells the LL to release all corresponding data-structures. Parameter: driver = driver-Id command = ISDN_STAT_UNLOAD arg = unused. parm = unused. ISDN_STAT_BSENT: With this call the HL-driver signals the delivery of a data-packet. This callback is used by the network-interfaces only, tty-Emulation does not need this call. Parameter: driver = driver-Id command = ISDN_STAT_BSENT arg = channel-number, locally to the driver. (starting with 0) parm.length = ***CHANGEI.1.21: New field. the driver has to set this to the original length of the skb at the time of receiving it from the linklevel. ISDN_STAT_NODCH: With this call, the driver has to respond to a prior ISDN_CMD_DIAL, if no D-Channel is available. Parameter: driver = driver-Id command = ISDN_STAT_NODCH arg = channel-number, locally to the driver. (starting with 0) parm = unused. ISDN_STAT_ADDCH: This call is for HL-drivers, which are unable to check card-type or numbers of supported channels before they have loaded any firmware using ioctl. Those HL-driver simply set the channel-parameter to a minimum channel-number when registering, and later if they know the real amount, perform this call, allocating additional channels. Parameter: driver = driver-Id command = ISDN_STAT_ADDCH arg = number of channels to be added. parm = unused. ISDN_STAT_CAUSE: With this call, the HL-driver delivers CAUSE-messages to the LL. Currently the LL does not use this messages. Their contents is simply logged via kernel-messages. Therefore, currently the format of the messages is completely free. However they should be printable. Parameter: driver = driver-Id command = ISDN_STAT_NODCH arg = channel-number, locally to the driver. (starting with 0) parm.num = ASCII string containing CAUSE-message. ISDN_STAT_DISPLAY: With this call, the HL-driver delivers DISPLAY-messages to the LL. Currently the LL does not use this messages. Parameter: driver = driver-Id command = ISDN_STAT_DISPLAY arg = channel-number, locally to the driver. (starting with 0) para.display= string containing DISPLAY-message. ISDN_STAT_PROT: With this call, the HL-driver delivers protocol specific infos to the LL. The call is not implicitely bound to a connection. Parameter: driver = driver-Id command = ISDN_STAT_PROT arg = The lower 8 Bits define the addressed protocol as defined in ISDN_PTYPE..., the upper bits are used to differentiate the protocol specific STAT. para = protocol and function specific. See isdnif.h for detail. ISDN_STAT_DISCH: With this call, the HL-driver signals the LL to disable or enable the use of supplied channel and driver. The call may be used to reduce the available number of B-channels after loading the driver. The LL has to ignore a disabled channel when searching for free channels. The HL driver itself never delivers STAT callbacks for disabled channels. The LL returns a nonzero code if the operation was not successful or the selected channel is actually regarded as busy. Parameter: driver = driver-Id command = ISDN_STAT_DISCH arg = channel-number, locally to the driver. (starting with 0) parm.num[0] = 0 if channel shall be disabled, else enabled. ISDN_STAT_L1ERR: ***CHANGEI1.21 new status message. A signal can be sent to the linklevel if an Layer1-error results in packet-loss on receive or send. The field errcode of the cmd.parm union describes the error more precisely. Parameter: driver = driver-Id command = ISDN_STAT_L1ERR arg = channel-number, locally to the driver. (starting with 0) parm.errcode= ISDN_STAT_L1ERR_SEND: Packet lost while sending. ISDN_STAT_L1ERR_RECV: Packet lost while receiving. ISDN_STAT_FAXIND: With this call the HL-driver signals a fax sub-command to the LL. For details refer to INTERFACE.fax Parameter: driver = driver-Id. command = ISDN_STAT_FAXIND arg = channel-number, locally to the driver. (starting with 0) parm = unused.