|
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) |
|
static int | fcp_prli_tx (struct fc_els *els) |
| Transmit FCP PRLI. More...
|
|
static int | fcp_prli_rx (struct fc_els *els, void *data, size_t len) |
| Receive FCP PRLI. More...
|
|
static int | fcp_prli_detect (struct fc_els *els, const void *data, size_t len) |
| Detect FCP PRLI. More...
|
|
static struct fcp_device * | fcpdev_get (struct fcp_device *fcpdev) |
| Get reference to FCP device. More...
|
|
static void | fcpdev_put (struct fcp_device *fcpdev) |
| Drop reference to FCP device. More...
|
|
static struct fcp_command * | fcpcmd_get (struct fcp_command *fcpcmd) |
| Get reference to FCP command. More...
|
|
static void | fcpcmd_put (struct fcp_command *fcpcmd) |
| Drop reference to FCP command. More...
|
|
static void | fcpcmd_start_send (struct fcp_command *fcpcmd, int(*send)(struct fcp_command *fcpcmd)) |
| Start FCP command sending. More...
|
|
static void | fcpcmd_stop_send (struct fcp_command *fcpcmd) |
| Stop FCP command sending. More...
|
|
static void | fcpcmd_free (struct refcnt *refcnt) |
| Free FCP command. More...
|
|
static void | fcpcmd_close (struct fcp_command *fcpcmd, int rc) |
| Close FCP command. More...
|
|
static void | fcpcmd_close_err (struct fcp_command *fcpcmd, int rc) |
| Close FCP command in error. More...
|
|
static int | fcpcmd_send_cmnd (struct fcp_command *fcpcmd) |
| Send FCP command IU. More...
|
|
static int | fcpcmd_recv_rddata (struct fcp_command *fcpcmd, struct io_buffer *iobuf, struct xfer_metadata *meta) |
| Handle FCP read data IU. More...
|
|
static int | fcpcmd_send_wrdata (struct fcp_command *fcpcmd) |
| Send FCP write data IU. More...
|
|
static int | fcpcmd_recv_xfer_rdy (struct fcp_command *fcpcmd, struct io_buffer *iobuf, struct xfer_metadata *meta __unused) |
| Handle FCP transfer ready IU. More...
|
|
static int | fcpcmd_recv_rsp (struct fcp_command *fcpcmd, struct io_buffer *iobuf, struct xfer_metadata *meta __unused) |
| Handle FCP response IU. More...
|
|
static int | fcpcmd_recv_unknown (struct fcp_command *fcpcmd, struct io_buffer *iobuf, struct xfer_metadata *meta __unused) |
| Handle unknown FCP IU. More...
|
|
static void | fcpcmd_step (struct fcp_command *fcpcmd) |
| Transmit FCP frame. More...
|
|
static int | fcpcmd_deliver (struct fcp_command *fcpcmd, struct io_buffer *iobuf, struct xfer_metadata *meta) |
| Receive FCP frame. More...
|
|
static int | fcpdev_scsi_command (struct fcp_device *fcpdev, struct interface *parent, struct scsi_cmd *command) |
| Issue FCP SCSI command. More...
|
|
static void | fcpdev_close (struct fcp_device *fcpdev, int rc) |
| Close FCP device. More...
|
|
static size_t | fcpdev_window (struct fcp_device *fcpdev) |
| Check FCP device flow-control window. More...
|
|
static int | fcpdev_edd_describe (struct fcp_device *fcpdev, struct edd_interface_type *type, union edd_device_path *path) |
| Describe FCP device using EDD. More...
|
|
static struct device * | fcpdev_identify_device (struct fcp_device *fcpdev) |
| Identify device underlying FCP device. More...
|
|
static EFI_DEVICE_PATH_PROTOCOL * | fcpdev_efi_describe (struct fcp_device *fcpdev) |
| Describe as an EFI device path. More...
|
|
static void | fcpdev_examine (struct fc_ulp_user *user) |
| Examine FCP ULP link state. More...
|
|
static int | fcpdev_open (struct interface *parent, struct fc_name *wwn, struct scsi_lun *lun) |
| Open FCP device. More...
|
|
static int | fcp_parse_uri (struct uri *uri, struct fc_name *wwn, struct scsi_lun *lun) |
| Parse FCP URI. More...
|
|
static int | fcp_open (struct interface *parent, struct uri *uri) |
| Open FCP URI. More...
|
|
Fibre Channel Protocol.
Definition in file fcp.c.
static int fcpcmd_send_cmnd |
( |
struct fcp_command * |
fcpcmd | ) |
|
|
static |
Send FCP command IU.
- Parameters
-
- Return values
-
Definition at line 320 of file fcp.c.
330 DBGC ( fcpdev,
"FCP %p xchg %04x cannot handle bidirectional " 331 "command\n", fcpdev, fcpcmd->
xchg_id );
338 DBGC ( fcpdev,
"FCP %p xchg %04x cannot allocate command IU\n",
344 cmnd =
iob_put ( iobuf,
sizeof ( *cmnd ) );
345 memset ( cmnd, 0,
sizeof ( *cmnd ) );
366 DBGC ( fcpdev,
"FCP %p xchg %04x cannot deliver command IU: " struct arbelprm_rc_send_wqe rc
#define iob_put(iobuf, len)
union scsi_cdb cdb
SCSI CDB.
static void fcpcmd_stop_send(struct fcp_command *fcpcmd)
Stop FCP command sending.
struct io_buffer * xfer_alloc_iob(struct interface *intf, size_t len)
Allocate I/O buffer.
union scsi_cdb cdb
CDB for this command.
#define ENOTSUP
Operation not supported.
#define ENOMEM
Not enough space.
#define iob_disown(iobuf)
Disown an I/O buffer.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define FCP_CMND_RDDATA
Command includes data-in.
struct scsi_lun lun
SCSI LUN.
char * strerror(int errno)
Retrieve string representation of error number.
struct scsi_cmd command
SCSI command.
#define XFER_FL_CMD_STAT
Data content represents a command or status message.
int xfer_deliver(struct interface *intf, struct io_buffer *iobuf, struct xfer_metadata *meta)
Deliver datagram.
#define SCSI_CDB_DATA(cdb)
printf() parameters for dumping a scsi_cdb
struct interface xchg
Fibre Channel exchange interface.
uint16_t xchg_id
Exchange ID.
A SCSI command information unit.
#define SCSI_CDB_FORMAT
printf() format for dumping a scsi_cdb
#define XFER_FL_OVER
Sender is relinquishing use of half-duplex channel.
#define FCP_CMND_WRDATA
Command includes data-out.
struct fcp_device * fcpdev
FCP SCSI device.
void * memset(void *dest, int character, size_t len) __nonnull
References assert(), scsi_cmd::cdb, fcp_cmnd::cdb, fcp_command::command, DBGC, DBGC2, fcp_cmnd::dirn, ENOMEM, ENOTSUP, FCP_CMND_RDDATA, FCP_CMND_WRDATA, fcpcmd_stop_send(), fcp_command::fcpdev, htonl, iob_disown, iob_put, fcp_cmnd::len, fcp_cmnd::lun, memcpy(), memset(), meta(), ntohl, rc, SCSI_CDB_DATA, SCSI_CDB_FORMAT, strerror(), fcp_command::xchg, fcp_command::xchg_id, xfer_alloc_iob(), xfer_deliver(), XFER_FL_CMD_STAT, and XFER_FL_OVER.
Referenced by fcpdev_scsi_command().
Handle FCP read data IU.
- Parameters
-
fcpcmd | FCP command |
iobuf | I/O buffer |
meta | Data transfer metadata |
- Return values
-
Definition at line 382 of file fcp.c.
393 DBGC ( fcpdev,
"FCP %p xchg %04x read data missing offset\n",
399 DBGC ( fcpdev,
"FCP %p xchg %04x read data out of order " 400 "(expected %zd, received %zd)\n",
406 DBGC ( fcpdev,
"FCP %p xchg %04x read data overrun (max %zd, " 407 "received %zd)\n", fcpdev, fcpcmd->
xchg_id,
412 DBGC2 ( fcpdev,
"FCP %p xchg %04x RDDATA [%08zx,%08zx)\n",
struct arbelprm_rc_send_wqe rc
#define XFER_FL_ABS_OFFSET
Offset is absolute.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static userptr_t size_t offset
Offset of the first segment within the content.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
static __always_inline void copy_to_user(userptr_t dest, off_t dest_off, const void *src, size_t len)
Copy data to user buffer.
struct scsi_cmd command
SCSI command.
uint16_t xchg_id
Exchange ID.
#define ERANGE_READ_DATA_OVERRUN
size_t offset
Data offset within command.
A SCSI command information unit.
void * data
Start of data.
struct bofm_section_header done
struct fcp_device * fcpdev
FCP SCSI device.
#define ERANGE_READ_DATA_ORDERING
References assert(), fcp_command::command, copy_to_user(), io_buffer::data, DBGC, DBGC2, done, ERANGE_READ_DATA_ORDERING, ERANGE_READ_DATA_OVERRUN, fcp_command::fcpdev, free_iob(), iob_len(), len, meta(), fcp_command::offset, offset, rc, fcp_command::xchg_id, and XFER_FL_ABS_OFFSET.
Referenced by fcpcmd_deliver().
static int fcpcmd_send_wrdata |
( |
struct fcp_command * |
fcpcmd | ) |
|
|
static |
Send FCP write data IU.
- Parameters
-
- Return values
-
Definition at line 432 of file fcp.c.
447 DBGC ( fcpdev,
"FCP %p xchg %04x write data stuck\n",
452 DBGC ( fcpdev,
"FCP %p xchg %04x write data overrun (max %zd, " 453 "requested %zd)\n", fcpdev, fcpcmd->
xchg_id,
461 DBGC ( fcpdev,
"FCP %p xchg %04x cannot allocate write data " 462 "IU for %zd bytes\n", fcpdev, fcpcmd->
xchg_id,
len );
472 DBGC2 ( fcpdev,
"FCP %p xchg %04x WRDATA [%08zx,%04zx)\n",
477 assert ( len <= fcpcmd->remaining );
489 DBGC ( fcpdev,
"FCP %p xchg %04x cannot deliver write data " struct arbelprm_rc_send_wqe rc
#define iob_put(iobuf, len)
#define ERANGE_WRITE_DATA_OVERRUN
#define ERANGE_WRITE_DATA_STUCK
#define XFER_FL_ABS_OFFSET
Offset is absolute.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
static void fcpcmd_stop_send(struct fcp_command *fcpcmd)
Stop FCP command sending.
struct io_buffer * xfer_alloc_iob(struct interface *intf, size_t len)
Allocate I/O buffer.
size_t xfer_window(struct interface *intf)
Check flow control window.
#define XFER_FL_RESPONSE
Data content is a response.
#define ENOMEM
Not enough space.
#define iob_disown(iobuf)
Disown an I/O buffer.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
char * strerror(int errno)
Retrieve string representation of error number.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
struct scsi_cmd command
SCSI command.
int xfer_deliver(struct interface *intf, struct io_buffer *iobuf, struct xfer_metadata *meta)
Deliver datagram.
struct interface xchg
Fibre Channel exchange interface.
uint16_t xchg_id
Exchange ID.
size_t offset
Data offset within command.
A SCSI command information unit.
size_t remaining
Length of data remaining to be sent within this IU.
#define XFER_FL_OVER
Sender is relinquishing use of half-duplex channel.
struct fcp_device * fcpdev
FCP SCSI device.
void * memset(void *dest, int character, size_t len) __nonnull
References assert(), fcp_command::command, copy_from_user(), DBGC, DBGC2, ENOMEM, ERANGE_WRITE_DATA_OVERRUN, ERANGE_WRITE_DATA_STUCK, fcpcmd_stop_send(), fcp_command::fcpdev, iob_disown, iob_len(), iob_put, len, memset(), meta(), fcp_command::offset, rc, fcp_command::remaining, strerror(), fcp_command::xchg, fcp_command::xchg_id, xfer_alloc_iob(), xfer_deliver(), XFER_FL_ABS_OFFSET, XFER_FL_OVER, XFER_FL_RESPONSE, and xfer_window().
Referenced by fcpcmd_recv_xfer_rdy().
Handle FCP transfer ready IU.
- Parameters
-
fcpcmd | FCP command |
iobuf | I/O buffer |
meta | Data transfer metadata |
- Return values
-
Definition at line 505 of file fcp.c.
513 if (
iob_len ( iobuf ) !=
sizeof ( *xfer_rdy ) ) {
514 DBGC ( fcpdev,
"FCP %p xchg %04x received invalid transfer " 515 "ready IU:\n", fcpdev, fcpcmd->
xchg_id );
522 DBGC ( fcpdev,
"FCP %p xchg %04x cannot support out-of-order " 523 "delivery (expected %zd, requested %d)\n",
529 DBGC2 ( fcpdev,
"FCP %p xchg %04x XFER_RDY [%08x,%08x)\n",
struct arbelprm_rc_send_wqe rc
An FCP transfer ready IU.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
uint32_t offset
Relative offset of data.
static int fcpcmd_send_wrdata(struct fcp_command *fcpcmd)
Send FCP write data IU.
static void fcpcmd_start_send(struct fcp_command *fcpcmd, int(*send)(struct fcp_command *fcpcmd))
Start FCP command sending.
#define EPROTO
Protocol error.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
uint16_t xchg_id
Exchange ID.
size_t offset
Data offset within command.
size_t remaining
Length of data remaining to be sent within this IU.
void * data
Start of data.
uint32_t len
Burst length.
struct bofm_section_header done
struct fcp_device * fcpdev
FCP SCSI device.
References io_buffer::data, DBGC, DBGC2, DBGC_HDA, done, EPROTO, fcpcmd_send_wrdata(), fcpcmd_start_send(), fcp_command::fcpdev, free_iob(), iob_len(), fcp_xfer_rdy::len, ntohl, fcp_xfer_rdy::offset, fcp_command::offset, rc, fcp_command::remaining, and fcp_command::xchg_id.
Referenced by fcpcmd_deliver().
Handle FCP response IU.
- Parameters
-
fcpcmd | FCP command |
iobuf | I/O buffer |
meta | Data transfer metadata |
- Return values
-
Definition at line 551 of file fcp.c.
561 if ( (
iob_len ( iobuf ) <
sizeof ( *
rsp ) ) ||
565 DBGC ( fcpdev,
"FCP %p xchg %04x received invalid response " 566 "IU:\n", fcpdev, fcpcmd->
xchg_id );
571 DBGC2 ( fcpdev,
"FCP %p xchg %04x RSP stat %02x resid %08x flags %02x" 572 "%s%s%s%s\n", fcpdev, fcpcmd->
xchg_id,
rsp->status,
579 DBGC2 ( fcpdev,
"FCP %p xchg %04x response data:\n",
585 DBGC2 ( fcpdev,
"FCP %p xchg %04x sense data:\n",
592 if ( (
rsp->status == 0 ) &&
595 DBGC ( fcpdev,
"FCP %p xchg %04x data underrun (expected %zd, " 596 "got %zd)\n", fcpdev, fcpcmd->
xchg_id,
604 memset ( &response, 0,
sizeof ( response ) );
605 response.status =
rsp->status;
608 response.overrun =
ntohl (
rsp->residual );
610 response.overrun = -response.overrun;
void scsi_parse_sense(const void *data, size_t len, struct scsi_sns_descriptor *sense)
Parse SCSI sense data.
#define FCP_RSP_RESIDUAL_OVERRUN
Residual represents overrun.
struct arbelprm_rc_send_wqe rc
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
static void fcpcmd_close(struct fcp_command *fcpcmd, int rc)
Close FCP command.
#define FCP_RSP_RESIDUAL_UNDERRUN
Residual represents underrun.
#define iob_disown(iobuf)
Disown an I/O buffer.
static void * fcp_rsp_sense_data(struct fcp_rsp *rsp)
Get sense data portion of FCP response.
A SCSI response information unit.
static void * fcp_rsp_response_data(struct fcp_rsp *rsp)
Get response data portion of FCP response.
struct interface scsi
SCSI command interface.
#define EPROTO
Protocol error.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
static size_t fcp_rsp_response_data_len(struct fcp_rsp *rsp)
Get length of response data portion of FCP response.
struct scsi_cmd command
SCSI command.
uint16_t xchg_id
Exchange ID.
#define FCP_RSP_RESPONSE_LEN_VALID
Response length field is valid.
size_t offset
Data offset within command.
void scsi_response(struct interface *intf, struct scsi_rsp *response)
Report SCSI response.
A SCSI command information unit.
void * data
Start of data.
#define ERANGE_DATA_UNDERRUN
#define FCP_RSP_SENSE_LEN_VALID
Sense length field is valid.
struct bofm_section_header done
struct fcp_device * fcpdev
FCP SCSI device.
static size_t fcp_rsp_sense_data_len(struct fcp_rsp *rsp)
Get length of sense data portion of FCP response.
void * memset(void *dest, int character, size_t len) __nonnull
References fcp_command::command, io_buffer::data, DBGC, DBGC2, DBGC2_HDA, DBGC_HDA, done, EPROTO, ERANGE_DATA_UNDERRUN, FCP_RSP_RESIDUAL_OVERRUN, FCP_RSP_RESIDUAL_UNDERRUN, fcp_rsp_response_data(), fcp_rsp_response_data_len(), FCP_RSP_RESPONSE_LEN_VALID, fcp_rsp_sense_data(), fcp_rsp_sense_data_len(), FCP_RSP_SENSE_LEN_VALID, fcpcmd_close(), fcp_command::fcpdev, free_iob(), iob_disown, iob_len(), memset(), ntohl, fcp_command::offset, scsi_rsp::overrun, rc, rsp, fcp_command::scsi, scsi_parse_sense(), scsi_response(), scsi_rsp::sense, scsi_rsp::status, and fcp_command::xchg_id.
Referenced by fcpcmd_deliver().
Issue FCP SCSI command.
- Parameters
-
fcpdev | FCP device |
parent | Parent interface |
command | SCSI command |
- Return values
-
tag | Command tag, or negative error |
Definition at line 739 of file fcp.c.
749 DBGC (
fcpdev,
"FCP %p could not issue command while link is " 758 DBGC (
fcpdev,
"FCP %p could not issue command: not a target\n",
765 fcpcmd =
zalloc (
sizeof ( *fcpcmd ) );
785 DBGC (
fcpdev,
"FCP %p could not create exchange: %s\n",
787 goto err_xchg_originate;
struct arbelprm_rc_send_wqe rc
struct fc_ulp * ulp
Fibre Channel upper layer protocol.
int fc_xchg_originate(struct interface *parent, struct fc_port *port, struct fc_port_id *peer_port_id, unsigned int type)
Originate a new Fibre Channel exchange.
struct process process
Send process.
#define list_add(new, head)
Add a new entry to the head of a list.
#define ref_init(refcnt, free)
Initialise a reference counter.
static int fcpcmd_send_cmnd(struct fcp_command *fcpcmd)
Send FCP command IU.
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
static void fcpcmd_close(struct fcp_command *fcpcmd, int rc)
Close FCP command.
static struct process_descriptor fcpcmd_process_desc
FCP command process descriptor.
struct fc_peer * peer
Fibre Channel peer.
static void fcpcmd_free(struct refcnt *refcnt)
Free FCP command.
struct fc_port * port
Fibre Channel port, if known.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static struct interface_descriptor fcpcmd_xchg_desc
FCP command Fibre Channel exchange interface descriptor.
size_t param_len
Service parameter length.
static void fcpcmd_start_send(struct fcp_command *fcpcmd, int(*send)(struct fcp_command *fcpcmd))
Start FCP command sending.
struct interface scsi
SCSI command interface.
static struct fcp_device * fcpdev_get(struct fcp_device *fcpdev)
Get reference to FCP device.
#define FCP_TAG_MAGIC
FCP tag magic marker.
struct fc_port_id port_id
Peer port ID, if known.
char * strerror(int errno)
Retrieve string representation of error number.
void * zalloc(size_t size)
Allocate cleared memory.
void * param
Service parameters, if any.
struct hv_monitor_parameter param[4][32]
Parameters.
struct fc_link_state link
Link state monitor.
struct scsi_cmd command
SCSI command.
struct interface xchg
Fibre Channel exchange interface.
uint16_t xchg_id
Exchange ID.
#define FCP_PRLI_TARGET
Has target functionality.
static void process_init_stopped(struct process *process, struct process_descriptor *desc, struct refcnt *refcnt)
Initialise process without adding to process list.
struct list_head list
List of active commands.
static struct interface_descriptor fcpcmd_scsi_desc
FCP command SCSI interface descriptor.
An FCP PRLI service parameter page.
#define ENOTTY
Inappropriate I/O control operation.
struct refcnt refcnt
Reference count.
struct list_head fcpcmds
List of active commands.
struct fc_ulp_user user
Fibre Channel upper-layer protocol user.
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
#define NULL
NULL pointer (VOID *)
struct fcp_device * fcpdev
FCP SCSI device.
#define ref_put(refcnt)
Drop reference to object.
References assert(), fcp_command::command, DBGC, ENOMEM, ENOTTY, FC_TYPE_FCP, fc_xchg_originate(), FCP_PRLI_TARGET, FCP_TAG_MAGIC, fcpcmd_close(), fcpcmd_free(), fcpcmd_process_desc, fcpcmd_scsi_desc, fcpcmd_send_cmnd(), fcpcmd_start_send(), fcpcmd_xchg_desc, fcp_device::fcpcmds, fcp_command::fcpdev, fcpdev_get(), htonl, intf_init(), intf_plug_plug(), fc_ulp::link, fcp_command::list, list_add, memcpy(), NULL, param, fc_ulp::param, fc_ulp::param_len, fc_ulp::peer, fc_peer::port, fc_peer::port_id, fcp_command::process, process_init_stopped(), fc_link_state::rc, rc, ref_init, ref_put, fcp_command::refcnt, fcp_command::scsi, strerror(), fc_ulp_user::ulp, fcp_device::user, fcp_command::xchg, fcp_command::xchg_id, and zalloc().
static void fcpdev_close |
( |
struct fcp_device * |
fcpdev, |
|
|
int |
rc |
|
) |
| |
|
static |
Close FCP device.
- Parameters
-
fcpdev | FCP device |
rc | Reason for close |
Definition at line 814 of file fcp.c.
void fc_ulp_detach(struct fc_ulp_user *user)
Detach Fibre Channel upper-layer protocol user.
static struct fcp_command * fcpcmd_get(struct fcp_command *fcpcmd)
Get reference to FCP command.
struct arbelprm_rc_send_wqe rc
void intf_shutdown(struct interface *intf, int rc)
Shut down an object interface.
static void fcpcmd_close(struct fcp_command *fcpcmd, int rc)
Close FCP command.
struct interface scsi
SCSI command issuing interface.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
char * strerror(int errno)
Retrieve string representation of error number.
struct list_head list
List of active commands.
static void fcpcmd_put(struct fcp_command *fcpcmd)
Drop reference to FCP command.
struct list_head fcpcmds
List of active commands.
struct fc_ulp_user user
Fibre Channel upper-layer protocol user.
struct fcp_device * fcpdev
FCP SCSI device.
References DBGC, fc_ulp_detach(), fcpcmd_close(), fcpcmd_get(), fcpcmd_put(), fcp_device::fcpcmds, fcp_command::fcpdev, intf_shutdown(), fcp_command::list, list_for_each_entry_safe, rc, fcp_device::scsi, strerror(), tmp, and fcp_device::user.
Referenced by fcpdev_open().
static void fcpdev_examine |
( |
struct fc_ulp_user * |
user | ) |
|
|
static |
Examine FCP ULP link state.
- Parameters
-
user | Fibre Channel upper-layer protocol user |
Definition at line 927 of file fcp.c.
932 DBGC ( fcpdev,
"FCP %p link is up\n", fcpdev );
934 DBGC ( fcpdev,
"FCP %p link is down: %s\n",
void xfer_window_changed(struct interface *intf)
Report change of flow control window.
struct fc_ulp * ulp
Fibre Channel upper layer protocol.
#define container_of(ptr, type, field)
Get containing structure.
struct ntlm_data user
User name.
static int fc_link_ok(struct fc_link_state *link)
Check Fibre Channel link state.
struct interface scsi
SCSI command issuing interface.
char * strerror(int errno)
Retrieve string representation of error number.
struct fc_link_state link
Link state monitor.
struct fc_ulp_user user
Fibre Channel upper-layer protocol user.
References container_of, DBGC, fc_link_ok(), fc_ulp::link, fc_link_state::rc, fcp_device::scsi, strerror(), fc_ulp_user::ulp, user, fcp_device::user, and xfer_window_changed().
Referenced by fcpdev_open().
Open FCP device.
- Parameters
-
parent | Parent interface |
wwn | Fibre Channel WWN |
lun | SCSI LUN |
- Return values
-
Definition at line 950 of file fcp.c.
964 fcpdev =
zalloc (
sizeof ( *fcpdev ) );
974 DBGC ( fcpdev,
"FCP %p opened for %s\n", fcpdev,
fc_ntoa (
wwn ) );
985 DBGC ( fcpdev,
"FCP %p could not create SCSI device: %s\n",
struct arbelprm_rc_send_wqe rc
static struct interface_descriptor fcpdev_scsi_desc
FCP device SCSI interface descriptor.
#define ref_init(refcnt, free)
Initialise a reference counter.
const char * fc_ntoa(const struct fc_name *wwn)
Format Fibre Channel WWN.
int scsi_open(struct interface *block, struct interface *scsi, struct scsi_lun *lun)
Open SCSI device.
struct refcnt refcnt
Reference count.
struct fc_name wwn
Fibre Channel WWN.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void fc_ulp_attach(struct fc_ulp *ulp, struct fc_ulp_user *user)
Attach Fibre Channel upper-layer protocol user.
struct interface scsi
SCSI command issuing interface.
struct fcp_description desc
Device description (for boot firmware table)
uint8_t lun
Logical Unit Number.
char * strerror(int errno)
Retrieve string representation of error number.
void * zalloc(size_t size)
Allocate cleared memory.
#define INIT_LIST_HEAD(list)
Initialise a list head.
struct scsi_lun lun
SCSI LUN.
static void fc_ulp_put(struct fc_ulp *ulp)
Drop reference to Fibre Channel upper-layer protocol.
static void fcpdev_examine(struct fc_ulp_user *user)
Examine FCP ULP link state.
struct list_head fcpcmds
List of active commands.
struct fc_ulp_user user
Fibre Channel upper-layer protocol user.
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
struct fc_ulp * fc_ulp_get_wwn_type(const struct fc_name *port_wwn, unsigned int type)
Get Fibre Channel upper-layer protocol by port name and type.
#define NULL
NULL pointer (VOID *)
static void fc_ulp_user_init(struct fc_ulp_user *user, void(*examine)(struct fc_ulp_user *user), struct refcnt *refcnt)
Initialise Fibre Channel upper-layer protocol user.
#define ref_put(refcnt)
Drop reference to object.
A Fibre Channel upper-layer protocol.
static void fcpdev_close(struct fcp_device *fcpdev, int rc)
Close FCP device.
References DBGC, fcp_device::desc, ENOMEM, fc_ntoa(), FC_TYPE_FCP, fc_ulp_attach(), fc_ulp_get_wwn_type(), fc_ulp_put(), fc_ulp_user_init(), fcp_device::fcpcmds, fcpdev_close(), fcpdev_examine(), fcpdev_scsi_desc, INIT_LIST_HEAD, intf_init(), lun, fcp_description::lun, memcpy(), NULL, rc, ref_init, ref_put, fcp_device::refcnt, fcp_device::scsi, scsi_open(), strerror(), fcp_device::user, wwn, fcp_description::wwn, and zalloc().
Referenced by fcp_open().
static int fcp_parse_uri |
( |
struct uri * |
uri, |
|
|
struct fc_name * |
wwn, |
|
|
struct scsi_lun * |
lun |
|
) |
| |
|
static |
Parse FCP URI.
- Parameters
-
- Return values
-
wwn | Fibre Channel WWN |
lun | SCSI LUN |
rc | Return status code |
An FCP URI has the form "fcp:<wwn>:<lun>" or "fcp://<wwn>/<lun>"
Definition at line 1023 of file fcp.c.
1026 const char *wwn_text;
1027 const char *lun_text;
1033 if (
snprintf ( wwn_buf,
sizeof ( wwn_buf ),
"%s",
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
int fc_aton(const char *wwn_text, struct fc_name *wwn)
Parse Fibre Channel WWN.
int scsi_parse_lun(const char *lun_string, struct scsi_lun *lun)
Parse SCSI LUN.
const char * path
Path (after URI decoding)
uint8_t lun
Logical Unit Number.
const char * host
Host name.
const char * opaque
Opaque part.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
A Uniform Resource Identifier.
#define FC_NAME_STRLEN
Length of Fibre Channel name text.
References EINVAL, fc_aton(), FC_NAME_STRLEN, uri::host, lun, uri::opaque, uri::path, rc, scsi_parse_lun(), snprintf(), and wwn.
Referenced by fcp_open().