forked from Minki/linux
staging: unisys: visornic: Fix up existing function comments.
Refactors existing static function comments to increase code readability. Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3459e83a14
commit
1ce0a9bca4
@ -233,17 +233,15 @@ static u16 add_physinfo_entries(u64 inp_pfn, u16 inp_off, u16 inp_len,
|
|||||||
return index + i;
|
return index + i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visor_copy_fragsinfo_from_skb - copy fragment list in the SKB to a phys_info
|
||||||
* visor_copy_fragsinfo_from_skb(
|
* array that the IOPART understands
|
||||||
* @skb_in: skbuff that we are pulling the frags from
|
* @skb: Skbuff that we are pulling the frags from.
|
||||||
* @firstfraglen: length of first fragment in skb
|
* @firstfraglen: Length of first fragment in skb.
|
||||||
* @frags_max: max len of frags array
|
* @frags_max: Max len of frags array.
|
||||||
* @frags: frags array filled in on output
|
* @frags: Frags array filled in on output.
|
||||||
*
|
*
|
||||||
* Copy the fragment list in the SKB to a phys_info
|
* Return: Positive integer indicating number of entries filled in frags on
|
||||||
* array that the IOPART understands.
|
* success, negative integer on error.
|
||||||
* Return value indicates number of entries filled in frags
|
|
||||||
* Negative values indicate an error.
|
|
||||||
*/
|
*/
|
||||||
static int visor_copy_fragsinfo_from_skb(struct sk_buff *skb,
|
static int visor_copy_fragsinfo_from_skb(struct sk_buff *skb,
|
||||||
unsigned int firstfraglen,
|
unsigned int firstfraglen,
|
||||||
@ -341,14 +339,11 @@ static const struct file_operations debugfs_enable_ints_fops = {
|
|||||||
.write = enable_ints_write,
|
.write = enable_ints_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/* visornic_serverdown_complete - pause device following IOPART going down
|
||||||
* visornic_serverdown_complete - IOPART went down, pause device
|
* @devdata: Device managed by IOPART.
|
||||||
* @work: Work queue it was scheduled on
|
|
||||||
*
|
*
|
||||||
* The IO partition has gone down and we need to do some cleanup
|
* The IO partition has gone down, and we need to do some cleanup for when it
|
||||||
* for when it comes back. Treat the IO partition as the link
|
* comes back. Treat the IO partition as the link being down.
|
||||||
* being down.
|
|
||||||
* Returns void.
|
|
||||||
*/
|
*/
|
||||||
static void visornic_serverdown_complete(struct visornic_devdata *devdata)
|
static void visornic_serverdown_complete(struct visornic_devdata *devdata)
|
||||||
{
|
{
|
||||||
@ -373,13 +368,14 @@ static void visornic_serverdown_complete(struct visornic_devdata *devdata)
|
|||||||
devdata->server_down_complete_func = NULL;
|
devdata->server_down_complete_func = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_serverdown - Command has notified us that IOPART is down
|
||||||
* visornic_serverdown - Command has notified us that IOPART is down
|
* @devdata: Device managed by IOPART.
|
||||||
* @devdata: device that is being managed by IOPART
|
* @complete_func: Function to call when finished.
|
||||||
*
|
*
|
||||||
* Schedule the work needed to handle the server down request. Make
|
* Schedule the work needed to handle the server down request. Make sure we
|
||||||
* sure we haven't already handled the server change state event.
|
* haven't already handled the server change state event.
|
||||||
* Returns 0 if we scheduled the work, -EINVAL on error.
|
*
|
||||||
|
* Return: 0 if we scheduled the work, negative integer on error.
|
||||||
*/
|
*/
|
||||||
static int visornic_serverdown(struct visornic_devdata *devdata,
|
static int visornic_serverdown(struct visornic_devdata *devdata,
|
||||||
visorbus_state_complete_func complete_func)
|
visorbus_state_complete_func complete_func)
|
||||||
@ -419,13 +415,13 @@ err_unlock:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* alloc_rcv_buf - alloc rcv buffer to be given to the IO Partition
|
||||||
* alloc_rcv_buf - alloc rcv buffer to be given to the IO Partition.
|
* @netdev: Network adapter the rcv bufs are attached too.
|
||||||
* @netdev: network adapter the rcv bufs are attached too.
|
|
||||||
*
|
*
|
||||||
* Create an sk_buff (rcv_buf) that will be passed to the IO Partition
|
* Create an sk_buff (rcv_buf) that will be passed to the IO Partition
|
||||||
* so that it can write rcv data into our memory space.
|
* so that it can write rcv data into our memory space.
|
||||||
* Return pointer to sk_buff
|
*
|
||||||
|
* Return: Pointer to sk_buff.
|
||||||
*/
|
*/
|
||||||
static struct sk_buff *alloc_rcv_buf(struct net_device *netdev)
|
static struct sk_buff *alloc_rcv_buf(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
@ -449,14 +445,12 @@ static struct sk_buff *alloc_rcv_buf(struct net_device *netdev)
|
|||||||
return skb;
|
return skb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* post_skb - post a skb to the IO Partition
|
||||||
* post_skb - post a skb to the IO Partition.
|
* @cmdrsp: Cmdrsp packet to be send to the IO Partition.
|
||||||
* @cmdrsp: cmdrsp packet to be send to the IO Partition
|
* @devdata: visornic_devdata to post the skb to.
|
||||||
* @devdata: visornic_devdata to post the skb too
|
* @skb: Skb to give to the IO partition.
|
||||||
* @skb: skb to give to the IO partition
|
|
||||||
*
|
*
|
||||||
* Send the skb to the IO Partition.
|
* Return: 0 on success, negative integer on error.
|
||||||
* Returns 0 or error
|
|
||||||
*/
|
*/
|
||||||
static int post_skb(struct uiscmdrsp *cmdrsp, struct visornic_devdata *devdata,
|
static int post_skb(struct uiscmdrsp *cmdrsp, struct visornic_devdata *devdata,
|
||||||
struct sk_buff *skb)
|
struct sk_buff *skb)
|
||||||
@ -488,15 +482,14 @@ static int post_skb(struct uiscmdrsp *cmdrsp, struct visornic_devdata *devdata,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* send_enbdis - Send NET_RCV_ENBDIS to IO Partition
|
||||||
* send_enbdis - send NET_RCV_ENBDIS to IO Partition
|
* @netdev: Netdevice we are enabling/disabling, used as context return value.
|
||||||
* @netdev: netdevice we are enable/disable, used as context
|
* @state: Enable = 1/disable = 0.
|
||||||
* return value
|
* @devdata: Visornic device we are enabling/disabling.
|
||||||
* @state: enable = 1/disable = 0
|
|
||||||
* @devdata: visornic device we are enabling/disabling
|
|
||||||
*
|
*
|
||||||
* Send the enable/disable message to the IO Partition.
|
* Send the enable/disable message to the IO Partition.
|
||||||
* Returns 0 or error
|
*
|
||||||
|
* Return: 0 on success, negative integer on error.
|
||||||
*/
|
*/
|
||||||
static int send_enbdis(struct net_device *netdev, int state,
|
static int send_enbdis(struct net_device *netdev, int state,
|
||||||
struct visornic_devdata *devdata)
|
struct visornic_devdata *devdata)
|
||||||
@ -516,15 +509,14 @@ static int send_enbdis(struct net_device *netdev, int state,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_disable_with_timeout - disable network adapter
|
||||||
* visornic_disable_with_timeout - Disable network adapter
|
* @netdev: netdevice to disable.
|
||||||
* @netdev: netdevice to disable
|
* @timeout: Timeout to wait for disable.
|
||||||
* @timeout: timeout to wait for disable
|
|
||||||
*
|
*
|
||||||
* Disable the network adapter and inform the IO Partition that we
|
* Disable the network adapter and inform the IO Partition that we are disabled.
|
||||||
* are disabled, reclaim memory from rcv bufs.
|
* Reclaim memory from rcv bufs.
|
||||||
* Returns 0 on success, negative for failure of IO Partition
|
*
|
||||||
* responding.
|
* Return: 0 on success, negative integer on failure of IO Partition responding.
|
||||||
*/
|
*/
|
||||||
static int visornic_disable_with_timeout(struct net_device *netdev,
|
static int visornic_disable_with_timeout(struct net_device *netdev,
|
||||||
const int timeout)
|
const int timeout)
|
||||||
@ -606,13 +598,13 @@ static int visornic_disable_with_timeout(struct net_device *netdev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* init_rcv_bufs - initialize receive buffs and send them to the IO Partition
|
||||||
* init_rcv_bufs -- initialize receive bufs and send them to the IO Part
|
* @netdev: struct netdevice.
|
||||||
* @netdev: struct netdevice
|
* @devdata: visornic_devdata.
|
||||||
* @devdata: visornic_devdata
|
|
||||||
*
|
*
|
||||||
* Allocate rcv buffers and post them to the IO Partition.
|
* Allocate rcv buffers and post them to the IO Partition.
|
||||||
* Return 0 for success, and negative for failure.
|
*
|
||||||
|
* Return: 0 on success, negative integer on failure.
|
||||||
*/
|
*/
|
||||||
static int init_rcv_bufs(struct net_device *netdev,
|
static int init_rcv_bufs(struct net_device *netdev,
|
||||||
struct visornic_devdata *devdata)
|
struct visornic_devdata *devdata)
|
||||||
@ -672,14 +664,14 @@ static int init_rcv_bufs(struct net_device *netdev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_enable_with_timeout - send enable to IO Partition
|
||||||
* visornic_enable_with_timeout - send enable to IO Part
|
* @netdev: struct net_device.
|
||||||
* @netdev: struct net_device
|
* @timeout: Time to wait for the ACK from the enable.
|
||||||
* @timeout: Time to wait for the ACK from the enable
|
|
||||||
*
|
*
|
||||||
* Sends enable to IOVM, inits, and posts receive buffers to IOVM
|
* Sends enable to IOVM and inits, and posts receive buffers to IOVM. Timeout is
|
||||||
* timeout is defined in msecs (timeout of 0 specifies infinite wait)
|
* defined in msecs (timeout of 0 specifies infinite wait).
|
||||||
* Return 0 for success, negative for failure.
|
*
|
||||||
|
* Return: 0 on success, negative integer on failure.
|
||||||
*/
|
*/
|
||||||
static int visornic_enable_with_timeout(struct net_device *netdev,
|
static int visornic_enable_with_timeout(struct net_device *netdev,
|
||||||
const int timeout)
|
const int timeout)
|
||||||
@ -746,13 +738,12 @@ static int visornic_enable_with_timeout(struct net_device *netdev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_timeout_reset - handle xmit timeout resets
|
||||||
* visornic_timeout_reset - handle xmit timeout resets
|
* @work: Work item that scheduled the work.
|
||||||
* @work work item that scheduled the work
|
|
||||||
*
|
*
|
||||||
* Transmit Timeouts are typically handled by resetting the
|
* Transmit timeouts are typically handled by resetting the device for our
|
||||||
* device for our virtual NIC we will send a Disable and Enable
|
* virtual NIC; we will send a disable and enable to the IOVM. If it doesn't
|
||||||
* to the IOVM. If it doesn't respond we will trigger a serverdown.
|
* respond, we will trigger a serverdown.
|
||||||
*/
|
*/
|
||||||
static void visornic_timeout_reset(struct work_struct *work)
|
static void visornic_timeout_reset(struct work_struct *work)
|
||||||
{
|
{
|
||||||
@ -788,12 +779,12 @@ call_serverdown:
|
|||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_open - enable the visornic device and mark the queue started
|
||||||
* visornic_open - Enable the visornic device and mark the queue started
|
* @netdev: netdevice to start.
|
||||||
* @netdev: netdevice to start
|
|
||||||
*
|
*
|
||||||
* Enable the device and start the transmit queue.
|
* Enable the device and start the transmit queue.
|
||||||
* Return 0 for success
|
*
|
||||||
|
* Return: 0 on success.
|
||||||
*/
|
*/
|
||||||
static int visornic_open(struct net_device *netdev)
|
static int visornic_open(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
@ -801,12 +792,12 @@ static int visornic_open(struct net_device *netdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_close - disables the visornic device and stops the queues
|
||||||
* visornic_close - Disables the visornic device and stops the queues
|
* @netdev: netdevice to stop.
|
||||||
* @netdev: netdevice to start
|
|
||||||
*
|
*
|
||||||
* Disable the device and stop the transmit queue.
|
* Disable the device and stop the transmit queue.
|
||||||
* Return 0 for success
|
*
|
||||||
|
* Return 0 on success.
|
||||||
*/
|
*/
|
||||||
static int visornic_close(struct net_device *netdev)
|
static int visornic_close(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
@ -814,11 +805,10 @@ static int visornic_close(struct net_device *netdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* devdata_xmits_outstanding - compute outstanding xmits
|
||||||
* devdata_xmits_outstanding - compute outstanding xmits
|
* @devdata: visornic_devdata for device
|
||||||
* @devdata: visornic_devdata for device
|
|
||||||
*
|
*
|
||||||
* Return value is the number of outstanding xmits.
|
* Return: Long integer representing the number of outstanding xmits.
|
||||||
*/
|
*/
|
||||||
static unsigned long devdata_xmits_outstanding(struct visornic_devdata *devdata)
|
static unsigned long devdata_xmits_outstanding(struct visornic_devdata *devdata)
|
||||||
{
|
{
|
||||||
@ -829,14 +819,13 @@ static unsigned long devdata_xmits_outstanding(struct visornic_devdata *devdata)
|
|||||||
+ devdata->chstat.sent_xmit + 1);
|
+ devdata->chstat.sent_xmit + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* vnic_hit_high_watermark
|
||||||
* vnic_hit_high_watermark
|
* @devdata: Indicates visornic device we are checking.
|
||||||
* @devdata: indicates visornic device we are checking
|
* @high_watermark: Max num of unacked xmits we will tolerate before we will
|
||||||
* @high_watermark: max num of unacked xmits we will tolerate,
|
* start throttling.
|
||||||
* before we will start throttling
|
|
||||||
*
|
*
|
||||||
* Returns true iff the number of unacked xmits sent to
|
* Return: True iff the number of unacked xmits sent to the IO Partition is >=
|
||||||
* the IO partition is >= high_watermark.
|
* high_watermark. False otherwise.
|
||||||
*/
|
*/
|
||||||
static bool vnic_hit_high_watermark(struct visornic_devdata *devdata,
|
static bool vnic_hit_high_watermark(struct visornic_devdata *devdata,
|
||||||
ulong high_watermark)
|
ulong high_watermark)
|
||||||
@ -844,15 +833,13 @@ static bool vnic_hit_high_watermark(struct visornic_devdata *devdata,
|
|||||||
return (devdata_xmits_outstanding(devdata) >= high_watermark);
|
return (devdata_xmits_outstanding(devdata) >= high_watermark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* vnic_hit_low_watermark
|
||||||
* vnic_hit_low_watermark
|
* @devdata: Indicates visornic device we are checking.
|
||||||
* @devdata: indicates visornic device we are checking
|
* @low_watermark: We will wait until the num of unacked xmits drops to this
|
||||||
* @low_watermark: we will wait until the num of unacked xmits
|
* value or lower before we start transmitting again.
|
||||||
* drops to this value or lower before we start
|
|
||||||
* transmitting again
|
|
||||||
*
|
*
|
||||||
* Returns true iff the number of unacked xmits sent to
|
* Return: True iff the number of unacked xmits sent to the IO Partition is <=
|
||||||
* the IO partition is <= low_watermark.
|
* low_watermark.
|
||||||
*/
|
*/
|
||||||
static bool vnic_hit_low_watermark(struct visornic_devdata *devdata,
|
static bool vnic_hit_low_watermark(struct visornic_devdata *devdata,
|
||||||
ulong low_watermark)
|
ulong low_watermark)
|
||||||
@ -860,17 +847,16 @@ static bool vnic_hit_low_watermark(struct visornic_devdata *devdata,
|
|||||||
return (devdata_xmits_outstanding(devdata) <= low_watermark);
|
return (devdata_xmits_outstanding(devdata) <= low_watermark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_xmit - send a packet to the IO Partition
|
||||||
* visornic_xmit - send a packet to the IO Partition
|
* @skb: Packet to be sent.
|
||||||
* @skb: Packet to be sent
|
* @netdev: Net device the packet is being sent from.
|
||||||
* @netdev: net device the packet is being sent from
|
|
||||||
*
|
*
|
||||||
* Convert the skb to a cmdrsp so the IO Partition can understand it.
|
* Convert the skb to a cmdrsp so the IO Partition can understand it, and send
|
||||||
* Send the XMIT command to the IO Partition for processing. This
|
* the XMIT command to the IO Partition for processing. This function is
|
||||||
* function is protected from concurrent calls by a spinlock xmit_lock
|
* protected from concurrent calls by a spinlock xmit_lock in the net_device
|
||||||
* in the net_device struct, but as soon as the function returns it
|
* struct. As soon as the function returns, it can be called again.
|
||||||
* can be called again.
|
*
|
||||||
* Returns NETDEV_TX_OK.
|
* Return: NETDEV_TX_OK.
|
||||||
*/
|
*/
|
||||||
static int visornic_xmit(struct sk_buff *skb, struct net_device *netdev)
|
static int visornic_xmit(struct sk_buff *skb, struct net_device *netdev)
|
||||||
{
|
{
|
||||||
@ -1033,11 +1019,10 @@ static int visornic_xmit(struct sk_buff *skb, struct net_device *netdev)
|
|||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_get_stats - returns net_stats of the visornic device
|
||||||
* visornic_get_stats - returns net_stats of the visornic device
|
* @netdev: netdevice.
|
||||||
* @netdev: netdevice
|
|
||||||
*
|
*
|
||||||
* Returns the net_device_stats for the device
|
* Return: Pointer to the net_device_stats struct for the device.
|
||||||
*/
|
*/
|
||||||
static struct net_device_stats *visornic_get_stats(struct net_device *netdev)
|
static struct net_device_stats *visornic_get_stats(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
@ -1046,28 +1031,25 @@ static struct net_device_stats *visornic_get_stats(struct net_device *netdev)
|
|||||||
return &devdata->net_stats;
|
return &devdata->net_stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_change_mtu - changes mtu of device
|
||||||
* visornic_change_mtu - changes mtu of device.
|
* @netdev: netdevice.
|
||||||
* @netdev: netdevice
|
* @new_mtu: Value of new mtu.
|
||||||
* @new_mtu: value of new mtu
|
|
||||||
*
|
*
|
||||||
* MTU cannot be changed by system, must be changed via
|
* The device's MTU cannot be changed by system; it must be changed via a
|
||||||
* CONTROLVM message. All vnics and pnics in a switch have
|
* CONTROLVM message. All vnics and pnics in a switch have to have the same MTU
|
||||||
* to have the same MTU for everything to work.
|
* for everything to work. Currently not supported.
|
||||||
* Currently not supported.
|
*
|
||||||
* Returns EINVAL
|
* Return: -EINVAL.
|
||||||
*/
|
*/
|
||||||
static int visornic_change_mtu(struct net_device *netdev, int new_mtu)
|
static int visornic_change_mtu(struct net_device *netdev, int new_mtu)
|
||||||
{
|
{
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_set_multi - set visornic device flags
|
||||||
* visornic_set_multi - changes mtu of device.
|
* @netdev: netdevice.
|
||||||
* @netdev: netdevice
|
|
||||||
*
|
*
|
||||||
* Only flag we support currently is IFF_PROMISC
|
* The only flag we currently support is IFF_PROMISC.
|
||||||
* Returns void
|
|
||||||
*/
|
*/
|
||||||
static void visornic_set_multi(struct net_device *netdev)
|
static void visornic_set_multi(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
@ -1101,13 +1083,11 @@ out_save_flags:
|
|||||||
devdata->old_flags = netdev->flags;
|
devdata->old_flags = netdev->flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_xmit_timeout - request to timeout the xmit
|
||||||
* visornic_xmit_timeout - request to timeout the xmit
|
* @netdev: netdevice.
|
||||||
* @netdev
|
|
||||||
*
|
*
|
||||||
* Queue the work and return. Make sure we have not already
|
* Queue the work and return. Make sure we have not already been informed that
|
||||||
* been informed the IO Partition is gone, if it is gone
|
* the IO Partition is gone; if so, we will have already timed-out the xmits.
|
||||||
* we will already timeout the xmits.
|
|
||||||
*/
|
*/
|
||||||
static void visornic_xmit_timeout(struct net_device *netdev)
|
static void visornic_xmit_timeout(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
@ -1135,16 +1115,16 @@ static void visornic_xmit_timeout(struct net_device *netdev)
|
|||||||
spin_unlock_irqrestore(&devdata->priv_lock, flags);
|
spin_unlock_irqrestore(&devdata->priv_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* repost_return - repost rcv bufs that have come back
|
||||||
* repost_return - repost rcv bufs that have come back
|
* @cmdrsp: IO channel command struct to post.
|
||||||
* @cmdrsp: io channel command struct to post
|
* @devdata: Visornic devdata for the device.
|
||||||
* @devdata: visornic devdata for the device
|
* @skb: Socket buffer.
|
||||||
* @skb: skb
|
* @netdev: netdevice.
|
||||||
* @netdev: netdevice
|
|
||||||
*
|
*
|
||||||
* Repost rcv buffers that have been returned to us when
|
* Repost rcv buffers that have been returned to us when we are finished
|
||||||
* we are finished with them.
|
* with them.
|
||||||
* Returns 0 for success, -1 for error.
|
*
|
||||||
|
* Return: 0 for success, negative integer on error.
|
||||||
*/
|
*/
|
||||||
static int repost_return(struct uiscmdrsp *cmdrsp,
|
static int repost_return(struct uiscmdrsp *cmdrsp,
|
||||||
struct visornic_devdata *devdata,
|
struct visornic_devdata *devdata,
|
||||||
@ -1212,13 +1192,13 @@ static int repost_return(struct uiscmdrsp *cmdrsp,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_rx - handle receive packets coming back from IO Partition
|
||||||
* visornic_rx - Handle receive packets coming back from IO Part
|
* @cmdrsp: Receive packet returned from IO Partition.
|
||||||
* @cmdrsp: Receive packet returned from IO Part
|
|
||||||
*
|
*
|
||||||
* Got a receive packet back from the IO Part, handle it and send
|
* Got a receive packet back from the IO Partition; handle it and send it up
|
||||||
* it up the stack.
|
* the stack.
|
||||||
* Returns 1 iff an skb was received, otherwise 0
|
|
||||||
|
* Return: 1 iff an skb was received, otherwise 0.
|
||||||
*/
|
*/
|
||||||
static int visornic_rx(struct uiscmdrsp *cmdrsp)
|
static int visornic_rx(struct uiscmdrsp *cmdrsp)
|
||||||
{
|
{
|
||||||
@ -1416,14 +1396,13 @@ static int visornic_rx(struct uiscmdrsp *cmdrsp)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* devdata_initialize - initialize devdata structure
|
||||||
* devdata_initialize - Initialize devdata structure
|
* @devdata: visornic_devdata structure to initialize.
|
||||||
* @devdata: visornic_devdata structure to initialize
|
* @dev: visorbus_device it belongs to.
|
||||||
* #dev: visorbus_deviced it belongs to
|
|
||||||
*
|
*
|
||||||
* Setup initial values for the visornic based on channel and default
|
* Setup initial values for the visornic, based on channel and default values.
|
||||||
* values.
|
*
|
||||||
* Returns a pointer to the devdata structure
|
* Return: A pointer to the devdata structure.
|
||||||
*/
|
*/
|
||||||
static struct visornic_devdata *devdata_initialize(
|
static struct visornic_devdata *devdata_initialize(
|
||||||
struct visornic_devdata *devdata,
|
struct visornic_devdata *devdata,
|
||||||
@ -1434,12 +1413,8 @@ static struct visornic_devdata *devdata_initialize(
|
|||||||
return devdata;
|
return devdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* devdata_release - free up references in devdata
|
||||||
* devdata_release - Frees up references in devdata
|
* @devdata: Struct to clean up.
|
||||||
* @devdata: struct to clean up
|
|
||||||
*
|
|
||||||
* Frees up references in devdata.
|
|
||||||
* Returns void
|
|
||||||
*/
|
*/
|
||||||
static void devdata_release(struct visornic_devdata *devdata)
|
static void devdata_release(struct visornic_devdata *devdata)
|
||||||
{
|
{
|
||||||
@ -1611,12 +1586,10 @@ static const struct file_operations debugfs_info_fops = {
|
|||||||
.read = info_debugfs_read,
|
.read = info_debugfs_read,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/* send_rcv_posts_if_needed - send receive buffers to the IO Partition.
|
||||||
* send_rcv_posts_if_needed
|
* @devdata: Visornic device.
|
||||||
* @devdata: visornic device
|
|
||||||
*
|
*
|
||||||
* Send receive buffers to the IO Partition.
|
* Return: 0.
|
||||||
* Returns void
|
|
||||||
*/
|
*/
|
||||||
static int send_rcv_posts_if_needed(struct visornic_devdata *devdata)
|
static int send_rcv_posts_if_needed(struct visornic_devdata *devdata)
|
||||||
{
|
{
|
||||||
@ -1660,10 +1633,9 @@ static int send_rcv_posts_if_needed(struct visornic_devdata *devdata)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* drain_resp_queue - drains and ignores all messages from the resp queue
|
||||||
* drain_resp_queue - drains and ignores all messages from the resp queue
|
* @cmdrsp: IO channel command response message.
|
||||||
* @cmdrsp: io channel command response message
|
* @devdata: Visornic device to drain.
|
||||||
* @devdata: visornic device to drain
|
|
||||||
*/
|
*/
|
||||||
static void drain_resp_queue(struct uiscmdrsp *cmdrsp,
|
static void drain_resp_queue(struct uiscmdrsp *cmdrsp,
|
||||||
struct visornic_devdata *devdata)
|
struct visornic_devdata *devdata)
|
||||||
@ -1674,14 +1646,14 @@ static void drain_resp_queue(struct uiscmdrsp *cmdrsp,
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* service_resp_queue - drain the response queue
|
||||||
* service_resp_queue - drains the response queue
|
* @cmdrsp: IO channel command response message.
|
||||||
* @cmdrsp: io channel command response message
|
* @devdata: Visornic device to drain.
|
||||||
* @devdata: visornic device to drain
|
* @rx_work_done:
|
||||||
|
* @budget:
|
||||||
*
|
*
|
||||||
* Drain the response queue of any responses from the IO partition.
|
* Drain the response queue of any responses from the IO Partition. Process the
|
||||||
* Process the responses as we get them.
|
* responses as we get them.
|
||||||
* Returns when response queue is empty or when the thread stops.
|
|
||||||
*/
|
*/
|
||||||
static void service_resp_queue(struct uiscmdrsp *cmdrsp,
|
static void service_resp_queue(struct uiscmdrsp *cmdrsp,
|
||||||
struct visornic_devdata *devdata,
|
struct visornic_devdata *devdata,
|
||||||
@ -1796,13 +1768,11 @@ static int visornic_poll(struct napi_struct *napi, int budget)
|
|||||||
return rx_count;
|
return rx_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* poll_for_irq - checks the status of the response queue
|
||||||
* poll_for_irq - Checks the status of the response queue.
|
* @v: Void pointer to the visronic devdata struct.
|
||||||
* @v: void pointer to the visronic devdata
|
|
||||||
*
|
*
|
||||||
* Main function of the vnic_incoming thread. Periodically check the
|
* Main function of the vnic_incoming thread. Periodically check the response
|
||||||
* response queue and drain it if needed.
|
* queue and drain it if needed.
|
||||||
* Returns when thread has stopped.
|
|
||||||
*/
|
*/
|
||||||
static void poll_for_irq(unsigned long v)
|
static void poll_for_irq(unsigned long v)
|
||||||
{
|
{
|
||||||
@ -1818,13 +1788,13 @@ static void poll_for_irq(unsigned long v)
|
|||||||
mod_timer(&devdata->irq_poll_timer, msecs_to_jiffies(2));
|
mod_timer(&devdata->irq_poll_timer, msecs_to_jiffies(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_probe - probe function for visornic devices
|
||||||
* visornic_probe - probe function for visornic devices
|
* @dev: The visor device discovered.
|
||||||
* @dev: The visor device discovered
|
|
||||||
*
|
*
|
||||||
* Called when visorbus discovers a visornic device on its
|
* Called when visorbus discovers a visornic device on its bus. It creates a new
|
||||||
* bus. It creates a new visornic ethernet adapter.
|
* visornic ethernet adapter.
|
||||||
* Returns 0 or negative for error.
|
*
|
||||||
|
* Return: 0 on success, or negative integer on error.
|
||||||
*/
|
*/
|
||||||
static int visornic_probe(struct visor_device *dev)
|
static int visornic_probe(struct visor_device *dev)
|
||||||
{
|
{
|
||||||
@ -2013,12 +1983,10 @@ cleanup_netdev:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* host_side_disappeared - IO Partition is gone
|
||||||
* host_side_disappeared - IO part is gone.
|
* @devdata: Device object.
|
||||||
* @devdata: device object
|
|
||||||
*
|
*
|
||||||
* IO partition servicing this device is gone, do cleanup
|
* IO partition servicing this device is gone; do cleanup.
|
||||||
* Returns void.
|
|
||||||
*/
|
*/
|
||||||
static void host_side_disappeared(struct visornic_devdata *devdata)
|
static void host_side_disappeared(struct visornic_devdata *devdata)
|
||||||
{
|
{
|
||||||
@ -2030,12 +1998,10 @@ static void host_side_disappeared(struct visornic_devdata *devdata)
|
|||||||
spin_unlock_irqrestore(&devdata->priv_lock, flags);
|
spin_unlock_irqrestore(&devdata->priv_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_remove - called when visornic dev goes away
|
||||||
* visornic_remove - Called when visornic dev goes away
|
* @dev: Visornic device that is being removed.
|
||||||
* @dev: visornic device that is being removed
|
|
||||||
*
|
*
|
||||||
* Called when DEVICE_DESTROY gets called to remove device.
|
* Called when DEVICE_DESTROY gets called to remove device.
|
||||||
* Returns void
|
|
||||||
*/
|
*/
|
||||||
static void visornic_remove(struct visor_device *dev)
|
static void visornic_remove(struct visor_device *dev)
|
||||||
{
|
{
|
||||||
@ -2077,18 +2043,17 @@ static void visornic_remove(struct visor_device *dev)
|
|||||||
free_netdev(netdev);
|
free_netdev(netdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_pause - called when IO Part disappears
|
||||||
* visornic_pause - Called when IO Part disappears
|
* @dev: Visornic device that is being serviced.
|
||||||
* @dev: visornic device that is being serviced
|
* @complete_func: Call when finished.
|
||||||
* @complete_func: call when finished.
|
|
||||||
*
|
*
|
||||||
* Called when the IO Partition has gone down. Need to free
|
* Called when the IO Partition has gone down. Need to free up resources and
|
||||||
* up resources and wait for IO partition to come back. Mark
|
* wait for IO partition to come back. Mark link as down and don't attempt any
|
||||||
* link as down and don't attempt any DMA. When we have freed
|
* DMA. When we have freed memory, call the complete_func so that Command knows
|
||||||
* memory call the complete_func so that Command knows we are
|
* we are done. If we don't call complete_func, the IO Partition will never
|
||||||
* done. If we don't call complete_func, IO part will never
|
* come back.
|
||||||
* come back.
|
*
|
||||||
* Returns 0 for success.
|
* Return: 0 on success.
|
||||||
*/
|
*/
|
||||||
static int visornic_pause(struct visor_device *dev,
|
static int visornic_pause(struct visor_device *dev,
|
||||||
visorbus_state_complete_func complete_func)
|
visorbus_state_complete_func complete_func)
|
||||||
@ -2099,15 +2064,14 @@ static int visornic_pause(struct visor_device *dev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_resume - called when IO Partition has recovered
|
||||||
* visornic_resume - Called when IO part has recovered
|
* @dev: Visornic device that is being serviced.
|
||||||
* @dev: visornic device that is being serviced
|
* @compelte_func: Call when finished.
|
||||||
* @compelte_func: call when finished
|
|
||||||
*
|
*
|
||||||
* Called when the IO partition has recovered. Reestablish
|
* Called when the IO partition has recovered. Re-establish connection to the IO
|
||||||
* connection to the IO part and set the link up. Okay to do
|
* Partition and set the link up. Okay to do DMA again.
|
||||||
* DMA again.
|
*
|
||||||
* Returns 0 for success.
|
* Returns 0 for success, negative integer on error.
|
||||||
*/
|
*/
|
||||||
static int visornic_resume(struct visor_device *dev,
|
static int visornic_resume(struct visor_device *dev,
|
||||||
visorbus_state_complete_func complete_func)
|
visorbus_state_complete_func complete_func)
|
||||||
@ -2169,12 +2133,12 @@ static struct visor_driver visornic_driver = {
|
|||||||
.channel_interrupt = NULL,
|
.channel_interrupt = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/* visornic_init - init function
|
||||||
* visornic_init - Init function
|
|
||||||
*
|
*
|
||||||
* Init function for the visornic driver. Do initial driver setup
|
* Init function for the visornic driver. Do initial driver setup and wait
|
||||||
* and wait for devices.
|
* for devices.
|
||||||
* Returns 0 for success, negative for error.
|
*
|
||||||
|
* Return: 0 on success, negative integer on error.
|
||||||
*/
|
*/
|
||||||
static int visornic_init(void)
|
static int visornic_init(void)
|
||||||
{
|
{
|
||||||
@ -2205,10 +2169,9 @@ cleanup_debugfs:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* visornic_cleanup - driver exit routine
|
||||||
* visornic_cleanup - driver exit routine
|
|
||||||
*
|
*
|
||||||
* Unregister driver from the bus and free up memory.
|
* Unregister driver from the bus and free up memory.
|
||||||
*/
|
*/
|
||||||
static void visornic_cleanup(void)
|
static void visornic_cleanup(void)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user