Commit da3ab48b authored by Kelley Nielsen's avatar Kelley Nielsen Committed by Greg Kroah-Hartman

staging: ft1000: remove formal function headers from ft1000_hw.c

The file ft1000_hw.c contains formal C99 style function headers that
waste space and convey little to no useful information. This patch
converts the headers to either one line standard /* */ style comments
or shorter standard style headers with parameter lists (if the parameter
list seemed helpful), or eliminates them entirely. Besides needing to be
made of its own accord, this change is in preparation to eliminate the
nonstandard STATUS_* #defines from the driver since they were cited in most
of the headers.
Signed-off-by: default avatarKelley Nielsen <kelleynnn@gmail.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 547b5b22
//===================================================== /* CopyRight (C) 2007 Qualcomm Inc. All Rights Reserved.
// CopyRight (C) 2007 Qualcomm Inc. All Rights Reserved. *
// *
// * This file is part of Express Card USB Driver
// This file is part of Express Card USB Driver */
//
// $Id:
//====================================================
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -35,27 +33,17 @@ static u8 tempbuffer[1600]; ...@@ -35,27 +33,17 @@ static u8 tempbuffer[1600];
#define MAX_RCV_LOOP 100 #define MAX_RCV_LOOP 100
//--------------------------------------------------------------------------- /* send a control message via USB interface synchronously
// Function: ft1000_control * Parameters: ft1000_usb - device structure
// * pipe - usb control message pipe
// Parameters: ft1000_usb - device structure * request - control request
// pipe - usb control message pipe * requesttype - control message request type
// request - control request * value - value to be written or 0
// requesttype - control message request type * index - register index
// value - value to be written or 0 * data - data buffer to hold the read/write values
// index - register index * size - data size
// data - data buffer to hold the read/write values * timeout - control message time out value
// size - data size */
// timeout - control message time out value
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function sends a control message via USB interface synchronously
//
// Notes:
//
//---------------------------------------------------------------------------
static int ft1000_control(struct ft1000_usb *ft1000dev, unsigned int pipe, static int ft1000_control(struct ft1000_usb *ft1000dev, unsigned int pipe,
u8 request, u8 requesttype, u16 value, u16 index, u8 request, u8 requesttype, u16 value, u16 index,
void *data, u16 size, int timeout) void *data, u16 size, int timeout)
...@@ -76,22 +64,7 @@ static int ft1000_control(struct ft1000_usb *ft1000dev, unsigned int pipe, ...@@ -76,22 +64,7 @@ static int ft1000_control(struct ft1000_usb *ft1000dev, unsigned int pipe,
return ret; return ret;
} }
//--------------------------------------------------------------------------- /* returns the value in a register */
// Function: ft1000_read_register
//
// Parameters: ft1000_usb - device structure
// Data - data buffer to hold the value read
// nRegIndex - register index
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function returns the value in a register
//
// Notes:
//
//---------------------------------------------------------------------------
int ft1000_read_register(struct ft1000_usb *ft1000dev, u16* Data, int ft1000_read_register(struct ft1000_usb *ft1000dev, u16* Data,
u16 nRegIndx) u16 nRegIndx)
{ {
...@@ -110,21 +83,7 @@ int ft1000_read_register(struct ft1000_usb *ft1000dev, u16* Data, ...@@ -110,21 +83,7 @@ int ft1000_read_register(struct ft1000_usb *ft1000dev, u16* Data,
return ret; return ret;
} }
//--------------------------------------------------------------------------- /* writes the value in a register */
// Function: ft1000_write_register
//
// Parameters: ft1000_usb - device structure
// value - value to write into a register
// nRegIndex - register index
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function writes the value in a register
//
// Notes:
//
//---------------------------------------------------------------------------
int ft1000_write_register(struct ft1000_usb *ft1000dev, u16 value, int ft1000_write_register(struct ft1000_usb *ft1000dev, u16 value,
u16 nRegIndx) u16 nRegIndx)
{ {
...@@ -143,23 +102,7 @@ int ft1000_write_register(struct ft1000_usb *ft1000dev, u16 value, ...@@ -143,23 +102,7 @@ int ft1000_write_register(struct ft1000_usb *ft1000dev, u16 value,
return ret; return ret;
} }
//--------------------------------------------------------------------------- /* read a number of bytes from DPRAM */
// Function: ft1000_read_dpram32
//
// Parameters: ft1000_usb - device structure
// indx - starting address to read
// buffer - data buffer to hold the data read
// cnt - number of byte read from DPRAM
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function read a number of bytes from DPRAM
//
// Notes:
//
//---------------------------------------------------------------------------
int ft1000_read_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer, int ft1000_read_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer,
u16 cnt) u16 cnt)
{ {
...@@ -178,22 +121,7 @@ int ft1000_read_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer, ...@@ -178,22 +121,7 @@ int ft1000_read_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer,
return ret; return ret;
} }
//--------------------------------------------------------------------------- /* writes into DPRAM a number of bytes */
// Function: ft1000_write_dpram32
//
// Parameters: ft1000_usb - device structure
// indx - starting address to write the data
// buffer - data buffer to write into DPRAM
// cnt - number of bytes to write
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function writes into DPRAM a number of bytes
//
// Notes:
//
//---------------------------------------------------------------------------
int ft1000_write_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer, int ft1000_write_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer,
u16 cnt) u16 cnt)
{ {
...@@ -215,22 +143,7 @@ int ft1000_write_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer, ...@@ -215,22 +143,7 @@ int ft1000_write_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer,
return ret; return ret;
} }
//--------------------------------------------------------------------------- /* read 16 bits from DPRAM */
// Function: ft1000_read_dpram16
//
// Parameters: ft1000_usb - device structure
// indx - starting address to read
// buffer - data buffer to hold the data read
// hightlow - high or low 16 bit word
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function read 16 bits from DPRAM
//
// Notes:
//
//---------------------------------------------------------------------------
int ft1000_read_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer, int ft1000_read_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer,
u8 highlow) u8 highlow)
{ {
...@@ -255,22 +168,7 @@ int ft1000_read_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer, ...@@ -255,22 +168,7 @@ int ft1000_read_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer,
return ret; return ret;
} }
//--------------------------------------------------------------------------- /* write into DPRAM a number of bytes */
// Function: ft1000_write_dpram16
//
// Parameters: ft1000_usb - device structure
// indx - starting address to write the data
// value - 16bits value to write
// hightlow - high or low 16 bit word
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function writes into DPRAM a number of bytes
//
// Notes:
//
//---------------------------------------------------------------------------
int ft1000_write_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u16 value, u8 highlow) int ft1000_write_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u16 value, u8 highlow)
{ {
int ret = STATUS_SUCCESS; int ret = STATUS_SUCCESS;
...@@ -294,22 +192,7 @@ int ft1000_write_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u16 value, u8 h ...@@ -294,22 +192,7 @@ int ft1000_write_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u16 value, u8 h
return ret; return ret;
} }
//--------------------------------------------------------------------------- /* read DPRAM 4 words at a time */
// Function: fix_ft1000_read_dpram32
//
// Parameters: ft1000_usb - device structure
// indx - starting address to read
// buffer - data buffer to hold the data read
//
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function read DPRAM 4 words at a time
//
// Notes:
//
//---------------------------------------------------------------------------
int fix_ft1000_read_dpram32(struct ft1000_usb *ft1000dev, u16 indx, int fix_ft1000_read_dpram32(struct ft1000_usb *ft1000dev, u16 indx,
u8 *buffer) u8 *buffer)
{ {
...@@ -338,22 +221,7 @@ int fix_ft1000_read_dpram32(struct ft1000_usb *ft1000dev, u16 indx, ...@@ -338,22 +221,7 @@ int fix_ft1000_read_dpram32(struct ft1000_usb *ft1000dev, u16 indx,
} }
//--------------------------------------------------------------------------- /* Description: This function write to DPRAM 4 words at a time */
// Function: fix_ft1000_write_dpram32
//
// Parameters: ft1000_usb - device structure
// indx - starting address to write
// buffer - data buffer to write
//
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function write to DPRAM 4 words at a time
//
// Notes:
//
//---------------------------------------------------------------------------
int fix_ft1000_write_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer) int fix_ft1000_write_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer)
{ {
u16 pos1; u16 pos1;
...@@ -410,17 +278,7 @@ int fix_ft1000_write_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer) ...@@ -410,17 +278,7 @@ int fix_ft1000_write_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer)
return ret; return ret;
} }
/* reset or activate the DSP */
//------------------------------------------------------------------------
//
// Function: card_reset_dsp
//
// Synopsis: This function is called to reset or activate the DSP
//
// Arguments: value - reset or activate
//
// Returns: None
//-----------------------------------------------------------------------
static void card_reset_dsp(struct ft1000_usb *ft1000dev, bool value) static void card_reset_dsp(struct ft1000_usb *ft1000dev, bool value)
{ {
u16 status = STATUS_SUCCESS; u16 status = STATUS_SUCCESS;
...@@ -457,21 +315,11 @@ static void card_reset_dsp(struct ft1000_usb *ft1000dev, bool value) ...@@ -457,21 +315,11 @@ static void card_reset_dsp(struct ft1000_usb *ft1000dev, bool value)
} }
} }
//--------------------------------------------------------------------------- /* send a command to ASIC
// Function: card_send_command * Parameters: ft1000_usb - device structure
// * ptempbuffer - command buffer
// Parameters: ft1000_usb - device structure * size - command buffer size
// ptempbuffer - command buffer */
// size - command buffer size
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function sends a command to ASIC
//
// Notes:
//
//---------------------------------------------------------------------------
void card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer, void card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer,
int size) int size)
{ {
...@@ -509,16 +357,7 @@ void card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer, ...@@ -509,16 +357,7 @@ void card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer,
} }
//-------------------------------------------------------------------------- /* load or reload the DSP */
//
// Function: dsp_reload
//
// Synopsis: This function is called to load or reload the DSP
//
// Arguments: ft1000dev - device structure
//
// Returns: None
//-----------------------------------------------------------------------
int dsp_reload(struct ft1000_usb *ft1000dev) int dsp_reload(struct ft1000_usb *ft1000dev)
{ {
int status; int status;
...@@ -569,17 +408,7 @@ int dsp_reload(struct ft1000_usb *ft1000dev) ...@@ -569,17 +408,7 @@ int dsp_reload(struct ft1000_usb *ft1000dev)
return 0; return 0;
} }
//--------------------------------------------------------------------------- /* call the Card Service function to reset the ASIC. */
//
// Function: ft1000_reset_asic
// Description: This function will call the Card Service function to reset the
// ASIC.
// Input:
// dev - device structure
// Output:
// none
//
//---------------------------------------------------------------------------
static void ft1000_reset_asic(struct net_device *dev) static void ft1000_reset_asic(struct net_device *dev)
{ {
struct ft1000_info *info = netdev_priv(dev); struct ft1000_info *info = netdev_priv(dev);
...@@ -607,18 +436,6 @@ static void ft1000_reset_asic(struct net_device *dev) ...@@ -607,18 +436,6 @@ static void ft1000_reset_asic(struct net_device *dev)
DEBUG("ft1000_hw: interrupt status register = 0x%x\n", tempword); DEBUG("ft1000_hw: interrupt status register = 0x%x\n", tempword);
} }
//---------------------------------------------------------------------------
//
// Function: ft1000_reset_card
// Description: This function will reset the card
// Input:
// dev - device structure
// Output:
// status - FALSE (card reset fail)
// TRUE (card reset successful)
//
//---------------------------------------------------------------------------
static int ft1000_reset_card(struct net_device *dev) static int ft1000_reset_card(struct net_device *dev)
{ {
struct ft1000_info *info = netdev_priv(dev); struct ft1000_info *info = netdev_priv(dev);
...@@ -666,19 +483,7 @@ static int ft1000_reset_card(struct net_device *dev) ...@@ -666,19 +483,7 @@ static int ft1000_reset_card(struct net_device *dev)
return TRUE; return TRUE;
} }
//--------------------------------------------------------------------------- /* callback function when a urb is transmitted */
// Function: ft1000_usb_transmit_complete
//
// Parameters: urb - transmitted usb urb
//
//
// Returns: none
//
// Description: This is the callback function when a urb is transmitted
//
// Notes:
//
//---------------------------------------------------------------------------
static void ft1000_usb_transmit_complete(struct urb *urb) static void ft1000_usb_transmit_complete(struct urb *urb)
{ {
...@@ -690,21 +495,9 @@ static void ft1000_usb_transmit_complete(struct urb *urb) ...@@ -690,21 +495,9 @@ static void ft1000_usb_transmit_complete(struct urb *urb)
netif_wake_queue(ft1000dev->net); netif_wake_queue(ft1000dev->net);
} }
//--------------------------------------------------------------------------- /* take an ethernet packet and convert it to a Flarion
// * packet prior to sending it to the ASIC Downlink FIFO.
// Function: ft1000_copy_down_pkt */
// Description: This function will take an ethernet packet and convert it to
// a Flarion packet prior to sending it to the ASIC Downlink
// FIFO.
// Input:
// dev - device structure
// packet - address of ethernet packet
// len - length of IP packet
// Output:
// status - FAILURE
// SUCCESS
//
//---------------------------------------------------------------------------
static int ft1000_copy_down_pkt(struct net_device *netdev, u8 * packet, u16 len) static int ft1000_copy_down_pkt(struct net_device *netdev, u8 * packet, u16 len)
{ {
struct ft1000_info *pInfo = netdev_priv(netdev); struct ft1000_info *pInfo = netdev_priv(netdev);
...@@ -769,20 +562,10 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 * packet, u16 len) ...@@ -769,20 +562,10 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 * packet, u16 len)
return 0; return 0;
} }
//--------------------------------------------------------------------------- /* transmit an ethernet packet
// Function: ft1000_start_xmit * Parameters: skb - socket buffer to be sent
// * dev - network device
// Parameters: skb - socket buffer to be sent */
// dev - network device
//
//
// Returns: none
//
// Description: transmit a ethernet packet
//
// Notes:
//
//---------------------------------------------------------------------------
static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev) static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct ft1000_info *pInfo = netdev_priv(dev); struct ft1000_info *pInfo = netdev_priv(dev);
...@@ -827,20 +610,7 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -827,20 +610,7 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
//--------------------------------------------------------------------------- /* open the network driver */
// Function: ft1000_open
//
// Parameters:
// dev - network device
//
//
// Returns: none
//
// Description: open the network driver
//
// Notes:
//
//---------------------------------------------------------------------------
static int ft1000_open(struct net_device *dev) static int ft1000_open(struct net_device *dev)
{ {
struct ft1000_info *pInfo = netdev_priv(dev); struct ft1000_info *pInfo = netdev_priv(dev);
...@@ -879,21 +649,7 @@ static const struct net_device_ops ftnet_ops = ...@@ -879,21 +649,7 @@ static const struct net_device_ops ftnet_ops =
.ndo_get_stats = &ft1000_netdev_stats, .ndo_get_stats = &ft1000_netdev_stats,
}; };
//--------------------------------------------------------------------------- /* initialize the network device */
// Function: init_ft1000_netdev
//
// Parameters: ft1000dev - device structure
//
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function initialize the network device
//
// Notes:
//
//---------------------------------------------------------------------------
static int ft1000_reset(void *dev) static int ft1000_reset(void *dev)
{ {
ft1000_reset_card(dev); ft1000_reset_card(dev);
...@@ -1014,20 +770,7 @@ int init_ft1000_netdev(struct ft1000_usb *ft1000dev) ...@@ -1014,20 +770,7 @@ int init_ft1000_netdev(struct ft1000_usb *ft1000dev)
return ret_val; return ret_val;
} }
//--------------------------------------------------------------------------- /* register the network driver */
// Function: reg_ft1000_netdev
//
// Parameters: ft1000dev - device structure
//
//
// Returns: STATUS_SUCCESS - success
// STATUS_FAILURE - failure
//
// Description: This function register the network driver
//
// Notes:
//
//---------------------------------------------------------------------------
int reg_ft1000_netdev(struct ft1000_usb *ft1000dev, int reg_ft1000_netdev(struct ft1000_usb *ft1000dev,
struct usb_interface *intf) struct usb_interface *intf)
{ {
...@@ -1060,19 +803,9 @@ int reg_ft1000_netdev(struct ft1000_usb *ft1000dev, ...@@ -1060,19 +803,9 @@ int reg_ft1000_netdev(struct ft1000_usb *ft1000dev,
return 0; return 0;
} }
//--------------------------------------------------------------------------- /* take a packet from the FIFO up link and
// * convert it into an ethernet packet and deliver it to the IP stack
// Function: ft1000_copy_up_pkt */
// Description: This function will take a packet from the FIFO up link and
// convert it into an ethernet packet and deliver it to the IP stack
// Input:
// urb - the receiving usb urb
//
// Output:
// status - FAILURE
// SUCCESS
//
//---------------------------------------------------------------------------
static int ft1000_copy_up_pkt(struct urb *urb) static int ft1000_copy_up_pkt(struct urb *urb)
{ {
struct ft1000_info *info = urb->context; struct ft1000_info *info = urb->context;
...@@ -1155,19 +888,7 @@ static int ft1000_copy_up_pkt(struct urb *urb) ...@@ -1155,19 +888,7 @@ static int ft1000_copy_up_pkt(struct urb *urb)
} }
//--------------------------------------------------------------------------- /* the receiving function of the network driver */
//
// Function: ft1000_submit_rx_urb
// Description: the receiving function of the network driver
//
// Input:
// info - a private structure contains the device information
//
// Output:
// status - FAILURE
// SUCCESS
//
//---------------------------------------------------------------------------
static int ft1000_submit_rx_urb(struct ft1000_info *info) static int ft1000_submit_rx_urb(struct ft1000_info *info)
{ {
int result; int result;
...@@ -1196,20 +917,7 @@ static int ft1000_submit_rx_urb(struct ft1000_info *info) ...@@ -1196,20 +917,7 @@ static int ft1000_submit_rx_urb(struct ft1000_info *info)
return 0; return 0;
} }
//--------------------------------------------------------------------------- /* close the network driver */
// Function: ft1000_close
//
// Parameters:
// net - network device
//
//
// Returns: none
//
// Description: close the network driver
//
// Notes:
//
//---------------------------------------------------------------------------
int ft1000_close(struct net_device *net) int ft1000_close(struct net_device *net)
{ {
struct ft1000_info *pInfo = netdev_priv(net); struct ft1000_info *pInfo = netdev_priv(net);
...@@ -1227,18 +935,7 @@ int ft1000_close(struct net_device *net) ...@@ -1227,18 +935,7 @@ int ft1000_close(struct net_device *net)
return 0; return 0;
} }
//--------------------------------------------------------------------------- /* check if the device is presently available on the system. */
//
// Function: ft1000_chkcard
// Description: This function will check if the device is presently available on
// the system.
// Input:
// dev - device structure
// Output:
// status - FALSE (device is not present)
// TRUE (device is present)
//
//---------------------------------------------------------------------------
static int ft1000_chkcard(struct ft1000_usb *dev) static int ft1000_chkcard(struct ft1000_usb *dev)
{ {
u16 tempword; u16 tempword;
...@@ -1271,19 +968,12 @@ static int ft1000_chkcard(struct ft1000_usb *dev) ...@@ -1271,19 +968,12 @@ static int ft1000_chkcard(struct ft1000_usb *dev)
return TRUE; return TRUE;
} }
//--------------------------------------------------------------------------- /* read a message from the dpram area.
// * Input:
// Function: ft1000_receive_cmd * dev - network device structure
// Description: This function will read a message from the dpram area. * pbuffer - caller supply address to buffer
// Input: * pnxtph - pointer to next pseudo header
// dev - network device structure */
// pbuffer - caller supply address to buffer
// pnxtph - pointer to next pseudo header
// Output:
// Status = 0 (unsuccessful)
// = 1 (successful)
//
//---------------------------------------------------------------------------
static bool ft1000_receive_cmd(struct ft1000_usb *dev, u16 *pbuffer, static bool ft1000_receive_cmd(struct ft1000_usb *dev, u16 *pbuffer,
int maxsz, u16 *pnxtph) int maxsz, u16 *pnxtph)
{ {
......
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