/* @tport: transport registering handlers @msg_handler: receive message handler callback @event_handler: receive event handler callback  */
int scsi_nl_add_transport(u8 tport, int(*msg_handler)(struct sk_buff *), void(*event_handler)(struct notifier_block *, unsigned long, void *))
/* @tport: transport registering handlers @msg_handler: receive message handler callback @event_handler: receive event handler callback  */
int scsi_nl_add_transport(u8 tport, int(*msg_handler)(struct sk_buff *), void(*event_handler)(struct notifier_block *, unsigned long, void *))
{
	unsigned long flags;
	int err = 0;
	if (tport >= SCSI_NL_MAX_TRANSPORTS)
		return -EINVAL;
	spin_lock_irqsave(&scsi_nl_lock, flags);
	if (scsi_nl_state & STATE_EHANDLER_BSY) {
		spin_unlock_irqrestore(&scsi_nl_lock, flags);
		msleep(1);
		spin_lock_irqsave(&scsi_nl_lock, flags);
	}
	if (transports[tport].msg_handler || transports[tport].event_handler) {
		err = -EALREADY;
		goto register_out;
	}
	transports[tport].msg_handler = msg_handler;
	transports[tport].event_handler = event_handler;
	transports[tport].flags = 0;
	transports[tport].refcnt = 0;
register_out:
	spin_unlock_irqrestore(&scsi_nl_lock, flags);
	return err;
}