STRUCT ISCSI_TRANSPORT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct iscsi_transport β€” iSCSI Transport template. This is the struct iscsi_transport(9) page from the Kernel API Manual, bestie πŸ’–


🌸 SYNOPSIS 🌸

Here's the whole struct, verbatim, no cap:

struct iscsi_transport {
    struct module *owner;
    char *name;
    unsigned int caps;
    struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, uint16_t cmds_max, uint16_t qdepth, uint32_t sn);
    void (*destroy_session) (struct iscsi_cls_session *session);
    struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess, uint32_t cid);
    void (*unbind_conn) (struct iscsi_cls_conn *conn, bool is_active);
    int (*bind_conn) (struct iscsi_cls_session *session, struct iscsi_cls_conn *cls_conn, uint64_t transport_eph, int is_leading);
    int (*start_conn) (struct iscsi_cls_conn *conn);
    void (*stop_conn) (struct iscsi_cls_conn *conn, int flag);
    void (*destroy_conn) (struct iscsi_cls_conn *conn);
    int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, char *buf, int buflen);
    int (*get_ep_param) (struct iscsi_endpoint *ep, enum iscsi_param param, char *buf);
    int (*get_conn_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, char *buf);
    int (*get_session_param) (struct iscsi_cls_session *session, enum iscsi_param param, char *buf);
    int (*get_host_param) (struct Scsi_Host *shost, enum iscsi_host_param param, char *buf);
    int (*set_host_param) (struct Scsi_Host *shost, enum iscsi_host_param param, char *buf, int buflen);
    int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, char *data, uint32_t data_size);
    void (*get_stats) (struct iscsi_cls_conn *conn, struct iscsi_stats *stats);
    int (*init_task) (struct iscsi_task *task);
    int (*xmit_task) (struct iscsi_task *task);
    void (*cleanup_task) (struct iscsi_task *task);
    int (*alloc_pdu) (struct iscsi_task *task, uint8_t opcode);
    int (*xmit_pdu) (struct iscsi_task *task);
    int (*init_pdu) (struct iscsi_task *task, unsigned int offset, unsigned int count);
    void (*parse_pdu_itt) (struct iscsi_conn *conn, itt_t itt, int *index, int *age);
    void (*session_recovery_timedout) (struct iscsi_cls_session *session);
    struct iscsi_endpoint *(*ep_connect) (struct Scsi_Host *shost, struct sockaddr *dst_addr, int non_blocking);
    int (*ep_poll) (struct iscsi_endpoint *ep, int timeout_ms);
    void (*ep_disconnect) (struct iscsi_endpoint *ep);
    int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, uint32_t enable, struct sockaddr *dst_addr);
    int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params);
    int (*set_iface_param) (struct Scsi_Host *shost, void *data, uint32_t len);
    int (*get_iface_param) (struct iscsi_iface *iface, enum iscsi_param_type param_type, int param, char *buf);
    umode_t (*attr_is_visible)(int param_type, int param);
    int (*bsg_request)(struct bsg_job *job);
    int (*send_ping) (struct Scsi_Host *shost, uint32_t iface_num, uint32_t iface_type, uint32_t payload_size, uint32_t pid, struct sockaddr *dst_addr);
    int (*get_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx, uint32_t *num_entries, char *buf);
    int (*delete_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx);
    int (*set_chap) (struct Scsi_Host *shost, void *data, int len);
    int (*get_flashnode_param) (struct iscsi_bus_flash_session *fnode_sess, int param, char *buf);
    int (*set_flashnode_param) (struct iscsi_bus_flash_session *fnode_sess, struct iscsi_bus_flash_conn *fnode_conn, void *data, int len);
    int (*new_flashnode) (struct Scsi_Host *shost, const char *buf, int len);
    int (*del_flashnode) (struct iscsi_bus_flash_session *fnode_sess);
    int (*login_flashnode) (struct iscsi_bus_flash_session *fnode_sess, struct iscsi_bus_flash_conn *fnode_conn);
    int (*logout_flashnode) (struct iscsi_bus_flash_session *fnode_sess, struct iscsi_bus_flash_conn *fnode_conn);
    int (*logout_flashnode_sid) (struct iscsi_cls_session *cls_sess);
    int (*get_host_stats) (struct Scsi_Host *shost, char *buf, int len);
    u8 (*check_protection)(struct iscsi_task *task, sector_t *sector);
};

🫢 Members 🫢

  • name β€” transport name. Literally the name, bestie.
  • caps β€” iSCSI Data-Path capabilities ✨
  • create_session β€” create new iSCSI session object.
  • destroy_session β€” destroy existing iSCSI session object.
  • create_conn β€” create new iSCSI connection.
  • bind_conn β€” associate this connection with existing iSCSI session and specified transport descriptor.
  • start_conn β€” set connection to be operational.
  • stop_conn β€” suspend/recover/terminate connection.
  • destroy_conn β€” destroy inactive iSCSI connection.
  • set_param β€” set iSCSI parameter. Return 0 on success, -ENODATA when param is not supported, and a -Exx value on other error. Then the page slides right into get_param β€” get iSCSI parameter. Must return number of bytes copied to buffer on success, -ENODATA when param is not supported, and a -Exx value on other error.
  • send_pdu β€” send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text.
  • init_task β€” Initialize a iscsi_task and any internal structs. When offloading the data path, this is called from queuecommand with the session lock, or from the iscsi_conn_send_pdu context with the session lock. When not offloading the data path, this is called from the scsi work queue without the session lock.
  • xmit_task β€” Requests LLD to transfer cmd task. Returns 0 or the number of bytes transferred on success, and -Exyz value on error. When offloading the data path, this is called from queuecommand with the session lock, or from the iscsi_conn_send_pdu context with the session lock. When not offloading the data path, this is called from the scsi work queue without the session lock.
  • cleanup_task β€” requests LLD to fail task. Called with session lock and after the connection has been suspended and terminated during recovery. If called from abort task then connection is not suspended or terminated but sk_callback_lock is held.
  • session_recovery_timedout β€” notify LLD a block during recovery timed out.

πŸ’… Description πŸ’…

Template API provided by iSCSI Transport β€” that's the whole vibe. This struct is the template API that iSCSI Transport hands you, periodt 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/scsi/scsi_transport_iscsi.h β€” go peek, iykyk πŸ”₯


Signed with love from ./include/scsi, dated October 2026, all about struct iscsi_transport(9) πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from