Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixe…
Browse files Browse the repository at this point in the history
…s-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()
  ...
  • Loading branch information
Linus Torvalds committed Mar 14, 2009
2 parents 37e79a4 + 5fa0ae1 commit 228b5b7
Show file tree
Hide file tree
Showing 19 changed files with 586 additions and 631 deletions.
91 changes: 44 additions & 47 deletions drivers/scsi/fcoe/fc_transport_fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;

Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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;
Expand All @@ -175,18 +174,18 @@ 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)
struct net_device *netdev)
{
/* match transport by vendor and device id */
struct pci_dev *pci;
Expand All @@ -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;

Expand All @@ -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;
Expand All @@ -259,21 +258,18 @@ 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;
}
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;
Expand All @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
Loading

0 comments on commit 228b5b7

Please sign in to comment.