Commit 228b5b7e authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (31 commits)
  [SCSI] qla2xxx: Update version number to 8.03.00-k4.
  [SCSI] qla2xxx: Correct overwrite of pre-assigned init-control-block structure size.
  [SCSI] qla2xxx: Correct truncation in return-code status checking.
  [SCSI] qla2xxx: Correct vport delete bug.
  [SCSI] qla2xxx: Use correct value for max vport in LOOP topology.
  [SCSI] qla2xxx: Correct address range checking for option-rom updates.
  [SCSI] fcoe: Change fcoe receive thread nice value from 19 (lowest priority) to -20
  [SCSI] fcoe: fix handling of pending queue, prevent out of order frames (v3)
  [SCSI] fcoe: Out of order tx frames was causing several check condition SCSI status
  [SCSI] fcoe: fix kfree(skb)
  [SCSI] fcoe: ETH_P_8021Q is already in if_ether and fcoe is not using it anyway
  [SCSI] libfc: do not change the fh_rx_id of a recevied frame
  [SCSI] fcoe: Correct fcoe_transports initialization vs. registration
  [SCSI] fcoe: Use setup_timer() and mod_timer()
  [SCSI] libfc, fcoe: Remove unnecessary cast by removing inline wrapper
  [SCSI] libfc, fcoe: Cleanup function formatting and minor typos
  [SCSI] libfc, fcoe: Fix kerneldoc comments
  [SCSI] libfc: Cleanup libfc_function_template comments
  [SCSI] libfc: check for err when recv and state is incorrect
  [SCSI] libfc: rename rp to rdata in fc_disc_new_target()
  ...
parents 37e79a43 5fa0ae19
......@@ -33,19 +33,19 @@ static LIST_HEAD(fcoe_transports);
static DEFINE_MUTEX(fcoe_transports_lock);
/**
* fcoe_transport_default - returns ptr to the default transport fcoe_sw
**/
* fcoe_transport_default() - Returns ptr to the default transport fcoe_sw
*/
struct fcoe_transport *fcoe_transport_default(void)
{
return &fcoe_sw_transport;
}
/**
* fcoe_transport_to_pcidev - get the pci dev from a netdev
* fcoe_transport_to_pcidev() - get the pci dev from a netdev
* @netdev: the netdev that pci dev will be retrived from
*
* Returns: NULL or the corrsponding pci_dev
**/
*/
struct pci_dev *fcoe_transport_pcidev(const struct net_device *netdev)
{
if (!netdev->dev.parent)
......@@ -54,18 +54,17 @@ struct pci_dev *fcoe_transport_pcidev(const struct net_device *netdev)
}
/**
* fcoe_transport_device_lookup - find out netdev is managed by the
* transport
* assign a transport to a device
* fcoe_transport_device_lookup() - Lookup a transport
* @netdev: the netdev the transport to be attached to
*
* This will look for existing offload driver, if not found, it falls back to
* the default sw hba (fcoe_sw) as its fcoe transport.
*
* Returns: 0 for success
**/
static struct fcoe_transport_internal *fcoe_transport_device_lookup(
struct fcoe_transport *t, struct net_device *netdev)
*/
static struct fcoe_transport_internal *
fcoe_transport_device_lookup(struct fcoe_transport *t,
struct net_device *netdev)
{
struct fcoe_transport_internal *ti;
......@@ -81,14 +80,14 @@ static struct fcoe_transport_internal *fcoe_transport_device_lookup(
return NULL;
}
/**
* fcoe_transport_device_add - assign a transport to a device
* fcoe_transport_device_add() - Assign a transport to a device
* @netdev: the netdev the transport to be attached to
*
* This will look for existing offload driver, if not found, it falls back to
* the default sw hba (fcoe_sw) as its fcoe transport.
*
* Returns: 0 for success
**/
*/
static int fcoe_transport_device_add(struct fcoe_transport *t,
struct net_device *netdev)
{
......@@ -123,14 +122,14 @@ static int fcoe_transport_device_add(struct fcoe_transport *t,
}
/**
* fcoe_transport_device_remove - remove a device from its transport
* fcoe_transport_device_remove() - Remove a device from its transport
* @netdev: the netdev the transport to be attached to
*
* this removes the device from the transport so the given transport will
* This removes the device from the transport so the given transport will
* not manage this device any more
*
* Returns: 0 for success
**/
*/
static int fcoe_transport_device_remove(struct fcoe_transport *t,
struct net_device *netdev)
{
......@@ -155,13 +154,13 @@ static int fcoe_transport_device_remove(struct fcoe_transport *t,
}
/**
* fcoe_transport_device_remove_all - remove all from transport devlist
* fcoe_transport_device_remove_all() - Remove all from transport devlist
*
* this removes the device from the transport so the given transport will
* This removes the device from the transport so the given transport will
* not manage this device any more
*
* Returns: 0 for success
**/
*/
static void fcoe_transport_device_remove_all(struct fcoe_transport *t)
{
struct fcoe_transport_internal *ti, *tmp;
......@@ -175,16 +174,16 @@ static void fcoe_transport_device_remove_all(struct fcoe_transport *t)
}
/**
* fcoe_transport_match - use the bus device match function to match the hw
* @t: the fcoe transport
* @netdev:
* fcoe_transport_match() - Use the bus device match function to match the hw
* @t: The fcoe transport to check
* @netdev: The netdev to match against
*
* This function is used to check if the givne transport wants to manage the
* This function is used to check if the given transport wants to manage the
* input netdev. if the transports implements the match function, it will be
* called, o.w. we just compare the pci vendor and device id.
*
* Returns: true for match up
**/
*/
static bool fcoe_transport_match(struct fcoe_transport *t,
struct net_device *netdev)
{
......@@ -210,17 +209,17 @@ static bool fcoe_transport_match(struct fcoe_transport *t,
}
/**
* fcoe_transport_lookup - check if the transport is already registered
* fcoe_transport_lookup() - Check if the transport is already registered
* @t: the transport to be looked up
*
* This compares the parent device (pci) vendor and device id
*
* Returns: NULL if not found
*
* TODO - return default sw transport if no other transport is found
**/
static struct fcoe_transport *fcoe_transport_lookup(
struct net_device *netdev)
* TODO: return default sw transport if no other transport is found
*/
static struct fcoe_transport *
fcoe_transport_lookup(struct net_device *netdev)
{
struct fcoe_transport *t;
......@@ -239,11 +238,11 @@ static struct fcoe_transport *fcoe_transport_lookup(
}
/**
* fcoe_transport_register - adds a fcoe transport to the fcoe transports list
* fcoe_transport_register() - Adds a fcoe transport to the fcoe transports list
* @t: ptr to the fcoe transport to be added
*
* Returns: 0 for success
**/
*/
int fcoe_transport_register(struct fcoe_transport *t)
{
struct fcoe_transport *tt;
......@@ -259,9 +258,6 @@ int fcoe_transport_register(struct fcoe_transport *t)
list_add_tail(&t->list, &fcoe_transports);
mutex_unlock(&fcoe_transports_lock);
mutex_init(&t->devlock);
INIT_LIST_HEAD(&t->devlist);
printk(KERN_DEBUG "fcoe_transport_register:%s\n", t->name);
return 0;
......@@ -269,11 +265,11 @@ int fcoe_transport_register(struct fcoe_transport *t)
EXPORT_SYMBOL_GPL(fcoe_transport_register);
/**
* fcoe_transport_unregister - remove the tranport fro the fcoe transports list
* fcoe_transport_unregister() - Remove the tranport fro the fcoe transports list
* @t: ptr to the fcoe transport to be removed
*
* Returns: 0 for success
**/
*/
int fcoe_transport_unregister(struct fcoe_transport *t)
{
struct fcoe_transport *tt, *tmp;
......@@ -294,8 +290,8 @@ int fcoe_transport_unregister(struct fcoe_transport *t)
}
EXPORT_SYMBOL_GPL(fcoe_transport_unregister);
/*
* fcoe_load_transport_driver - load an offload driver by alias name
/**
* fcoe_load_transport_driver() - Load an offload driver by alias name
* @netdev: the target net device
*
* Requests for an offload driver module as the fcoe transport, if fails, it
......@@ -307,7 +303,7 @@ EXPORT_SYMBOL_GPL(fcoe_transport_unregister);
* 3. pure hw fcoe hba may not have netdev
*
* Returns: 0 for success
**/
*/
int fcoe_load_transport_driver(struct net_device *netdev)
{
struct pci_dev *pci;
......@@ -335,14 +331,14 @@ int fcoe_load_transport_driver(struct net_device *netdev)
EXPORT_SYMBOL_GPL(fcoe_load_transport_driver);
/**
* fcoe_transport_attach - load transport to fcoe
* fcoe_transport_attach() - Load transport to fcoe
* @netdev: the netdev the transport to be attached to
*
* This will look for existing offload driver, if not found, it falls back to
* the default sw hba (fcoe_sw) as its fcoe transport.
*
* Returns: 0 for success
**/
*/
int fcoe_transport_attach(struct net_device *netdev)
{
struct fcoe_transport *t;
......@@ -373,11 +369,11 @@ int fcoe_transport_attach(struct net_device *netdev)
EXPORT_SYMBOL_GPL(fcoe_transport_attach);
/**
* fcoe_transport_release - unload transport from fcoe
* fcoe_transport_release() - Unload transport from fcoe
* @netdev: the net device on which fcoe is to be released
*
* Returns: 0 for success
**/
*/
int fcoe_transport_release(struct net_device *netdev)
{
struct fcoe_transport *t;
......@@ -410,12 +406,12 @@ int fcoe_transport_release(struct net_device *netdev)
EXPORT_SYMBOL_GPL(fcoe_transport_release);
/**
* fcoe_transport_init - initializes fcoe transport layer
* fcoe_transport_init() - Initializes fcoe transport layer
*
* This prepares for the fcoe transport layer
*
* Returns: none
**/
*/
int __init fcoe_transport_init(void)
{
INIT_LIST_HEAD(&fcoe_transports);
......@@ -424,12 +420,13 @@ int __init fcoe_transport_init(void)
}
/**
* fcoe_transport_exit - cleans up the fcoe transport layer
* fcoe_transport_exit() - Cleans up the fcoe transport layer
*
* This cleans up the fcoe transport layer. removing any transport on the list,
* note that the transport destroy func is not called here.
*
* Returns: none
**/
*/
int __exit fcoe_transport_exit(void)
{
struct fcoe_transport *t, *tmp;
......
......@@ -104,19 +104,19 @@ static struct scsi_host_template fcoe_sw_shost_template = {
.max_sectors = 0xffff,
};
/*
* fcoe_sw_lport_config - sets up the fc_lport
/**
* fcoe_sw_lport_config() - sets up the fc_lport
* @lp: ptr to the fc_lport
* @shost: ptr to the parent scsi host
*
* Returns: 0 for success
*
*/
static int fcoe_sw_lport_config(struct fc_lport *lp)
{
int i = 0;
lp->link_status = 0;
lp->link_up = 0;
lp->qfull = 0;
lp->max_retry_count = 3;
lp->e_d_tov = 2 * 1000; /* FC-FS default */
lp->r_a_tov = 2 * 2 * 1000;
......@@ -136,16 +136,14 @@ static int fcoe_sw_lport_config(struct fc_lport *lp)
return 0;
}
/*
* fcoe_sw_netdev_config - sets up fcoe_softc for lport and network
* related properties
/**
* fcoe_sw_netdev_config() - Set up netdev for SW FCoE
* @lp : ptr to the fc_lport
* @netdev : ptr to the associated netdevice struct
*
* Must be called after fcoe_sw_lport_config() as it will use lport mutex
*
* Returns : 0 for success
*
*/
static int fcoe_sw_netdev_config(struct fc_lport *lp, struct net_device *netdev)
{
......@@ -181,9 +179,8 @@ static int fcoe_sw_netdev_config(struct fc_lport *lp, struct net_device *netdev)
if (fc_set_mfs(lp, mfs))
return -EINVAL;
lp->link_status = ~FC_PAUSE & ~FC_LINK_UP;
if (!fcoe_link_ok(lp))
lp->link_status |= FC_LINK_UP;
lp->link_up = 1;
/* offload features support */
if (fc->real_dev->features & NETIF_F_SG)
......@@ -191,6 +188,7 @@ static int fcoe_sw_netdev_config(struct fc_lport *lp, struct net_device *netdev)
skb_queue_head_init(&fc->fcoe_pending_queue);
fc->fcoe_pending_queue_active = 0;
/* setup Source Mac Address */
memcpy(fc->ctl_src_addr, fc->real_dev->dev_addr,
......@@ -224,16 +222,15 @@ static int fcoe_sw_netdev_config(struct fc_lport *lp, struct net_device *netdev)
return 0;
}
/*
* fcoe_sw_shost_config - sets up fc_lport->host
/**
* fcoe_sw_shost_config() - Sets up fc_lport->host
* @lp : ptr to the fc_lport
* @shost : ptr to the associated scsi host
* @dev : device associated to scsi host
*
* Must be called after fcoe_sw_lport_config) and fcoe_sw_netdev_config()
* Must be called after fcoe_sw_lport_config() and fcoe_sw_netdev_config()
*
* Returns : 0 for success
*
*/
static int fcoe_sw_shost_config(struct fc_lport *lp, struct Scsi_Host *shost,
struct device *dev)
......@@ -261,8 +258,8 @@ static int fcoe_sw_shost_config(struct fc_lport *lp, struct Scsi_Host *shost,
return 0;
}
/*
* fcoe_sw_em_config - allocates em for this lport
/**
* fcoe_sw_em_config() - allocates em for this lport
* @lp: the port that em is to allocated for
*
* Returns : 0 on success
......@@ -279,8 +276,8 @@ static inline int fcoe_sw_em_config(struct fc_lport *lp)
return 0;
}
/*
* fcoe_sw_destroy - FCoE software HBA tear-down function
/**
* fcoe_sw_destroy() - FCoE software HBA tear-down function
* @netdev: ptr to the associated net_device
*
* Returns: 0 if link is OK for use by FCoE.
......@@ -301,7 +298,7 @@ static int fcoe_sw_destroy(struct net_device *netdev)
if (!lp)
return -ENODEV;
fc = fcoe_softc(lp);
fc = lport_priv(lp);
/* Logout of the fabric */
fc_fabric_logoff(lp);
......@@ -353,8 +350,8 @@ static struct libfc_function_template fcoe_sw_libfc_fcn_templ = {
.frame_send = fcoe_xmit,
};
/*
* fcoe_sw_create - this function creates the fcoe interface
/**
* fcoe_sw_create() - this function creates the fcoe interface
* @netdev: pointer the associated netdevice
*
* Creates fc_lport struct and scsi_host for lport, configures lport
......@@ -440,8 +437,8 @@ static int fcoe_sw_create(struct net_device *netdev)
return rc;
}
/*
* fcoe_sw_match - the fcoe sw transport match function
/**
* fcoe_sw_match() - The FCoE SW transport match function
*
* Returns : false always
*/
......@@ -461,8 +458,8 @@ struct fcoe_transport fcoe_sw_transport = {
.device = 0xffff,
};
/*
* fcoe_sw_init - registers fcoe_sw_transport
/**
* fcoe_sw_init() - Registers fcoe_sw_transport
*
* Returns : 0 on success
*/
......@@ -471,17 +468,22 @@ int __init fcoe_sw_init(void)
/* attach to scsi transport */
scsi_transport_fcoe_sw =
fc_attach_transport(&fcoe_sw_transport_function);
if (!scsi_transport_fcoe_sw) {
printk(KERN_ERR "fcoe_sw_init:fc_attach_transport() failed\n");
return -ENODEV;
}
mutex_init(&fcoe_sw_transport.devlock);
INIT_LIST_HEAD(&fcoe_sw_transport.devlist);
/* register sw transport */
fcoe_transport_register(&fcoe_sw_transport);
return 0;
}
/*
* fcoe_sw_exit - unregisters fcoe_sw_transport
/**
* fcoe_sw_exit() - Unregisters fcoe_sw_transport
*
* Returns : 0 on success
*/
......
This diff is collapsed.
......@@ -64,7 +64,7 @@ static void fc_disc_single(struct fc_disc *, struct fc_disc_port *);
static void fc_disc_restart(struct fc_disc *);
/**
* fc_disc_lookup_rport - lookup a remote port by port_id
* fc_disc_lookup_rport() - lookup a remote port by port_id
* @lport: Fibre Channel host port instance
* @port_id: remote port port_id to match
*/
......@@ -92,7 +92,7 @@ struct fc_rport *fc_disc_lookup_rport(const struct fc_lport *lport,
}
/**
* fc_disc_stop_rports - delete all the remote ports associated with the lport
* fc_disc_stop_rports() - delete all the remote ports associated with the lport
* @disc: The discovery job to stop rports on
*
* Locking Note: This function expects that the lport mutex is locked before
......@@ -117,7 +117,7 @@ void fc_disc_stop_rports(struct fc_disc *disc)
}
/**
* fc_disc_rport_callback - Event handler for rport events
* fc_disc_rport_callback() - Event handler for rport events
* @lport: The lport which is receiving the event
* @rport: The rport which the event has occured on
* @event: The event that occured
......@@ -151,7 +151,7 @@ static void fc_disc_rport_callback(struct fc_lport *lport,
}
/**
* fc_disc_recv_rscn_req - Handle Registered State Change Notification (RSCN)
* fc_disc_recv_rscn_req() - Handle Registered State Change Notification (RSCN)
* @sp: Current sequence of the RSCN exchange
* @fp: RSCN Frame
* @lport: Fibre Channel host port instance
......@@ -246,7 +246,7 @@ static void fc_disc_recv_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
list_del(&dp->peers);
rport = lport->tt.rport_lookup(lport, dp->ids.port_id);
if (rport) {
rdata = RPORT_TO_PRIV(rport);
rdata = rport->dd_data;
list_del(&rdata->peers);
lport->tt.rport_logoff(rport);
}
......@@ -265,7 +265,7 @@ static void fc_disc_recv_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
}
/**
* fc_disc_recv_req - Handle incoming requests
* fc_disc_recv_req() - Handle incoming requests
* @sp: Current sequence of the request exchange
* @fp: The frame
* @lport: The FC local port
......@@ -294,7 +294,7 @@ static void fc_disc_recv_req(struct fc_seq *sp, struct fc_frame *fp,
}
/**
* fc_disc_restart - Restart discovery
* fc_disc_restart() - Restart discovery
* @lport: FC discovery context
*
* Locking Note: This function expects that the disc mutex
......@@ -322,7 +322,7 @@ static void fc_disc_restart(struct fc_disc *disc)
}
/**
* fc_disc_start - Fibre Channel Target discovery
* fc_disc_start() - Fibre Channel Target discovery
* @lport: FC local port
*
* Returns non-zero if discovery cannot be started.
......@@ -383,7 +383,7 @@ static struct fc_rport_operations fc_disc_rport_ops = {
};
/**
* fc_disc_new_target - Handle new target found by discovery
* fc_disc_new_target() - Handle new target found by discovery
* @lport: FC local port
* @rport: The previous FC remote port (NULL if new remote port)
* @ids: Identifiers for the new FC remote port
......@@ -396,7 +396,7 @@ static int fc_disc_new_target(struct fc_disc *disc,
struct fc_rport_identifiers *ids)
{
struct fc_lport *lport = disc->lport;
struct fc_rport_libfc_priv *rp;
struct fc_rport_libfc_priv *rdata;
int error = 0;
if (rport && ids->port_name) {
......@@ -430,15 +430,15 @@ static int fc_disc_new_target(struct fc_disc *disc,
dp.ids.port_name = ids->port_name;
dp.ids.node_name = ids->node_name;
dp.ids.roles = ids->roles;
rport = fc_rport_rogue_create(&dp);
rport = lport->tt.rport_create(&dp);
}
if (!rport)
error = -ENOMEM;
}
if (rport) {
rp = rport->dd_data;
rp->ops = &fc_disc_rport_ops;
rp->rp_state = RPORT_ST_INIT;
rdata = rport->dd_data;
rdata->ops = &fc_disc_rport_ops;
rdata->rp_state = RPORT_ST_INIT;
lport->tt.rport_login(rport);
}
}
......@@ -446,20 +446,20 @@ static int fc_disc_new_target(struct fc_disc *disc,
}
/**
* fc_disc_del_target - Delete a target
* fc_disc_del_target() - Delete a target
* @disc: FC discovery context
* @rport: The remote port to be removed
*/
static void fc_disc_del_target(struct fc_disc *disc, struct fc_rport *rport)
{
struct fc_lport *lport = disc->lport;
struct fc_rport_libfc_priv *rdata = RPORT_TO_PRIV(rport);
struct fc_rport_libfc_priv *rdata = rport->dd_data;
list_del(&rdata->peers);
lport->tt.rport_logoff(rport);
}
/**
* fc_disc_done - Discovery has been completed
* fc_disc_done() - Discovery has been completed
* @disc: FC discovery context
*/
static void fc_disc_done(struct fc_disc *disc)
......@@ -479,7 +479,7 @@ static void fc_disc_done(struct fc_disc *disc)
}
/**
* fc_disc_error - Handle error on dNS request
* fc_disc_error() - Handle error on dNS request
* @disc: FC discovery context
* @fp: The frame pointer
*/
......@@ -519,7 +519,7 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
}
/**
* fc_disc_gpn_ft_req - Send Get Port Names by FC-4 type (GPN_FT) request
* fc_disc_gpn_ft_req() - Send Get Port Names by FC-4 type (GPN_FT) request
* @lport: FC discovery context
*
* Locking Note: This function expects that the disc_mutex is locked
......@@ -553,7 +553,7 @@ static void fc_disc_gpn_ft_req(struct fc_disc *disc)
}
/**
* fc_disc_gpn_ft_parse - Parse the list of IDs and names resulting from a request
* fc_disc_gpn_ft_parse() - Parse the list of IDs and names resulting from a request
* @lport: Fibre Channel host port instance
* @buf: GPN_FT response buffer
* @len: size of response buffer
......@@ -617,7 +617,7 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
if ((dp.ids.port_id != fc_host_port_id(lport->host)) &&
(dp.ids.port_name != lport->wwpn)) {
rport = fc_rport_rogue_create(&dp);
rport = lport->tt.rport_create(&dp);
if (rport) {
rdata = rport->dd_data;
rdata->ops = &fc_disc_rport_ops;
......@@ -658,7 +658,10 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
return error;
}
/*
/**
* fc_disc_timeout() - Retry handler for the disc component
* @work: Structure holding disc obj that needs retry discovery
*
* Handle retry of memory allocation for remote ports.
*/
static void fc_disc_timeout(struct work_struct *work)
......@@ -673,7 +676,7 @@ static void fc_disc_timeout(struct work_struct *work)
}
/**
* fc_disc_gpn_ft_resp - Handle a response frame from Get Port Names (GPN_FT)
* fc_disc_gpn_ft_resp() - Handle a response frame from Get Port Names (GPN_FT)
* @sp: Current sequence of GPN_FT exchange
* @fp: response frame
* @lp_arg: Fibre Channel host port instance
......@@ -712,9 +715,7 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
fr_len(fp));
} else if (ntohs(cp->ct_cmd) == FC_FS_ACC) {
/*
* Accepted. Parse response.
*/
/* Accepted, parse the response. */
buf = cp + 1;
len -= sizeof(*cp);
} else if (ntohs(cp->ct_cmd) == FC_FS_RJT) {
......@@ -746,7 +747,7 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
}
/**
* fc_disc_single - Discover the directory information for a single target
* fc_disc_single() - Discover the directory information for a single target
* @lport: FC local port
* @dp: The port to rediscover
*
......@@ -769,7 +770,7 @@ static void fc_disc_single(struct fc_disc *disc, struct fc_disc_port *dp)
if (rport)
fc_disc_del_target(disc, rport);
new_rport = fc_rport_rogue_create(dp);
new_rport = lport->tt.rport_create(dp);
if (new_rport) {
rdata = new_rport->dd_data;
rdata->ops = &fc_disc_rport_ops;
......@@ -782,7 +783,7 @@ static void fc_disc_single(struct fc_disc *disc, struct fc_disc_port *dp)
}
/**
* fc_disc_stop - Stop discovery for a given lport
* fc_disc_stop() - Stop discovery for a given lport
* @lport: The lport that discovery should stop for
*/
void fc_disc_stop(struct fc_lport *lport)
......@@ -796,7 +797,7 @@ void fc_disc_stop(struct fc_lport *lport)
}
/**
* fc_disc_stop_final - Stop discovery for a given lport
* fc_disc_stop_final() - Stop discovery for a given lport
* @lport: The lport that discovery should stop for
*
* This function will block until discovery has been
......@@ -809,7 +810,7 @@ void fc_disc_stop_final(struct fc_lport *lport)
}
/**
* fc_disc_init - Initialize the discovery block
* fc_disc_init() - Initialize the discovery block
* @lport: FC local port
*/
int fc_disc_init(struct fc_lport *lport)
......
......@@ -32,8 +32,6 @@
#include <scsi/libfc.h>
#include <scsi/fc_encode.h>
#define FC_DEF_R_A_TOV (10 * 1000) /* resource allocation timeout */
/*
* fc_exch_debug can be set in debugger or at compile time to get more logs.
*/
......@@ -627,7 +625,6 @@ static struct fc_exch *fc_exch_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
{
struct fc_exch *ep;
struct fc_frame_header *fh;
u16 rxid;
ep = mp->lp->tt.exch_get(mp->lp, fp);
if (ep) {
......@@ -654,18 +651,6 @@ static struct fc_exch *fc_exch_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
if ((ntoh24(fh->fh_f_ctl) & FC_FC_SEQ_INIT) == 0)
ep->esb_stat &= ~ESB_ST_SEQ_INIT;
/*
* Set the responder ID in the frame header.
* The old one should've been 0xffff.
* If it isn't, don't assign one.
* Incoming basic link service frames may specify
* a referenced RX_ID.
*/
if (fh->fh_type != FC_TYPE_BLS) {
rxid = ntohs(fh->fh_rx_id);
WARN_ON(rxid != FC_XID_UNKNOWN);
fh->fh_rx_id = htons(ep->rxid);
}
fc_exch_hold(ep); /* hold for caller */
spin_unlock_bh(&ep->ex_lock); /* lock from exch_get */
}
......@@ -677,8 +662,8 @@ static struct fc_exch *fc_exch_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
* If fc_pf_rjt_reason is FC_RJT_NONE then this function will have a hold
* on the ep that should be released by the caller.
*/
static enum fc_pf_rjt_reason
fc_seq_lookup_recip(struct fc_exch_mgr *mp, struct fc_frame *fp)
static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_exch_mgr *mp,
struct fc_frame *fp)
{
struct fc_frame_header *fh = fc_frame_header_get(fp);
struct fc_exch *ep = NULL;
......@@ -996,8 +981,8 @@ static void fc_seq_send_ack(struct fc_seq *sp, const struct fc_frame *rx_fp)
* Send BLS Reject.
* This is for rejecting BA_ABTS only.
*/
static void
fc_exch_send_ba_rjt(struct fc_frame *rx_fp, enum fc_ba_rjt_reason reason,
static void fc_exch_send_ba_rjt(struct fc_frame *rx_fp,
enum fc_ba_rjt_reason reason,
enum fc_ba_rjt_explan explan)
{
struct fc_frame *fp;
......@@ -1096,7 +1081,7 @@ static void fc_exch_recv_abts(struct fc_exch *ep, struct fc_frame *rx_fp)
ap->ba_high_seq_cnt = fh->fh_seq_cnt;
ap->ba_low_seq_cnt = htons(sp->cnt);
}
sp = fc_seq_start_next(sp);
sp = fc_seq_start_next_locked(sp);
spin_unlock_bh(&ep->ex_lock);
fc_seq_send_last(sp, fp, FC_RCTL_BA_ACC, FC_TYPE_BLS);
fc_frame_free(rx_fp);
......@@ -1480,10 +1465,11 @@ static void fc_exch_reset(struct fc_exch *ep)
* If sid is non-zero, reset only exchanges we source from that FID.
* If did is non-zero, reset only exchanges destined to that FID.
*/
void fc_exch_mgr_reset(struct fc_exch_mgr *mp, u32 sid, u32 did)
void fc_exch_mgr_reset(struct fc_lport *lp, u32 sid, u32 did)
{
struct fc_exch *ep;
struct fc_exch *next;
struct fc_exch_mgr *mp = lp->emp;
spin_lock_bh(&mp->em_lock);
restart:
......@@ -1607,7 +1593,7 @@ static void fc_exch_rrq_resp(struct fc_seq *sp, struct fc_frame *fp, void *arg)
if (IS_ERR(fp)) {
int err = PTR_ERR(fp);
if (err == -FC_EX_CLOSED)
if (err == -FC_EX_CLOSED || err == -FC_EX_TIMEOUT)
goto cleanup;
FC_DBG("Cannot process RRQ, because of frame error %d\n", err);
return;
......
......@@ -161,7 +161,7 @@ static struct fc_fcp_pkt *fc_fcp_pkt_alloc(struct fc_lport *lp, gfp_t gfp)
}
/**
* fc_fcp_pkt_release - release hold on scsi_pkt packet
* fc_fcp_pkt_release() - release hold on scsi_pkt packet
* @fsp: fcp packet struct
*
* This is used by upper layer scsi driver.
......@@ -183,8 +183,7 @@ static void fc_fcp_pkt_hold(struct fc_fcp_pkt *fsp)
}
/**
* fc_fcp_pkt_destory - release hold on scsi_pkt packet
*
* fc_fcp_pkt_destory() - release hold on scsi_pkt packet
* @seq: exchange sequence
* @fsp: fcp packet struct
*
......@@ -199,7 +198,7 @@ static void fc_fcp_pkt_destroy(struct fc_seq *seq, void *fsp)
}
/**
* fc_fcp_lock_pkt - lock a packet and get a ref to it.
* fc_fcp_lock_pkt() - lock a packet and get a ref to it.
* @fsp: fcp packet
*
* We should only return error if we return a command to scsi-ml before
......@@ -291,9 +290,7 @@ static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
buf = fc_frame_payload_get(fp, 0);
if (offset + len > fsp->data_len) {
/*
* this should never happen
*/
/* this should never happen */
if ((fr_flags(fp) & FCPHF_CRC_UNCHECKED) &&
fc_frame_crc_check(fp))
goto crc_err;
......@@ -387,8 +384,8 @@ static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
fc_fcp_complete_locked(fsp);
}
/*
* fc_fcp_send_data - Send SCSI data to target.
/**
* fc_fcp_send_data() - Send SCSI data to target.
* @fsp: ptr to fc_fcp_pkt
* @sp: ptr to this sequence
* @offset: starting offset for this data request
......@@ -610,8 +607,8 @@ static void fc_fcp_abts_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
}
}
/*
* fc_fcp_reduce_can_queue - drop can_queue
/**
* fc_fcp_reduce_can_queue() - drop can_queue
* @lp: lport to drop queueing for
*
* If we are getting memory allocation failures, then we may
......@@ -642,9 +639,11 @@ static void fc_fcp_reduce_can_queue(struct fc_lport *lp)
spin_unlock_irqrestore(lp->host->host_lock, flags);
}
/*
* exch mgr calls this routine to process scsi
* exchanges.
/**
* fc_fcp_recv() - Reveive FCP frames
* @seq: The sequence the frame is on
* @fp: The FC frame
* @arg: The related FCP packet
*
* Return : None
* Context : called from Soft IRQ context
......@@ -832,7 +831,7 @@ static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
}
/**
* fc_fcp_complete_locked - complete processing of a fcp packet
* fc_fcp_complete_locked() - complete processing of a fcp packet
* @fsp: fcp packet
*
* This function may sleep if a timer is pending. The packet lock must be
......@@ -900,7 +899,7 @@ static void fc_fcp_cleanup_cmd(struct fc_fcp_pkt *fsp, int error)
}
/**
* fc_fcp_cleanup_each_cmd - run fn on each active command
* fc_fcp_cleanup_each_cmd() - Cleanup active commads
* @lp: logical port
* @id: target id
* @lun: lun
......@@ -952,7 +951,7 @@ static void fc_fcp_abort_io(struct fc_lport *lp)
}
/**
* fc_fcp_pkt_send - send a fcp packet to the lower level.
* fc_fcp_pkt_send() - send a fcp packet to the lower level.
* @lp: fc lport
* @fsp: fc packet.
*
......@@ -1621,7 +1620,7 @@ static void fc_fcp_srr_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
static inline int fc_fcp_lport_queue_ready(struct fc_lport *lp)
{
/* lock ? */
return (lp->state == LPORT_ST_READY) && (lp->link_status & FC_LINK_UP);
return (lp->state == LPORT_ST_READY) && lp->link_up && !lp->qfull;
}
/**
......@@ -1727,7 +1726,7 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
EXPORT_SYMBOL(fc_queuecommand);
/**
* fc_io_compl - Handle responses for completed commands
* fc_io_compl() - Handle responses for completed commands
* @fsp: scsi packet
*
* Translates a error to a Linux SCSI error.
......@@ -1810,12 +1809,12 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
sc_cmd->result = DID_ERROR << 16;
break;
case FC_DATA_UNDRUN:
if (fsp->cdb_status == 0) {
if ((fsp->cdb_status == 0) && !(fsp->req_flags & FC_SRB_READ)) {
/*
* scsi status is good but transport level
* underrun. for read it should be an error??
* underrun.
*/
sc_cmd->result = (DID_OK << 16) | fsp->cdb_status;
sc_cmd->result = DID_OK << 16;
} else {
/*
* scsi got underrun, this is an error
......@@ -1857,7 +1856,7 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
}
/**
* fc_fcp_complete - complete processing of a fcp packet
* fc_fcp_complete() - complete processing of a fcp packet
* @fsp: fcp packet
*
* This function may sleep if a fsp timer is pending.
......@@ -1874,9 +1873,10 @@ void fc_fcp_complete(struct fc_fcp_pkt *fsp)
EXPORT_SYMBOL(fc_fcp_complete);
/**
* fc_eh_abort - Abort a command...from scsi host template
* fc_eh_abort() - Abort a command
* @sc_cmd: scsi command to abort
*
* From scsi host template.
* send ABTS to the target device and wait for the response
* sc_cmd is the pointer to the command to be aborted.
*/
......@@ -1890,7 +1890,7 @@ int fc_eh_abort(struct scsi_cmnd *sc_cmd)
lp = shost_priv(sc_cmd->device->host);
if (lp->state != LPORT_ST_READY)
return rc;
else if (!(lp->link_status & FC_LINK_UP))
else if (!lp->link_up)
return rc;
spin_lock_irqsave(lp->host->host_lock, flags);
......@@ -1920,7 +1920,7 @@ int fc_eh_abort(struct scsi_cmnd *sc_cmd)
EXPORT_SYMBOL(fc_eh_abort);
/**
* fc_eh_device_reset: Reset a single LUN
* fc_eh_device_reset() Reset a single LUN
* @sc_cmd: scsi command
*
* Set from scsi host template to send tm cmd to the target and wait for the
......@@ -1973,7 +1973,7 @@ int fc_eh_device_reset(struct scsi_cmnd *sc_cmd)
EXPORT_SYMBOL(fc_eh_device_reset);
/**
* fc_eh_host_reset - The reset function will reset the ports on the host.
* fc_eh_host_reset() - The reset function will reset the ports on the host.
* @sc_cmd: scsi command
*/
int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
......@@ -1999,7 +1999,7 @@ int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
EXPORT_SYMBOL(fc_eh_host_reset);
/**
* fc_slave_alloc - configure queue depth
* fc_slave_alloc() - configure queue depth
* @sdev: scsi device
*
* Configures queue depth based on host's cmd_per_len. If not set
......
This diff is collapsed.
This diff is collapsed.
......@@ -244,12 +244,6 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj,
if (ha->optrom_state != QLA_SWAITING)
break;
if (start & 0xfff) {
qla_printk(KERN_WARNING, ha,
"Invalid start region 0x%x/0x%x.\n", start, size);
return -EINVAL;
}
ha->optrom_region_start = start;
ha->optrom_region_size = start + size > ha->optrom_size ?
ha->optrom_size - start : size;
......@@ -303,8 +297,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj,
else if (start == (ha->flt_region_boot * 4) ||
start == (ha->flt_region_fw * 4))
valid = 1;
else if ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) &&
start == (ha->flt_region_vpd_nvram * 4))
else if (IS_QLA25XX(ha) || IS_QLA81XX(ha))
valid = 1;
if (!valid) {
qla_printk(KERN_WARNING, ha,
......
......@@ -1308,8 +1308,12 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
DEBUG(printk("scsi(%ld): Issue init firmware.\n", vha->host_no));
if (ha->flags.npiv_supported)
if (ha->flags.npiv_supported) {
if (ha->operating_mode == LOOP)
ha->max_npiv_vports = MIN_MULTI_ID_FABRIC - 1;
mid_init_cb->count = cpu_to_le16(ha->max_npiv_vports);
}
mid_init_cb->options = __constant_cpu_to_le16(BIT_1);
......@@ -2610,6 +2614,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
port_id_t wrap, nxt_d_id;
struct qla_hw_data *ha = vha->hw;
struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev);
struct scsi_qla_host *tvp;
rval = QLA_SUCCESS;
......@@ -2709,7 +2714,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
/* Bypass virtual ports of the same host. */
found = 0;
if (ha->num_vhosts) {
list_for_each_entry(vp, &ha->vp_list, list) {
list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
if (new_fcport->d_id.b24 == vp->d_id.b24) {
found = 1;
break;
......@@ -2832,6 +2837,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev)
uint16_t first_loop_id;
struct qla_hw_data *ha = vha->hw;
struct scsi_qla_host *vp;
struct scsi_qla_host *tvp;
rval = QLA_SUCCESS;
......@@ -2856,7 +2862,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev)
/* Check for loop ID being already in use. */
found = 0;
fcport = NULL;
list_for_each_entry(vp, &ha->vp_list, list) {
list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
list_for_each_entry(fcport, &vp->vp_fcports, list) {
if (fcport->loop_id == dev->loop_id &&
fcport != dev) {
......@@ -3291,6 +3297,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
uint8_t status = 0;
struct qla_hw_data *ha = vha->hw;
struct scsi_qla_host *vp;
struct scsi_qla_host *tvp;
struct req_que *req = ha->req_q_map[0];
if (vha->flags.online) {
......@@ -3306,7 +3313,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
atomic_set(&vha->loop_state, LOOP_DOWN);
qla2x00_mark_all_devices_lost(vha, 0);
list_for_each_entry(vp, &ha->vp_list, list)
list_for_each_entry_safe(vp, tvp, &ha->vp_list, list)
qla2x00_mark_all_devices_lost(vp, 0);
} else {
if (!atomic_read(&vha->loop_down_timer))
......@@ -3403,7 +3410,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
DEBUG(printk(KERN_INFO
"qla2x00_abort_isp(%ld): succeeded.\n",
vha->host_no));
list_for_each_entry(vp, &ha->vp_list, list) {
list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
if (vp->vp_idx)
qla2x00_vp_abort_isp(vp);
}
......@@ -3428,7 +3435,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
static int
qla2x00_restart_isp(scsi_qla_host_t *vha)
{
uint8_t status = 0;
int status = 0;
uint32_t wait_time;
struct qla_hw_data *ha = vha->hw;
struct req_que *req = ha->req_q_map[0];
......
......@@ -2685,6 +2685,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha,
uint16_t stat = le16_to_cpu(rptid_entry->vp_idx);
struct qla_hw_data *ha = vha->hw;
scsi_qla_host_t *vp;
scsi_qla_host_t *tvp;
if (rptid_entry->entry_status != 0)
return;
......@@ -2710,7 +2711,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha,
if (MSB(stat) == 1)
return;
list_for_each_entry(vp, &ha->vp_list, list)
list_for_each_entry_safe(vp, tvp, &ha->vp_list, list)
if (vp_idx == vp->vp_idx)
break;
if (!vp)
......
......@@ -69,9 +69,10 @@ static scsi_qla_host_t *
qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name)
{
scsi_qla_host_t *vha;
struct scsi_qla_host *tvha;
/* Locate matching device in database. */
list_for_each_entry(vha, &ha->vp_list, list) {
list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
if (!memcmp(port_name, vha->port_name, WWN_SIZE))
return vha;
}
......@@ -194,11 +195,11 @@ qla24xx_configure_vp(scsi_qla_host_t *vha)
void
qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb)
{
scsi_qla_host_t *vha;
scsi_qla_host_t *vha, *tvha;
struct qla_hw_data *ha = rsp->hw;
int i = 0;
list_for_each_entry(vha, &ha->vp_list, list) {
list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
if (vha->vp_idx) {
switch (mb[0]) {
case MBA_LIP_OCCURRED:
......@@ -300,6 +301,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
int ret;
struct qla_hw_data *ha = vha->hw;
scsi_qla_host_t *vp;
struct scsi_qla_host *tvp;
if (vha->vp_idx)
return;
......@@ -308,7 +310,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
clear_bit(VP_DPC_NEEDED, &vha->dpc_flags);
list_for_each_entry(vp, &ha->vp_list, list) {
list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
if (vp->vp_idx)
ret = qla2x00_do_dpc_vp(vp);
}
......
......@@ -2222,10 +2222,6 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
{
char name[16];
ha->init_cb_size = sizeof(init_cb_t);
if (IS_QLA2XXX_MIDTYPE(ha))
ha->init_cb_size = sizeof(struct mid_init_cb_24xx);
ha->init_cb = dma_alloc_coherent(&ha->pdev->dev, ha->init_cb_size,
&ha->init_cb_dma, GFP_KERNEL);
if (!ha->init_cb)
......@@ -2568,7 +2564,7 @@ qla2x00_do_work(struct scsi_qla_host *vha)
void qla2x00_relogin(struct scsi_qla_host *vha)
{
fc_port_t *fcport;
uint8_t status;
int status;
uint16_t next_loopid = 0;
struct qla_hw_data *ha = vha->hw;
......
......@@ -7,7 +7,7 @@
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.03.00-k3"
#define QLA2XXX_VERSION "8.03.00-k4"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 3
......
......@@ -1167,23 +1167,19 @@ sd_spinup_disk(struct scsi_disk *sdkp)
/*
* The device does not want the automatic start to be issued.
*/
if (sdkp->device->no_start_on_add) {
if (sdkp->device->no_start_on_add)
break;
}
/*
* If manual intervention is required, or this is an
* absent USB storage device, a spinup is meaningless.
*/
if (sense_valid &&
sshdr.sense_key == NOT_READY &&
sshdr.asc == 4 && sshdr.ascq == 3) {
if (sense_valid && sshdr.sense_key == NOT_READY) {
if (sshdr.asc == 4 && sshdr.ascq == 3)
break; /* manual intervention required */
if (sshdr.asc == 4 && sshdr.ascq == 0xb)
break; /* standby */
if (sshdr.asc == 4 && sshdr.ascq == 0xc)
break; /* unavailable */
/*
* Issue command to spin up drive when not ready
*/
} else if (sense_valid && sshdr.sense_key == NOT_READY) {
if (!spintime) {
sd_printk(KERN_NOTICE, sdkp, "Spinning up disk...");
cmd[0] = START_STOP;
......
......@@ -31,10 +31,6 @@
#define ETH_P_FCOE 0x8906 /* FCOE ether type */
#endif
#ifndef ETH_P_8021Q
#define ETH_P_8021Q 0x8100
#endif
/*
* FC_FCOE_OUI hasn't been standardized yet. XXX TBD.
*/
......
......@@ -337,4 +337,9 @@ enum fc_pf_rjt_reason {
FC_RJT_VENDOR = 0xff, /* vendor specific reject */
};
/* default timeout values */
#define FC_DEF_E_D_TOV 2000UL
#define FC_DEF_R_A_TOV 10000UL
#endif /* _FC_FS_H_ */
......@@ -68,9 +68,6 @@
/*
* FC HBA status
*/
#define FC_PAUSE (1 << 1)
#define FC_LINK_UP (1 << 0)
enum fc_lport_state {
LPORT_ST_NONE = 0,
LPORT_ST_FLOGI,
......@@ -339,31 +336,17 @@ struct fc_exch {
struct libfc_function_template {
/**
* Mandatory Fields
*
* These handlers must be implemented by the LLD.
*/
/*
* Interface to send a FC frame
*/
int (*frame_send)(struct fc_lport *lp, struct fc_frame *fp);
/**
* Optional Fields
*
* The LLD may choose to implement any of the following handlers.
* If LLD doesn't specify hander and leaves its pointer NULL then
* the default libfc function will be used for that handler.
*/
/**
* ELS/CT interfaces
* STATUS: REQUIRED
*/
int (*frame_send)(struct fc_lport *lp, struct fc_frame *fp);
/*
* elsct_send - sends ELS/CT frame
* Interface to send ELS/CT frames
*
* STATUS: OPTIONAL
*/
struct fc_seq *(*elsct_send)(struct fc_lport *lport,
struct fc_rport *rport,
......@@ -373,9 +356,6 @@ struct libfc_function_template {
struct fc_frame *fp,
void *arg),
void *arg, u32 timer_msec);
/**
* Exhance Manager interfaces
*/
/*
* Send the FC frame payload using a new exchange and sequence.
......@@ -407,6 +387,8 @@ struct libfc_function_template {
* timer_msec argument is specified. The timer is canceled when
* it fires or when the exchange is done. The exchange timeout handler
* is registered by EM layer.
*
* STATUS: OPTIONAL
*/
struct fc_seq *(*exch_seq_send)(struct fc_lport *lp,
struct fc_frame *fp,
......@@ -418,14 +400,18 @@ struct libfc_function_template {
void *arg, unsigned int timer_msec);
/*
* send a frame using existing sequence and exchange.
* Send a frame using an existing sequence and exchange.
*
* STATUS: OPTIONAL
*/
int (*seq_send)(struct fc_lport *lp, struct fc_seq *sp,
struct fc_frame *fp);
/*
* Send ELS response using mainly infomation
* in exchange and sequence in EM layer.
* Send an ELS response using infomation from a previous
* exchange and sequence.
*
* STATUS: OPTIONAL
*/
void (*seq_els_rsp_send)(struct fc_seq *sp, enum fc_els_cmd els_cmd,
struct fc_seq_els_data *els_data);
......@@ -437,6 +423,8 @@ struct libfc_function_template {
* A timer_msec can be specified for abort timeout, if non-zero
* timer_msec value is specified then exchange resp handler
* will be called with timeout error if no response to abort.
*
* STATUS: OPTIONAL
*/
int (*seq_exch_abort)(const struct fc_seq *req_sp,
unsigned int timer_msec);
......@@ -444,6 +432,8 @@ struct libfc_function_template {
/*
* Indicate that an exchange/sequence tuple is complete and the memory
* allocated for the related objects may be freed.
*
* STATUS: OPTIONAL
*/
void (*exch_done)(struct fc_seq *sp);
......@@ -451,6 +441,8 @@ struct libfc_function_template {
* Assigns a EM and a free XID for an new exchange and then
* allocates a new exchange and sequence pair.
* The fp can be used to determine free XID.
*
* STATUS: OPTIONAL
*/
struct fc_exch *(*exch_get)(struct fc_lport *lp, struct fc_frame *fp);
......@@ -458,12 +450,16 @@ struct libfc_function_template {
* Release previously assigned XID by exch_get API.
* The LLD may implement this if XID is assigned by LLD
* in exch_get().
*
* STATUS: OPTIONAL
*/
void (*exch_put)(struct fc_lport *lp, struct fc_exch_mgr *mp,
u16 ex_id);
/*
* Start a new sequence on the same exchange/sequence tuple.
*
* STATUS: OPTIONAL
*/
struct fc_seq *(*seq_start_next)(struct fc_seq *sp);
......@@ -471,26 +467,38 @@ struct libfc_function_template {
* Reset an exchange manager, completing all sequences and exchanges.
* If s_id is non-zero, reset only exchanges originating from that FID.
* If d_id is non-zero, reset only exchanges sending to that FID.
*
* STATUS: OPTIONAL
*/
void (*exch_mgr_reset)(struct fc_exch_mgr *,
void (*exch_mgr_reset)(struct fc_lport *,
u32 s_id, u32 d_id);
void (*rport_flush_queue)(void);
/**
* Local Port interfaces
/*
* Flush the rport work queue. Generally used before shutdown.
*
* STATUS: OPTIONAL
*/
void (*rport_flush_queue)(void);
/*
* Receive a frame to a local port.
* Receive a frame for a local port.
*
* STATUS: OPTIONAL
*/
void (*lport_recv)(struct fc_lport *lp, struct fc_seq *sp,
struct fc_frame *fp);
/*
* Reset the local port.
*
* STATUS: OPTIONAL
*/
int (*lport_reset)(struct fc_lport *);
/**
* Remote Port interfaces
/*
* Create a remote port
*/
struct fc_rport *(*rport_create)(struct fc_disc_port *);
/*
* Initiates the RP state machine. It is called from the LP module.
......@@ -500,26 +508,33 @@ struct libfc_function_template {
* - PLOGI
* - PRLI
* - RTV
*
* STATUS: OPTIONAL
*/
int (*rport_login)(struct fc_rport *rport);
/*
* Logoff, and remove the rport from the transport if
* it had been added. This will send a LOGO to the target.
*
* STATUS: OPTIONAL
*/
int (*rport_logoff)(struct fc_rport *rport);
/*
* Recieve a request from a remote port.
*
* STATUS: OPTIONAL
*/
void (*rport_recv_req)(struct fc_seq *, struct fc_frame *,
struct fc_rport *);
struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32);
/**
* FCP interfaces
/*
* lookup an rport by it's port ID.
*
* STATUS: OPTIONAL
*/
struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32);
/*
* Send a fcp cmd from fsp pkt.
......@@ -527,30 +542,38 @@ struct libfc_function_template {
*
* The resp handler is called when FCP_RSP received.
*
* STATUS: OPTIONAL
*/
int (*fcp_cmd_send)(struct fc_lport *lp, struct fc_fcp_pkt *fsp,
void (*resp)(struct fc_seq *, struct fc_frame *fp,
void *arg));
/*
* Used at least durring linkdown and reset
* Cleanup the FCP layer, used durring link down and reset
*
* STATUS: OPTIONAL
*/
void (*fcp_cleanup)(struct fc_lport *lp);
/*
* Abort all I/O on a local port
*
* STATUS: OPTIONAL
*/
void (*fcp_abort_io)(struct fc_lport *lp);
/**
* Discovery interfaces
/*
* Receive a request for the discovery layer.
*
* STATUS: OPTIONAL
*/
void (*disc_recv_req)(struct fc_seq *,
struct fc_frame *, struct fc_lport *);
/*
* Start discovery for a local port.
*
* STATUS: OPTIONAL
*/
void (*disc_start)(void (*disc_callback)(struct fc_lport *,
enum fc_disc_event),
......@@ -559,6 +582,8 @@ struct libfc_function_template {
/*
* Stop discovery for a given lport. This will remove
* all discovered rports
*
* STATUS: OPTIONAL
*/
void (*disc_stop) (struct fc_lport *);
......@@ -566,6 +591,8 @@ struct libfc_function_template {
* Stop discovery for a given lport. This will block
* until all discovered rports are deleted from the
* FC transport class
*
* STATUS: OPTIONAL
*/
void (*disc_stop_final) (struct fc_lport *);
};
......@@ -603,7 +630,8 @@ struct fc_lport {
/* Operational Information */
struct libfc_function_template tt;
u16 link_status;
u8 link_up;
u8 qfull;
enum fc_lport_state state;
unsigned long boot_time;
......@@ -637,7 +665,7 @@ struct fc_lport {
struct delayed_work disc_work;
};
/**
/*
* FC_LPORT HELPER FUNCTIONS
*****************************/
static inline void *lport_priv(const struct fc_lport *lp)
......@@ -669,7 +697,7 @@ static inline void fc_lport_state_enter(struct fc_lport *lp,
}
/**
/*
* LOCAL PORT LAYER
*****************************/
int fc_lport_init(struct fc_lport *lp);
......@@ -703,12 +731,6 @@ void fc_linkup(struct fc_lport *);
*/
void fc_linkdown(struct fc_lport *);
/*
* Pause and unpause traffic.
*/
void fc_pause(struct fc_lport *);
void fc_unpause(struct fc_lport *);
/*
* Configure the local port.
*/
......@@ -725,19 +747,19 @@ int fc_lport_reset(struct fc_lport *);
int fc_set_mfs(struct fc_lport *lp, u32 mfs);
/**
/*
* REMOTE PORT LAYER
*****************************/
int fc_rport_init(struct fc_lport *lp);
void fc_rport_terminate_io(struct fc_rport *rp);
/**
/*
* DISCOVERY LAYER
*****************************/
int fc_disc_init(struct fc_lport *lp);
/**
/*
* SCSI LAYER
*****************************/
/*
......@@ -798,7 +820,7 @@ int fc_change_queue_type(struct scsi_device *sdev, int tag_type);
*/
void fc_fcp_destroy(struct fc_lport *);
/**
/*
* ELS/CT interface
*****************************/
/*
......@@ -807,7 +829,7 @@ void fc_fcp_destroy(struct fc_lport *);
int fc_elsct_init(struct fc_lport *lp);
/**
/*
* EXCHANGE MANAGER LAYER
*****************************/
/*
......@@ -916,7 +938,7 @@ struct fc_seq *fc_seq_start_next(struct fc_seq *sp);
* If s_id is non-zero, reset only exchanges originating from that FID.
* If d_id is non-zero, reset only exchanges sending to that FID.
*/
void fc_exch_mgr_reset(struct fc_exch_mgr *, u32 s_id, u32 d_id);
void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id);
/*
* Functions for fc_functions_template
......
......@@ -46,6 +46,7 @@ struct fcoe_softc {
struct net_device *phys_dev; /* device with ethtool_ops */
struct packet_type fcoe_packet_type;
struct sk_buff_head fcoe_pending_queue;
u8 fcoe_pending_queue_active;
u8 dest_addr[ETH_ALEN];
u8 ctl_src_addr[ETH_ALEN];
......@@ -58,16 +59,10 @@ struct fcoe_softc {
u8 address_mode;
};
static inline struct fcoe_softc *fcoe_softc(
const struct fc_lport *lp)
{
return (struct fcoe_softc *)lport_priv(lp);
}
static inline struct net_device *fcoe_netdev(
const struct fc_lport *lp)
{
return fcoe_softc(lp)->real_dev;
return ((struct fcoe_softc *)lport_priv(lp))->real_dev;
}
static inline struct fcoe_hdr *skb_fcoe_header(const struct sk_buff *skb)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment