提交 b5d8204d 编写于 作者: J Joe Perches 提交者: Greg Kroah-Hartman

staging: ft1000: Logging message neatening

Use a more common logging style.

o Convert DEBUG macros to pr_debug
o Add pr_fmt
o Remove embedded function names from pr_debug
o Convert printks to pr_<level>
o Coalesce formats and align arguments
o Add missing terminating newlines
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ecdd21c7
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
---------------------------------------------------------------------------*/ ---------------------------------------------------------------------------*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define __KERNEL_SYSCALLS__ #define __KERNEL_SYSCALLS__
#include <linux/module.h> #include <linux/module.h>
...@@ -316,7 +318,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, ...@@ -316,7 +318,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
file_version = *(long *)pFileStart; file_version = *(long *)pFileStart;
if (file_version != 6) { if (file_version != 6) {
printk(KERN_ERR "ft1000: unsupported firmware version %ld\n", file_version); pr_err("unsupported firmware version %ld\n", file_version);
Status = FAILURE; Status = FAILURE;
} }
...@@ -688,7 +690,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, ...@@ -688,7 +690,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
uiState = STATE_SECTION_PROV; uiState = STATE_SECTION_PROV;
} else { } else {
netdev_dbg(dev, netdev_dbg(dev,
"FT1000:download:Download error: Bad Port IDs in Pseudo Record\n"); "Download error: Bad Port IDs in Pseudo Record\n");
netdev_dbg(dev, "\t Port Source = 0x%2.2x\n", netdev_dbg(dev, "\t Port Source = 0x%2.2x\n",
pHdr->portsrc); pHdr->portsrc);
netdev_dbg(dev, "\t Port Destination = 0x%2.2x\n", netdev_dbg(dev, "\t Port Destination = 0x%2.2x\n",
......
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
* *
*--------------------------------------------------------------------------- *---------------------------------------------------------------------------
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -87,13 +90,13 @@ struct dpram_blk *ft1000_get_buffer(struct list_head *bufflist) ...@@ -87,13 +90,13 @@ struct dpram_blk *ft1000_get_buffer(struct list_head *bufflist)
spin_lock_irqsave(&free_buff_lock, flags); spin_lock_irqsave(&free_buff_lock, flags);
/* Check if buffer is available */ /* Check if buffer is available */
if (list_empty(bufflist)) { if (list_empty(bufflist)) {
DEBUG("ft1000_get_buffer: No more buffer - %d\n", numofmsgbuf); pr_debug("No more buffer - %d\n", numofmsgbuf);
ptr = NULL; ptr = NULL;
} else { } else {
numofmsgbuf--; numofmsgbuf--;
ptr = list_entry(bufflist->next, struct dpram_blk, list); ptr = list_entry(bufflist->next, struct dpram_blk, list);
list_del(&ptr->list); list_del(&ptr->list);
/* DEBUG("ft1000_get_buffer: number of free msg buffers = %d\n", numofmsgbuf); */ /* pr_debug("number of free msg buffers = %d\n", numofmsgbuf); */
} }
spin_unlock_irqrestore(&free_buff_lock, flags); spin_unlock_irqrestore(&free_buff_lock, flags);
...@@ -125,7 +128,7 @@ void ft1000_free_buffer(struct dpram_blk *pdpram_blk, struct list_head *plist) ...@@ -125,7 +128,7 @@ void ft1000_free_buffer(struct dpram_blk *pdpram_blk, struct list_head *plist)
/* Put memory back to list */ /* Put memory back to list */
list_add_tail(&pdpram_blk->list, plist); list_add_tail(&pdpram_blk->list, plist);
numofmsgbuf++; numofmsgbuf++;
/*DEBUG("ft1000_free_buffer: number of free msg buffers = %d\n", numofmsgbuf); */ /*pr_debug("number of free msg buffers = %d\n", numofmsgbuf); */
spin_unlock_irqrestore(&free_buff_lock, flags); spin_unlock_irqrestore(&free_buff_lock, flags);
} }
...@@ -153,17 +156,17 @@ int ft1000_create_dev(struct ft1000_usb *dev) ...@@ -153,17 +156,17 @@ int ft1000_create_dev(struct ft1000_usb *dev)
/* make a new device name */ /* make a new device name */
sprintf(dev->DeviceName, "%s%d", "FT1000_", dev->CardNumber); sprintf(dev->DeviceName, "%s%d", "FT1000_", dev->CardNumber);
DEBUG("%s: number of instance = %d\n", __func__, ft1000_flarion_cnt); pr_debug("number of instance = %d\n", ft1000_flarion_cnt);
DEBUG("DeviceCreated = %x\n", dev->DeviceCreated); pr_debug("DeviceCreated = %x\n", dev->DeviceCreated);
if (dev->DeviceCreated) { if (dev->DeviceCreated) {
DEBUG("%s: \"%s\" already registered\n", __func__, dev->DeviceName); pr_debug("\"%s\" already registered\n", dev->DeviceName);
return -EIO; return -EIO;
} }
/* register the device */ /* register the device */
DEBUG("%s: \"%s\" debugfs device registration\n", __func__, dev->DeviceName); pr_debug("\"%s\" debugfs device registration\n", dev->DeviceName);
tmp = kmalloc(sizeof(struct ft1000_debug_dirs), GFP_KERNEL); tmp = kmalloc(sizeof(struct ft1000_debug_dirs), GFP_KERNEL);
if (tmp == NULL) { if (tmp == NULL) {
...@@ -189,7 +192,7 @@ int ft1000_create_dev(struct ft1000_usb *dev) ...@@ -189,7 +192,7 @@ int ft1000_create_dev(struct ft1000_usb *dev)
tmp->int_number = dev->CardNumber; tmp->int_number = dev->CardNumber;
list_add(&(tmp->list), &(dev->nodes.list)); list_add(&(tmp->list), &(dev->nodes.list));
DEBUG("%s: registered debugfs directory \"%s\"\n", __func__, dev->DeviceName); pr_debug("registered debugfs directory \"%s\"\n", dev->DeviceName);
/* initialize application information */ /* initialize application information */
dev->appcnt = 0; dev->appcnt = 0;
...@@ -241,10 +244,6 @@ void ft1000_destroy_dev(struct net_device *netdev) ...@@ -241,10 +244,6 @@ void ft1000_destroy_dev(struct net_device *netdev)
struct list_head *pos, *q; struct list_head *pos, *q;
struct ft1000_debug_dirs *dir; struct ft1000_debug_dirs *dir;
DEBUG("%s called\n", __func__);
if (dev->DeviceCreated) { if (dev->DeviceCreated) {
ft1000_flarion_cnt--; ft1000_flarion_cnt--;
list_for_each_safe(pos, q, &dev->nodes.list) { list_for_each_safe(pos, q, &dev->nodes.list) {
...@@ -256,8 +255,7 @@ void ft1000_destroy_dev(struct net_device *netdev) ...@@ -256,8 +255,7 @@ void ft1000_destroy_dev(struct net_device *netdev)
kfree(dir); kfree(dir);
} }
} }
DEBUG("%s: unregistered device \"%s\"\n", __func__, pr_debug("unregistered device \"%s\"\n", dev->DeviceName);
dev->DeviceName);
/* Make sure we free any memory reserve for slow Queue */ /* Make sure we free any memory reserve for slow Queue */
for (i = 0; i < MAX_NUM_APP; i++) { for (i = 0; i < MAX_NUM_APP; i++) {
...@@ -303,17 +301,17 @@ static int ft1000_open(struct inode *inode, struct file *file) ...@@ -303,17 +301,17 @@ static int ft1000_open(struct inode *inode, struct file *file)
struct ft1000_usb *dev = (struct ft1000_usb *)inode->i_private; struct ft1000_usb *dev = (struct ft1000_usb *)inode->i_private;
int i, num; int i, num;
DEBUG("%s called\n", __func__);
num = (MINOR(inode->i_rdev) & 0xf); num = (MINOR(inode->i_rdev) & 0xf);
DEBUG("ft1000_open: minor number=%d\n", num); pr_debug("minor number=%d\n", num);
info = file->private_data = netdev_priv(dev->net); info = file->private_data = netdev_priv(dev->net);
DEBUG("f_owner = %p number of application = %d\n", (&file->f_owner), dev->appcnt); pr_debug("f_owner = %p number of application = %d\n",
&file->f_owner, dev->appcnt);
/* Check if maximum number of application exceeded */ /* Check if maximum number of application exceeded */
if (dev->appcnt > MAX_NUM_APP) { if (dev->appcnt > MAX_NUM_APP) {
DEBUG("Maximum number of application exceeded\n"); pr_debug("Maximum number of application exceeded\n");
return -EACCES; return -EACCES;
} }
...@@ -326,7 +324,7 @@ static int ft1000_open(struct inode *inode, struct file *file) ...@@ -326,7 +324,7 @@ static int ft1000_open(struct inode *inode, struct file *file)
/* Fail due to lack of application info block */ /* Fail due to lack of application info block */
if (i == MAX_NUM_APP) { if (i == MAX_NUM_APP) {
DEBUG("Could not find an application info block\n"); pr_debug("Could not find an application info block\n");
return -EACCES; return -EACCES;
} }
...@@ -362,33 +360,32 @@ static unsigned int ft1000_poll_dev(struct file *file, poll_table *wait) ...@@ -362,33 +360,32 @@ static unsigned int ft1000_poll_dev(struct file *file, poll_table *wait)
struct ft1000_usb *dev = info->priv; struct ft1000_usb *dev = info->priv;
int i; int i;
/* DEBUG("ft1000_poll_dev called\n"); */
if (ft1000_flarion_cnt == 0) { if (ft1000_flarion_cnt == 0) {
DEBUG("FT1000:ft1000_poll_dev called when ft1000_flarion_cnt is zero\n"); pr_debug("called with ft1000_flarion_cnt value zero\n");
return -EBADF; return -EBADF;
} }
/* Search for matching file object */ /* Search for matching file object */
for (i = 0; i < MAX_NUM_APP; i++) { for (i = 0; i < MAX_NUM_APP; i++) {
if (dev->app_info[i].fileobject == &file->f_owner) { if (dev->app_info[i].fileobject == &file->f_owner) {
/* DEBUG("FT1000:ft1000_ioctl: Message is for AppId = %d\n", dev->app_info[i].app_id); */ /* pr_debug("Message is for AppId = %d\n", dev->app_info[i].app_id); */
break; break;
} }
} }
/* Could not find application info block */ /* Could not find application info block */
if (i == MAX_NUM_APP) { if (i == MAX_NUM_APP) {
DEBUG("FT1000:ft1000_ioctl:Could not find application info block\n"); pr_debug("Could not find application info block\n");
return -EACCES; return -EACCES;
} }
if (list_empty(&dev->app_info[i].app_sqlist) == 0) { if (list_empty(&dev->app_info[i].app_sqlist) == 0) {
DEBUG("FT1000:ft1000_poll_dev:Message detected in slow queue\n"); pr_debug("Message detected in slow queue\n");
return(POLLIN | POLLRDNORM | POLLPRI); return(POLLIN | POLLRDNORM | POLLPRI);
} }
poll_wait(file, &dev->app_info[i].wait_dpram_msg, wait); poll_wait(file, &dev->app_info[i].wait_dpram_msg, wait);
/* DEBUG("FT1000:ft1000_poll_dev:Polling for data from DSP\n"); */ /* pr_debug("Polling for data from DSP\n"); */
return 0; return 0;
} }
...@@ -429,27 +426,25 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -429,27 +426,25 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
unsigned short ledStat = 0; unsigned short ledStat = 0;
unsigned short conStat = 0; unsigned short conStat = 0;
/* DEBUG("ft1000_ioctl called\n"); */
if (ft1000_flarion_cnt == 0) { if (ft1000_flarion_cnt == 0) {
DEBUG("FT1000:ft1000_ioctl called when ft1000_flarion_cnt is zero\n"); pr_debug("called with ft1000_flarion_cnt of zero\n");
return -EBADF; return -EBADF;
} }
/* DEBUG("FT1000:ft1000_ioctl:command = 0x%x argument = 0x%8x\n", command, (u32)argument); */ /* pr_debug("command = 0x%x argument = 0x%8x\n", command, (u32)argument); */
info = file->private_data; info = file->private_data;
ft1000dev = info->priv; ft1000dev = info->priv;
cmd = _IOC_NR(command); cmd = _IOC_NR(command);
/* DEBUG("FT1000:ft1000_ioctl:cmd = 0x%x\n", cmd); */ /* pr_debug("cmd = 0x%x\n", cmd); */
/* process the command */ /* process the command */
switch (cmd) { switch (cmd) {
case IOCTL_REGISTER_CMD: case IOCTL_REGISTER_CMD:
DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_REGISTER called\n"); pr_debug("IOCTL_FT1000_REGISTER called\n");
result = get_user(tempword, (__u16 __user *)argp); result = get_user(tempword, (__u16 __user *)argp);
if (result) { if (result) {
DEBUG("result = %d failed to get_user\n", result); pr_debug("result = %d failed to get_user\n", result);
break; break;
} }
if (tempword == DSPBCMSGID) { if (tempword == DSPBCMSGID) {
...@@ -457,7 +452,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -457,7 +452,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
for (i = 0; i < MAX_NUM_APP; i++) { for (i = 0; i < MAX_NUM_APP; i++) {
if (ft1000dev->app_info[i].fileobject == &file->f_owner) { if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
ft1000dev->app_info[i].DspBCMsgFlag = 1; ft1000dev->app_info[i].DspBCMsgFlag = 1;
DEBUG("FT1000:ft1000_ioctl:Registered for broadcast messages\n"); pr_debug("Registered for broadcast messages\n");
break; break;
} }
} }
...@@ -465,34 +460,35 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -465,34 +460,35 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
break; break;
case IOCTL_GET_VER_CMD: case IOCTL_GET_VER_CMD:
DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_VER called\n"); pr_debug("IOCTL_FT1000_GET_VER called\n");
get_ver_data.drv_ver = FT1000_DRV_VER; get_ver_data.drv_ver = FT1000_DRV_VER;
if (copy_to_user(argp, &get_ver_data, sizeof(get_ver_data))) { if (copy_to_user(argp, &get_ver_data, sizeof(get_ver_data))) {
DEBUG("FT1000:ft1000_ioctl: copy fault occurred\n"); pr_debug("copy fault occurred\n");
result = -EFAULT; result = -EFAULT;
break; break;
} }
DEBUG("FT1000:ft1000_ioctl:driver version = 0x%x\n", (unsigned int)get_ver_data.drv_ver); pr_debug("driver version = 0x%x\n",
(unsigned int)get_ver_data.drv_ver);
break; break;
case IOCTL_CONNECT: case IOCTL_CONNECT:
/* Connect Message */ /* Connect Message */
DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_CONNECT\n"); pr_debug("IOCTL_FT1000_CONNECT\n");
ConnectionMsg[79] = 0xfc; ConnectionMsg[79] = 0xfc;
result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c); result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
break; break;
case IOCTL_DISCONNECT: case IOCTL_DISCONNECT:
/* Disconnect Message */ /* Disconnect Message */
DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_DISCONNECT\n"); pr_debug("IOCTL_FT1000_DISCONNECT\n");
ConnectionMsg[79] = 0xfd; ConnectionMsg[79] = 0xfd;
result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c); result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
break; break;
case IOCTL_GET_DSP_STAT_CMD: case IOCTL_GET_DSP_STAT_CMD:
/* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DSP_STAT called\n"); */ /* pr_debug("IOCTL_FT1000_GET_DSP_STAT\n"); */
memset(&get_stat_data, 0, sizeof(get_stat_data)); memset(&get_stat_data, 0, sizeof(get_stat_data));
memcpy(get_stat_data.DspVer, info->DspVer, DSPVERSZ); memcpy(get_stat_data.DspVer, info->DspVer, DSPVERSZ);
memcpy(get_stat_data.HwSerNum, info->HwSerNum, HWSERNUMSZ); memcpy(get_stat_data.HwSerNum, info->HwSerNum, HWSERNUMSZ);
...@@ -502,10 +498,10 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -502,10 +498,10 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
if (info->ProgConStat != 0xFF) { if (info->ProgConStat != 0xFF) {
ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_LED, (u8 *)&ledStat, FT1000_MAG_DSP_LED_INDX); ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_LED, (u8 *)&ledStat, FT1000_MAG_DSP_LED_INDX);
get_stat_data.LedStat = ntohs(ledStat); get_stat_data.LedStat = ntohs(ledStat);
DEBUG("FT1000:ft1000_ioctl: LedStat = 0x%x\n", get_stat_data.LedStat); pr_debug("LedStat = 0x%x\n", get_stat_data.LedStat);
ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_CON_STATE, (u8 *)&conStat, FT1000_MAG_DSP_CON_STATE_INDX); ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_CON_STATE, (u8 *)&conStat, FT1000_MAG_DSP_CON_STATE_INDX);
get_stat_data.ConStat = ntohs(conStat); get_stat_data.ConStat = ntohs(conStat);
DEBUG("FT1000:ft1000_ioctl: ConStat = 0x%x\n", get_stat_data.ConStat); pr_debug("ConStat = 0x%x\n", get_stat_data.ConStat);
} else { } else {
get_stat_data.ConStat = 0x0f; get_stat_data.ConStat = 0x0f;
} }
...@@ -517,13 +513,13 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -517,13 +513,13 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
get_stat_data.nRxBytes = info->stats.rx_bytes; get_stat_data.nRxBytes = info->stats.rx_bytes;
do_gettimeofday(&tv); do_gettimeofday(&tv);
get_stat_data.ConTm = (u32)(tv.tv_sec - info->ConTm); get_stat_data.ConTm = (u32)(tv.tv_sec - info->ConTm);
DEBUG("Connection Time = %d\n", (int)get_stat_data.ConTm); pr_debug("Connection Time = %d\n", (int)get_stat_data.ConTm);
if (copy_to_user(argp, &get_stat_data, sizeof(get_stat_data))) { if (copy_to_user(argp, &get_stat_data, sizeof(get_stat_data))) {
DEBUG("FT1000:ft1000_ioctl: copy fault occurred\n"); pr_debug("copy fault occurred\n");
result = -EFAULT; result = -EFAULT;
break; break;
} }
DEBUG("ft1000_chioctl: GET_DSP_STAT succeed\n"); pr_debug("GET_DSP_STAT succeed\n");
break; break;
case IOCTL_SET_DPRAM_CMD: case IOCTL_SET_DPRAM_CMD:
{ {
...@@ -537,7 +533,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -537,7 +533,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
u16 app_index; u16 app_index;
u16 status; u16 status;
/* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_SET_DPRAM called\n");*/ /* pr_debug("IOCTL_FT1000_SET_DPRAM called\n");*/
if (ft1000_flarion_cnt == 0) if (ft1000_flarion_cnt == 0)
...@@ -553,17 +549,17 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -553,17 +549,17 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
if (info->CardReady) { if (info->CardReady) {
/* DEBUG("FT1000:ft1000_ioctl: try to SET_DPRAM \n"); */ /* pr_debug("try to SET_DPRAM\n"); */
/* Get the length field to see how many bytes to copy */ /* Get the length field to see how many bytes to copy */
result = get_user(msgsz, (__u16 __user *)argp); result = get_user(msgsz, (__u16 __user *)argp);
if (result) if (result)
break; break;
msgsz = ntohs(msgsz); msgsz = ntohs(msgsz);
/* DEBUG("FT1000:ft1000_ioctl: length of message = %d\n", msgsz); */ /* pr_debug("length of message = %d\n", msgsz); */
if (msgsz > MAX_CMD_SQSIZE) { if (msgsz > MAX_CMD_SQSIZE) {
DEBUG("FT1000:ft1000_ioctl: bad message length = %d\n", msgsz); pr_debug("bad message length = %d\n", msgsz);
result = -EINVAL; result = -EINVAL;
break; break;
} }
...@@ -574,7 +570,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -574,7 +570,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
break; break;
if (copy_from_user(dpram_data, argp, msgsz+2)) { if (copy_from_user(dpram_data, argp, msgsz+2)) {
DEBUG("FT1000:ft1000_ChIoctl: copy fault occurred\n"); pr_debug("copy fault occurred\n");
result = -EFAULT; result = -EFAULT;
} else { } else {
/* Check if this message came from a registered application */ /* Check if this message came from a registered application */
...@@ -584,7 +580,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -584,7 +580,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
} }
} }
if (i == MAX_NUM_APP) { if (i == MAX_NUM_APP) {
DEBUG("FT1000:No matching application fileobject\n"); pr_debug("No matching application fileobject\n");
result = -EINVAL; result = -EINVAL;
kfree(dpram_data); kfree(dpram_data);
break; break;
...@@ -593,13 +589,13 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -593,13 +589,13 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
/* Check message qtype type which is the lower byte within qos_class */ /* Check message qtype type which is the lower byte within qos_class */
qtype = ntohs(dpram_data->pseudohdr.qos_class) & 0xff; qtype = ntohs(dpram_data->pseudohdr.qos_class) & 0xff;
/* DEBUG("FT1000_ft1000_ioctl: qtype = %d\n", qtype); */ /* pr_debug("qtype = %d\n", qtype); */
if (qtype) { if (qtype) {
} else { } else {
/* Put message into Slow Queue */ /* Put message into Slow Queue */
/* Only put a message into the DPRAM if msg doorbell is available */ /* Only put a message into the DPRAM if msg doorbell is available */
status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
/* DEBUG("FT1000_ft1000_ioctl: READ REGISTER tempword=%x\n", tempword); */ /* pr_debug("READ REGISTER tempword=%x\n", tempword); */
if (tempword & FT1000_DB_DPRAM_TX) { if (tempword & FT1000_DB_DPRAM_TX) {
/* Suspend for 2ms and try again due to DSP doorbell busy */ /* Suspend for 2ms and try again due to DSP doorbell busy */
mdelay(2); mdelay(2);
...@@ -615,7 +611,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -615,7 +611,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
mdelay(3); mdelay(3);
status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
if (tempword & FT1000_DB_DPRAM_TX) { if (tempword & FT1000_DB_DPRAM_TX) {
DEBUG("FT1000:ft1000_ioctl:Doorbell not available\n"); pr_debug("Doorbell not available\n");
result = -ENOTTY; result = -ENOTTY;
kfree(dpram_data); kfree(dpram_data);
break; break;
...@@ -625,7 +621,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -625,7 +621,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
} }
} }
/*DEBUG("FT1000_ft1000_ioctl: finished reading register\n"); */ /*pr_debug("finished reading register\n"); */
/* Make sure we are within the limits of the slow queue memory limitation */ /* Make sure we are within the limits of the slow queue memory limitation */
if ((msgsz < MAX_CMD_SQSIZE) && (msgsz > PSEUDOSZ)) { if ((msgsz < MAX_CMD_SQSIZE) && (msgsz > PSEUDOSZ)) {
...@@ -642,10 +638,10 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -642,10 +638,10 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
ppseudo_hdr->portsrc = ft1000dev->app_info[app_index].app_id; ppseudo_hdr->portsrc = ft1000dev->app_info[app_index].app_id;
/* Calculate new checksum */ /* Calculate new checksum */
ppseudo_hdr->checksum = *pmsg++; ppseudo_hdr->checksum = *pmsg++;
/* DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); */ /* pr_debug("checksum = 0x%x\n", ppseudo_hdr->checksum); */
for (i = 1; i < 7; i++) { for (i = 1; i < 7; i++) {
ppseudo_hdr->checksum ^= *pmsg++; ppseudo_hdr->checksum ^= *pmsg++;
/* DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); */ /* pr_debug("checksum = 0x%x\n", ppseudo_hdr->checksum); */
} }
pmsg++; pmsg++;
ppseudo_hdr = (struct pseudo_hdr *)pmsg; ppseudo_hdr = (struct pseudo_hdr *)pmsg;
...@@ -659,7 +655,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -659,7 +655,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
} }
} }
} else { } else {
DEBUG("FT1000:ft1000_ioctl: Card not ready take messages\n"); pr_debug("Card not ready take messages\n");
result = -EACCES; result = -EACCES;
} }
kfree(dpram_data); kfree(dpram_data);
...@@ -672,7 +668,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -672,7 +668,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
struct IOCTL_DPRAM_BLK __user *pioctl_dpram; struct IOCTL_DPRAM_BLK __user *pioctl_dpram;
int msglen; int msglen;
/* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DPRAM called\n"); */ /* pr_debug("IOCTL_FT1000_GET_DPRAM called\n"); */
if (ft1000_flarion_cnt == 0) if (ft1000_flarion_cnt == 0)
return -EBADF; return -EBADF;
...@@ -680,14 +676,14 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -680,14 +676,14 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
/* Search for matching file object */ /* Search for matching file object */
for (i = 0; i < MAX_NUM_APP; i++) { for (i = 0; i < MAX_NUM_APP; i++) {
if (ft1000dev->app_info[i].fileobject == &file->f_owner) { if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
/*DEBUG("FT1000:ft1000_ioctl: Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */ /*pr_debug("Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */
break; break;
} }
} }
/* Could not find application info block */ /* Could not find application info block */
if (i == MAX_NUM_APP) { if (i == MAX_NUM_APP) {
DEBUG("FT1000:ft1000_ioctl:Could not find application info block\n"); pr_debug("Could not find application info block\n");
result = -EBADF; result = -EBADF;
break; break;
} }
...@@ -695,21 +691,21 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -695,21 +691,21 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
result = 0; result = 0;
pioctl_dpram = argp; pioctl_dpram = argp;
if (list_empty(&ft1000dev->app_info[i].app_sqlist) == 0) { if (list_empty(&ft1000dev->app_info[i].app_sqlist) == 0) {
/* DEBUG("FT1000:ft1000_ioctl:Message detected in slow queue\n"); */ /* pr_debug("Message detected in slow queue\n"); */
spin_lock_irqsave(&free_buff_lock, flags); spin_lock_irqsave(&free_buff_lock, flags);
pdpram_blk = list_entry(ft1000dev->app_info[i].app_sqlist.next, struct dpram_blk, list); pdpram_blk = list_entry(ft1000dev->app_info[i].app_sqlist.next, struct dpram_blk, list);
list_del(&pdpram_blk->list); list_del(&pdpram_blk->list);
ft1000dev->app_info[i].NumOfMsg--; ft1000dev->app_info[i].NumOfMsg--;
/* DEBUG("FT1000:ft1000_ioctl:NumOfMsg for app %d = %d\n", i, ft1000dev->app_info[i].NumOfMsg); */ /* pr_debug("NumOfMsg for app %d = %d\n", i, ft1000dev->app_info[i].NumOfMsg); */
spin_unlock_irqrestore(&free_buff_lock, flags); spin_unlock_irqrestore(&free_buff_lock, flags);
msglen = ntohs(*(u16 *)pdpram_blk->pbuffer) + PSEUDOSZ; msglen = ntohs(*(u16 *)pdpram_blk->pbuffer) + PSEUDOSZ;
result = get_user(msglen, &pioctl_dpram->total_len); result = get_user(msglen, &pioctl_dpram->total_len);
if (result) if (result)
break; break;
msglen = htons(msglen); msglen = htons(msglen);
/* DEBUG("FT1000:ft1000_ioctl:msg length = %x\n", msglen); */ /* pr_debug("msg length = %x\n", msglen); */
if (copy_to_user(&pioctl_dpram->pseudohdr, pdpram_blk->pbuffer, msglen)) { if (copy_to_user(&pioctl_dpram->pseudohdr, pdpram_blk->pbuffer, msglen)) {
DEBUG("FT1000:ft1000_ioctl: copy fault occurred\n"); pr_debug("copy fault occurred\n");
result = -EFAULT; result = -EFAULT;
break; break;
} }
...@@ -717,12 +713,12 @@ static long ft1000_ioctl(struct file *file, unsigned int command, ...@@ -717,12 +713,12 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
ft1000_free_buffer(pdpram_blk, &freercvpool); ft1000_free_buffer(pdpram_blk, &freercvpool);
result = msglen; result = msglen;
} }
/* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DPRAM no message\n"); */ /* pr_debug("IOCTL_FT1000_GET_DPRAM no message\n"); */
} }
break; break;
default: default:
DEBUG("FT1000:ft1000_ioctl:unknown command: 0x%x\n", command); pr_debug("unknown command: 0x%x\n", command);
result = -ENOTTY; result = -ENOTTY;
break; break;
} }
...@@ -750,8 +746,6 @@ static int ft1000_release(struct inode *inode, struct file *file) ...@@ -750,8 +746,6 @@ static int ft1000_release(struct inode *inode, struct file *file)
int i; int i;
struct dpram_blk *pdpram_blk; struct dpram_blk *pdpram_blk;
DEBUG("ft1000_release called\n");
dev = file->private_data; dev = file->private_data;
info = netdev_priv(dev); info = netdev_priv(dev);
ft1000dev = info->priv; ft1000dev = info->priv;
...@@ -764,7 +758,7 @@ static int ft1000_release(struct inode *inode, struct file *file) ...@@ -764,7 +758,7 @@ static int ft1000_release(struct inode *inode, struct file *file)
/* Search for matching file object */ /* Search for matching file object */
for (i = 0; i < MAX_NUM_APP; i++) { for (i = 0; i < MAX_NUM_APP; i++) {
if (ft1000dev->app_info[i].fileobject == &file->f_owner) { if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
/* DEBUG("FT1000:ft1000_ioctl: Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */ /* pr_debug("Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */
break; break;
} }
} }
...@@ -773,7 +767,7 @@ static int ft1000_release(struct inode *inode, struct file *file) ...@@ -773,7 +767,7 @@ static int ft1000_release(struct inode *inode, struct file *file)
return 0; return 0;
while (list_empty(&ft1000dev->app_info[i].app_sqlist) == 0) { while (list_empty(&ft1000dev->app_info[i].app_sqlist) == 0) {
DEBUG("Remove and free memory queue up on slow queue\n"); pr_debug("Remove and free memory queue up on slow queue\n");
pdpram_blk = list_entry(ft1000dev->app_info[i].app_sqlist.next, struct dpram_blk, list); pdpram_blk = list_entry(ft1000dev->app_info[i].app_sqlist.next, struct dpram_blk, list);
list_del(&pdpram_blk->list); list_del(&pdpram_blk->list);
ft1000_free_buffer(pdpram_blk, &freercvpool); ft1000_free_buffer(pdpram_blk, &freercvpool);
...@@ -781,7 +775,7 @@ static int ft1000_release(struct inode *inode, struct file *file) ...@@ -781,7 +775,7 @@ static int ft1000_release(struct inode *inode, struct file *file)
/* initialize application information */ /* initialize application information */
ft1000dev->appcnt--; ft1000dev->appcnt--;
DEBUG("ft1000_chdev:%s:appcnt = %d\n", __func__, ft1000dev->appcnt); pr_debug("appcnt = %d\n", ft1000dev->appcnt);
ft1000dev->app_info[i].fileobject = NULL; ft1000dev->app_info[i].fileobject = NULL;
return 0; return 0;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* This file is part of Express Card USB Driver * This file is part of Express Card USB Driver
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -118,10 +120,9 @@ static int check_usb_db(struct ft1000_usb *ft1000dev) ...@@ -118,10 +120,9 @@ static int check_usb_db(struct ft1000_usb *ft1000dev)
while (loopcnt < 10) { while (loopcnt < 10) {
status = ft1000_read_register(ft1000dev, &temp, status = ft1000_read_register(ft1000dev, &temp,
FT1000_REG_DOORBELL); FT1000_REG_DOORBELL);
DEBUG("check_usb_db: read FT1000_REG_DOORBELL value is %x\n", pr_debug("read FT1000_REG_DOORBELL value is %x\n", temp);
temp);
if (temp & 0x0080) { if (temp & 0x0080) {
DEBUG("FT1000:Got checkusb doorbell\n"); pr_debug("Got checkusb doorbell\n");
status = ft1000_write_register(ft1000dev, 0x0080, status = ft1000_write_register(ft1000dev, 0x0080,
FT1000_REG_DOORBELL); FT1000_REG_DOORBELL);
status = ft1000_write_register(ft1000dev, 0x0100, status = ft1000_write_register(ft1000dev, 0x0100,
...@@ -139,12 +140,12 @@ static int check_usb_db(struct ft1000_usb *ft1000dev) ...@@ -139,12 +140,12 @@ static int check_usb_db(struct ft1000_usb *ft1000dev)
while (loopcnt < 20) { while (loopcnt < 20) {
status = ft1000_read_register(ft1000dev, &temp, status = ft1000_read_register(ft1000dev, &temp,
FT1000_REG_DOORBELL); FT1000_REG_DOORBELL);
DEBUG("FT1000:check_usb_db:Doorbell = 0x%x\n", temp); pr_debug("Doorbell = 0x%x\n", temp);
if (temp & 0x8000) { if (temp & 0x8000) {
loopcnt++; loopcnt++;
msleep(10); msleep(10);
} else { } else {
DEBUG("check_usb_db: door bell is cleared, return 0\n"); pr_debug("door bell is cleared, return 0\n");
return 0; return 0;
} }
} }
...@@ -166,12 +167,11 @@ static u16 get_handshake(struct ft1000_usb *ft1000dev, u16 expected_value) ...@@ -166,12 +167,11 @@ static u16 get_handshake(struct ft1000_usb *ft1000dev, u16 expected_value)
status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_RX, status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_RX,
FT1000_REG_DOORBELL); FT1000_REG_DOORBELL);
if (ft1000dev->fcodeldr) { if (ft1000dev->fcodeldr) {
DEBUG(" get_handshake: fcodeldr is %d\n", pr_debug("fcodeldr is %d\n", ft1000dev->fcodeldr);
ft1000dev->fcodeldr);
ft1000dev->fcodeldr = 0; ft1000dev->fcodeldr = 0;
status = check_usb_db(ft1000dev); status = check_usb_db(ft1000dev);
if (status != 0) { if (status != 0) {
DEBUG("get_handshake: check_usb_db failed\n"); pr_debug("check_usb_db failed\n");
break; break;
} }
status = ft1000_write_register(ft1000dev, status = ft1000_write_register(ft1000dev,
...@@ -232,14 +232,14 @@ static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value) ...@@ -232,14 +232,14 @@ static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value)
status = ft1000_read_dpram32(ft1000dev, 0, status = ft1000_read_dpram32(ft1000dev, 0,
(u8 *)&(ft1000dev->tempbuf[0]), 64); (u8 *)&(ft1000dev->tempbuf[0]), 64);
for (temp = 0; temp < 16; temp++) { for (temp = 0; temp < 16; temp++) {
DEBUG("tempbuf %d = 0x%x\n", temp, pr_debug("tempbuf %d = 0x%x\n",
ft1000dev->tempbuf[temp]); temp, ft1000dev->tempbuf[temp]);
} }
status = ft1000_read_dpram16(ft1000dev, status = ft1000_read_dpram16(ft1000dev,
DWNLD_MAG1_HANDSHAKE_LOC, DWNLD_MAG1_HANDSHAKE_LOC,
(u8 *)&handshake, 1); (u8 *)&handshake, 1);
DEBUG("handshake from read_dpram16 = 0x%x\n", pr_debug("handshake from read_dpram16 = 0x%x\n",
handshake); handshake);
if (ft1000dev->dspalive == ft1000dev->tempbuf[6]) { if (ft1000dev->dspalive == ft1000dev->tempbuf[6]) {
handshake = 0; handshake = 0;
} else { } else {
...@@ -409,7 +409,7 @@ static int write_dpram32_and_check(struct ft1000_usb *ft1000dev, ...@@ -409,7 +409,7 @@ static int write_dpram32_and_check(struct ft1000_usb *ft1000dev,
if ((tempbuffer[31] & 0xfe00) == 0xfe00) { if ((tempbuffer[31] & 0xfe00) == 0xfe00) {
if (check_buffers(tempbuffer, resultbuffer, 28, if (check_buffers(tempbuffer, resultbuffer, 28,
0)) { 0)) {
DEBUG("FT1000:download:DPRAM write failed 1 during bootloading\n"); pr_debug("DPRAM write failed 1 during bootloading\n");
usleep_range(9000, 11000); usleep_range(9000, 11000);
break; break;
} }
...@@ -419,14 +419,14 @@ static int write_dpram32_and_check(struct ft1000_usb *ft1000dev, ...@@ -419,14 +419,14 @@ static int write_dpram32_and_check(struct ft1000_usb *ft1000dev,
if (check_buffers(tempbuffer, resultbuffer, 16, if (check_buffers(tempbuffer, resultbuffer, 16,
24)) { 24)) {
DEBUG("FT1000:download:DPRAM write failed 2 during bootloading\n"); pr_debug("DPRAM write failed 2 during bootloading\n");
usleep_range(9000, 11000); usleep_range(9000, 11000);
break; break;
} }
} else { } else {
if (check_buffers(tempbuffer, resultbuffer, 32, if (check_buffers(tempbuffer, resultbuffer, 32,
0)) { 0)) {
DEBUG("FT1000:download:DPRAM write failed 3 during bootloading\n"); pr_debug("DPRAM write failed 3 during bootloading\n");
usleep_range(9000, 11000); usleep_range(9000, 11000);
break; break;
} }
...@@ -453,7 +453,7 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile, ...@@ -453,7 +453,7 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile,
u16 tempword; u16 tempword;
u16 tempbuffer[64]; u16 tempbuffer[64];
/*DEBUG("FT1000:download:start word_length = %d\n",(int)word_length); */ /*pr_debug("start word_length = %d\n",(int)word_length); */
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC; dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
tempword = *(*pUsFile); tempword = *(*pUsFile);
(*pUsFile)++; (*pUsFile)++;
...@@ -483,9 +483,9 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile, ...@@ -483,9 +483,9 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile,
} }
} }
/*DEBUG("write_blk: loopcnt is %d\n", loopcnt); */ /*pr_debug("loopcnt is %d\n", loopcnt); */
/*DEBUG("write_blk: bootmode = %d\n", bootmode); */ /*pr_debug("write_blk: bootmode = %d\n", bootmode); */
/*DEBUG("write_blk: dpram = %x\n", dpram); */ /*pr_debug("write_blk: dpram = %x\n", dpram); */
if (ft1000dev->bootmode == 0) { if (ft1000dev->bootmode == 0) {
if (dpram >= 0x3F4) if (dpram >= 0x3F4)
status = ft1000_write_dpram32(ft1000dev, dpram, status = ft1000_write_dpram32(ft1000dev, dpram,
...@@ -497,7 +497,8 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile, ...@@ -497,7 +497,8 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile,
status = write_dpram32_and_check(ft1000dev, tempbuffer, status = write_dpram32_and_check(ft1000dev, tempbuffer,
dpram); dpram);
if (status != 0) { if (status != 0) {
DEBUG("FT1000:download:Write failed tempbuffer[31] = 0x%x\n", tempbuffer[31]); pr_debug("Write failed tempbuffer[31] = 0x%x\n",
tempbuffer[31]);
break; break;
} }
} }
...@@ -508,7 +509,7 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile, ...@@ -508,7 +509,7 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile,
static void usb_dnld_complete(struct urb *urb) static void usb_dnld_complete(struct urb *urb)
{ {
/* DEBUG("****** usb_dnld_complete\n"); */ /* pr_debug("****** usb_dnld_complete\n"); */
} }
/* writes a block of DSP image to DPRAM /* writes a block of DSP image to DPRAM
...@@ -552,18 +553,17 @@ static int scram_start_dwnld(struct ft1000_usb *ft1000dev, u16 *hshake, ...@@ -552,18 +553,17 @@ static int scram_start_dwnld(struct ft1000_usb *ft1000dev, u16 *hshake,
{ {
int status = 0; int status = 0;
DEBUG("FT1000:STATE_START_DWNLD\n");
if (ft1000dev->usbboot) if (ft1000dev->usbboot)
*hshake = get_handshake_usb(ft1000dev, HANDSHAKE_DSP_BL_READY); *hshake = get_handshake_usb(ft1000dev, HANDSHAKE_DSP_BL_READY);
else else
*hshake = get_handshake(ft1000dev, HANDSHAKE_DSP_BL_READY); *hshake = get_handshake(ft1000dev, HANDSHAKE_DSP_BL_READY);
if (*hshake == HANDSHAKE_DSP_BL_READY) { if (*hshake == HANDSHAKE_DSP_BL_READY) {
DEBUG("scram_dnldr: handshake is HANDSHAKE_DSP_BL_READY, call put_handshake(HANDSHAKE_DRIVER_READY)\n"); pr_debug("handshake is HANDSHAKE_DSP_BL_READY, call put_handshake(HANDSHAKE_DRIVER_READY)\n");
put_handshake(ft1000dev, HANDSHAKE_DRIVER_READY); put_handshake(ft1000dev, HANDSHAKE_DRIVER_READY);
} else if (*hshake == HANDSHAKE_TIMEOUT_VALUE) { } else if (*hshake == HANDSHAKE_TIMEOUT_VALUE) {
status = -ETIMEDOUT; status = -ETIMEDOUT;
} else { } else {
DEBUG("FT1000:download:Download error: Handshake failed\n"); pr_debug("Download error: Handshake failed\n");
status = -ENETRESET; status = -ENETRESET;
} }
*state = STATE_BOOT_DWNLD; *state = STATE_BOOT_DWNLD;
...@@ -576,17 +576,17 @@ static int request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file, ...@@ -576,17 +576,17 @@ static int request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file,
long word_length; long word_length;
int status = 0; int status = 0;
/*DEBUG("FT1000:REQUEST_CODE_SEGMENT\n");i*/
word_length = get_request_value(ft1000dev); word_length = get_request_value(ft1000dev);
/*DEBUG("FT1000:word_length = 0x%x\n", (int)word_length); */ /*pr_debug("word_length = 0x%x\n", (int)word_length); */
/*NdisMSleep (100); */ /*NdisMSleep (100); */
if (word_length > MAX_LENGTH) { if (word_length > MAX_LENGTH) {
DEBUG("FT1000:download:Download error: Max length exceeded\n"); pr_debug("Download error: Max length exceeded\n");
return -1; return -1;
} }
if ((word_length * 2 + (long)c_file) > (long)endpoint) { if ((word_length * 2 + (long)c_file) > (long)endpoint) {
/* Error, beyond boot code range.*/ /* Error, beyond boot code range.*/
DEBUG("FT1000:download:Download error: Requested len=%d exceeds BOOT code boundary.\n", (int)word_length); pr_debug("Download error: Requested len=%d exceeds BOOT code boundary\n",
(int)word_length);
return -1; return -1;
} }
if (word_length & 0x1) if (word_length & 0x1)
...@@ -595,7 +595,7 @@ static int request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file, ...@@ -595,7 +595,7 @@ static int request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file,
if (boot_case) { if (boot_case) {
status = write_blk(ft1000dev, s_file, c_file, word_length); status = write_blk(ft1000dev, s_file, c_file, word_length);
/*DEBUG("write_blk returned %d\n", status); */ /*pr_debug("write_blk returned %d\n", status); */
} else { } else {
status = write_blk_fifo(ft1000dev, s_file, c_file, word_length); status = write_blk_fifo(ft1000dev, s_file, c_file, word_length);
if (ft1000dev->usbboot == 0) if (ft1000dev->usbboot == 0)
...@@ -641,8 +641,6 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -641,8 +641,6 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
struct prov_record *pprov_record; struct prov_record *pprov_record;
struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net); struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
DEBUG("Entered scram_dnldr...\n");
ft1000dev->fcodeldr = 0; ft1000dev->fcodeldr = 0;
ft1000dev->usbboot = 0; ft1000dev->usbboot = 0;
ft1000dev->dspalive = 0xffff; ft1000dev->dspalive = 0xffff;
...@@ -674,7 +672,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -674,7 +672,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
break; break;
case STATE_BOOT_DWNLD: case STATE_BOOT_DWNLD:
DEBUG("FT1000:STATE_BOOT_DWNLD\n"); pr_debug("STATE_BOOT_DWNLD\n");
ft1000dev->bootmode = 1; ft1000dev->bootmode = 1;
handshake = get_handshake(ft1000dev, HANDSHAKE_REQUEST); handshake = get_handshake(ft1000dev, HANDSHAKE_REQUEST);
if (handshake == HANDSHAKE_REQUEST) { if (handshake == HANDSHAKE_REQUEST) {
...@@ -684,22 +682,22 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -684,22 +682,22 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
request = get_request_type(ft1000dev); request = get_request_type(ft1000dev);
switch (request) { switch (request) {
case REQUEST_RUN_ADDRESS: case REQUEST_RUN_ADDRESS:
DEBUG("FT1000:REQUEST_RUN_ADDRESS\n"); pr_debug("REQUEST_RUN_ADDRESS\n");
put_request_value(ft1000dev, put_request_value(ft1000dev,
loader_code_address); loader_code_address);
break; break;
case REQUEST_CODE_LENGTH: case REQUEST_CODE_LENGTH:
DEBUG("FT1000:REQUEST_CODE_LENGTH\n"); pr_debug("REQUEST_CODE_LENGTH\n");
put_request_value(ft1000dev, put_request_value(ft1000dev,
loader_code_size); loader_code_size);
break; break;
case REQUEST_DONE_BL: case REQUEST_DONE_BL:
DEBUG("FT1000:REQUEST_DONE_BL\n"); pr_debug("REQUEST_DONE_BL\n");
/* Reposition ptrs to beginning of code section */ /* Reposition ptrs to beginning of code section */
s_file = (u16 *) (boot_end); s_file = (u16 *) (boot_end);
c_file = (u8 *) (boot_end); c_file = (u8 *) (boot_end);
/* DEBUG("FT1000:download:s_file = 0x%8x\n", (int)s_file); */ /* pr_debug("download:s_file = 0x%8x\n", (int)s_file); */
/* DEBUG("FT1000:download:c_file = 0x%8x\n", (int)c_file); */ /* pr_debug("FT1000:download:c_file = 0x%8x\n", (int)c_file); */
state = STATE_CODE_DWNLD; state = STATE_CODE_DWNLD;
ft1000dev->fcodeldr = 1; ft1000dev->fcodeldr = 1;
break; break;
...@@ -710,8 +708,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -710,8 +708,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
true); true);
break; break;
default: default:
DEBUG pr_debug("Download error: Bad request type=%d in BOOT download state\n",
("FT1000:download:Download error: Bad request type=%d in BOOT download state.\n",
request); request);
status = -1; status = -1;
break; break;
...@@ -723,15 +720,14 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -723,15 +720,14 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
put_handshake(ft1000dev, put_handshake(ft1000dev,
HANDSHAKE_RESPONSE); HANDSHAKE_RESPONSE);
} else { } else {
DEBUG pr_debug("Download error: Handshake failed\n");
("FT1000:download:Download error: Handshake failed\n");
status = -1; status = -1;
} }
break; break;
case STATE_CODE_DWNLD: case STATE_CODE_DWNLD:
/* DEBUG("FT1000:STATE_CODE_DWNLD\n"); */ /* pr_debug("STATE_CODE_DWNLD\n"); */
ft1000dev->bootmode = 0; ft1000dev->bootmode = 0;
if (ft1000dev->usbboot) if (ft1000dev->usbboot)
handshake = handshake =
...@@ -751,40 +747,33 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -751,40 +747,33 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
request = get_request_type(ft1000dev); request = get_request_type(ft1000dev);
switch (request) { switch (request) {
case REQUEST_FILE_CHECKSUM: case REQUEST_FILE_CHECKSUM:
DEBUG pr_debug("image_chksum = 0x%8x\n",
("FT1000:download:image_chksum = 0x%8x\n",
image_chksum); image_chksum);
put_request_value(ft1000dev, put_request_value(ft1000dev,
image_chksum); image_chksum);
break; break;
case REQUEST_RUN_ADDRESS: case REQUEST_RUN_ADDRESS:
DEBUG pr_debug("REQUEST_RUN_ADDRESS\n");
("FT1000:download: REQUEST_RUN_ADDRESS\n");
if (correct_version) { if (correct_version) {
DEBUG pr_debug("run_address = 0x%8x\n",
("FT1000:download:run_address = 0x%8x\n",
(int)run_address); (int)run_address);
put_request_value(ft1000dev, put_request_value(ft1000dev,
run_address); run_address);
} else { } else {
DEBUG pr_debug("Download error: Got Run address request before image offset request\n");
("FT1000:download:Download error: Got Run address request before image offset request.\n");
status = -1; status = -1;
break; break;
} }
break; break;
case REQUEST_CODE_LENGTH: case REQUEST_CODE_LENGTH:
DEBUG pr_debug("REQUEST_CODE_LENGTH\n");
("FT1000:download:REQUEST_CODE_LENGTH\n");
if (correct_version) { if (correct_version) {
DEBUG pr_debug("run_size = 0x%8x\n",
("FT1000:download:run_size = 0x%8x\n",
(int)run_size); (int)run_size);
put_request_value(ft1000dev, put_request_value(ft1000dev,
run_size); run_size);
} else { } else {
DEBUG pr_debug("Download error: Got Size request before image offset request\n");
("FT1000:download:Download error: Got Size request before image offset request.\n");
status = -1; status = -1;
break; break;
} }
...@@ -801,10 +790,9 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -801,10 +790,9 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
state = STATE_DONE_DWNLD; state = STATE_DONE_DWNLD;
break; break;
case REQUEST_CODE_SEGMENT: case REQUEST_CODE_SEGMENT:
/* DEBUG("FT1000:download: REQUEST_CODE_SEGMENT - CODELOADER\n"); */ /* pr_debug("REQUEST_CODE_SEGMENT - CODELOADER\n"); */
if (!correct_version) { if (!correct_version) {
DEBUG pr_debug("Download error: Got Code Segment request before image offset request\n");
("FT1000:download:Download error: Got Code Segment request before image offset request.\n");
status = -1; status = -1;
break; break;
} }
...@@ -817,8 +805,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -817,8 +805,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
break; break;
case REQUEST_MAILBOX_DATA: case REQUEST_MAILBOX_DATA:
DEBUG pr_debug("REQUEST_MAILBOX_DATA\n");
("FT1000:download: REQUEST_MAILBOX_DATA\n");
/* Convert length from byte count to word count. Make sure we round up. */ /* Convert length from byte count to word count. Make sure we round up. */
word_length = word_length =
(long)(pft1000info->DSPInfoBlklen + (long)(pft1000info->DSPInfoBlklen +
...@@ -852,8 +839,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -852,8 +839,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
break; break;
case REQUEST_VERSION_INFO: case REQUEST_VERSION_INFO:
DEBUG pr_debug("REQUEST_VERSION_INFO\n");
("FT1000:download:REQUEST_VERSION_INFO\n");
word_length = word_length =
file_hdr->version_data_size; file_hdr->version_data_size;
put_request_value(ft1000dev, put_request_value(ft1000dev,
...@@ -887,8 +873,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -887,8 +873,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
break; break;
case REQUEST_CODE_BY_VERSION: case REQUEST_CODE_BY_VERSION:
DEBUG pr_debug("REQUEST_CODE_BY_VERSION\n");
("FT1000:download:REQUEST_CODE_BY_VERSION\n");
correct_version = false; correct_version = false;
requested_version = requested_version =
get_request_value(ft1000dev); get_request_value(ft1000dev);
...@@ -907,8 +892,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -907,8 +892,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
if (dsp_img_info->version == if (dsp_img_info->version ==
requested_version) { requested_version) {
correct_version = true; correct_version = true;
DEBUG pr_debug("correct_version is TRUE\n");
("FT1000:download: correct_version is TRUE\n");
s_file = s_file =
(u16 *) (pFileStart (u16 *) (pFileStart
+ +
...@@ -941,8 +925,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -941,8 +925,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
/* /*
* Error, beyond boot code range. * Error, beyond boot code range.
*/ */
DEBUG pr_debug("Download error: Bad Version Request = 0x%x.\n",
("FT1000:download:Download error: Bad Version Request = 0x%x.\n",
(int)requested_version); (int)requested_version);
status = -1; status = -1;
break; break;
...@@ -950,8 +933,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -950,8 +933,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
break; break;
default: default:
DEBUG pr_debug("Download error: Bad request type=%d in CODE download state.\n",
("FT1000:download:Download error: Bad request type=%d in CODE download state.\n",
request); request);
status = -1; status = -1;
break; break;
...@@ -963,20 +945,19 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -963,20 +945,19 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
put_handshake(ft1000dev, put_handshake(ft1000dev,
HANDSHAKE_RESPONSE); HANDSHAKE_RESPONSE);
} else { } else {
DEBUG pr_debug("Download error: Handshake failed\n");
("FT1000:download:Download error: Handshake failed\n");
status = -1; status = -1;
} }
break; break;
case STATE_DONE_DWNLD: case STATE_DONE_DWNLD:
DEBUG("FT1000:download:Code loader is done...\n"); pr_debug("Code loader is done...\n");
state = STATE_SECTION_PROV; state = STATE_SECTION_PROV;
break; break;
case STATE_SECTION_PROV: case STATE_SECTION_PROV:
DEBUG("FT1000:download:STATE_SECTION_PROV\n"); pr_debug("STATE_SECTION_PROV\n");
pseudo_header = (struct pseudo_hdr *)c_file; pseudo_header = (struct pseudo_hdr *)c_file;
if (pseudo_header->checksum == if (pseudo_header->checksum ==
...@@ -1031,13 +1012,12 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -1031,13 +1012,12 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
/* Checksum did not compute */ /* Checksum did not compute */
status = -1; status = -1;
} }
DEBUG pr_debug("after STATE_SECTION_PROV, state = %d, status= %d\n",
("ft1000:download: after STATE_SECTION_PROV, state = %d, status= %d\n",
state, status); state, status);
break; break;
case STATE_DONE_PROV: case STATE_DONE_PROV:
DEBUG("FT1000:download:STATE_DONE_PROV\n"); pr_debug("STATE_DONE_PROV\n");
state = STATE_DONE_FILE; state = STATE_DONE_FILE;
break; break;
...@@ -1064,7 +1044,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, ...@@ -1064,7 +1044,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
} /* End while */ } /* End while */
DEBUG("Download exiting with status = 0x%8x\n", status); pr_debug("Download exiting with status = 0x%8x\n", status);
ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX, ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX,
FT1000_REG_DOORBELL); FT1000_REG_DOORBELL);
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
* $Id: * $Id:
*==================================================== *====================================================
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/usb.h> #include <linux/usb.h>
...@@ -45,7 +48,7 @@ static int ft1000_poll_thread(void *arg) ...@@ -45,7 +48,7 @@ static int ft1000_poll_thread(void *arg)
if (!gPollingfailed) { if (!gPollingfailed) {
ret = ft1000_poll(arg); ret = ft1000_poll(arg);
if (ret != 0) { if (ret != 0) {
DEBUG("ft1000_poll_thread: polling failed\n"); pr_debug("polling failed\n");
gPollingfailed = true; gPollingfailed = true;
} }
} }
...@@ -71,9 +74,8 @@ static int ft1000_probe(struct usb_interface *interface, ...@@ -71,9 +74,8 @@ static int ft1000_probe(struct usb_interface *interface,
return -ENOMEM; return -ENOMEM;
dev = interface_to_usbdev(interface); dev = interface_to_usbdev(interface);
DEBUG("ft1000_probe: usb device descriptor info:\n"); pr_debug("usb device descriptor info - number of configuration is %d\n",
DEBUG("ft1000_probe: number of configuration is %d\n", dev->descriptor.bNumConfigurations);
dev->descriptor.bNumConfigurations);
ft1000dev->dev = dev; ft1000dev->dev = dev;
ft1000dev->status = 0; ft1000dev->status = 0;
...@@ -85,42 +87,38 @@ static int ft1000_probe(struct usb_interface *interface, ...@@ -85,42 +87,38 @@ static int ft1000_probe(struct usb_interface *interface,
goto err_fw; goto err_fw;
} }
DEBUG("ft1000_probe is called\n");
numaltsetting = interface->num_altsetting; numaltsetting = interface->num_altsetting;
DEBUG("ft1000_probe: number of alt settings is :%d\n", numaltsetting); pr_debug("number of alt settings is: %d\n", numaltsetting);
iface_desc = interface->cur_altsetting; iface_desc = interface->cur_altsetting;
DEBUG("ft1000_probe: number of endpoints is %d\n", pr_debug("number of endpoints is: %d\n",
iface_desc->desc.bNumEndpoints); iface_desc->desc.bNumEndpoints);
DEBUG("ft1000_probe: descriptor type is %d\n", pr_debug("descriptor type is: %d\n", iface_desc->desc.bDescriptorType);
iface_desc->desc.bDescriptorType); pr_debug("interface number is: %d\n",
DEBUG("ft1000_probe: interface number is %d\n", iface_desc->desc.bInterfaceNumber);
iface_desc->desc.bInterfaceNumber); pr_debug("alternatesetting is: %d\n",
DEBUG("ft1000_probe: alternatesetting is %d\n", iface_desc->desc.bAlternateSetting);
iface_desc->desc.bAlternateSetting); pr_debug("interface class is: %d\n", iface_desc->desc.bInterfaceClass);
DEBUG("ft1000_probe: interface class is %d\n", pr_debug("control endpoint info:\n");
iface_desc->desc.bInterfaceClass); pr_debug("descriptor0 type -- %d\n",
DEBUG("ft1000_probe: control endpoint info:\n"); iface_desc->endpoint[0].desc.bmAttributes);
DEBUG("ft1000_probe: descriptor0 type -- %d\n", pr_debug("descriptor1 type -- %d\n",
iface_desc->endpoint[0].desc.bmAttributes); iface_desc->endpoint[1].desc.bmAttributes);
DEBUG("ft1000_probe: descriptor1 type -- %d\n", pr_debug("descriptor2 type -- %d\n",
iface_desc->endpoint[1].desc.bmAttributes); iface_desc->endpoint[2].desc.bmAttributes);
DEBUG("ft1000_probe: descriptor2 type -- %d\n",
iface_desc->endpoint[2].desc.bmAttributes);
for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) { for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
endpoint = endpoint =
(struct usb_endpoint_descriptor *)&iface_desc-> (struct usb_endpoint_descriptor *)&iface_desc->
endpoint[i].desc; endpoint[i].desc;
DEBUG("endpoint %d\n", i); pr_debug("endpoint %d\n", i);
DEBUG("bEndpointAddress=%x, bmAttributes=%x\n", pr_debug("bEndpointAddress=%x, bmAttributes=%x\n",
endpoint->bEndpointAddress, endpoint->bmAttributes); endpoint->bEndpointAddress, endpoint->bmAttributes);
if ((endpoint->bEndpointAddress & USB_DIR_IN) if ((endpoint->bEndpointAddress & USB_DIR_IN)
&& ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_BULK)) { USB_ENDPOINT_XFER_BULK)) {
ft1000dev->bulk_in_endpointAddr = ft1000dev->bulk_in_endpointAddr =
endpoint->bEndpointAddress; endpoint->bEndpointAddress;
DEBUG("ft1000_probe: in: %d\n", pr_debug("in: %d\n", endpoint->bEndpointAddress);
endpoint->bEndpointAddress);
} }
if (!(endpoint->bEndpointAddress & USB_DIR_IN) if (!(endpoint->bEndpointAddress & USB_DIR_IN)
...@@ -128,17 +126,17 @@ static int ft1000_probe(struct usb_interface *interface, ...@@ -128,17 +126,17 @@ static int ft1000_probe(struct usb_interface *interface,
USB_ENDPOINT_XFER_BULK)) { USB_ENDPOINT_XFER_BULK)) {
ft1000dev->bulk_out_endpointAddr = ft1000dev->bulk_out_endpointAddr =
endpoint->bEndpointAddress; endpoint->bEndpointAddress;
DEBUG("ft1000_probe: out: %d\n", pr_debug("out: %d\n", endpoint->bEndpointAddress);
endpoint->bEndpointAddress);
} }
} }
DEBUG("bulk_in=%d, bulk_out=%d\n", ft1000dev->bulk_in_endpointAddr, pr_debug("bulk_in=%d, bulk_out=%d\n",
ft1000dev->bulk_out_endpointAddr); ft1000dev->bulk_in_endpointAddr,
ft1000dev->bulk_out_endpointAddr);
ret = request_firmware(&dsp_fw, "ft3000.img", &dev->dev); ret = request_firmware(&dsp_fw, "ft3000.img", &dev->dev);
if (ret < 0) { if (ret < 0) {
pr_err("Error request_firmware().\n"); pr_err("Error request_firmware()\n");
goto err_fw; goto err_fw;
} }
...@@ -155,7 +153,7 @@ static int ft1000_probe(struct usb_interface *interface, ...@@ -155,7 +153,7 @@ static int ft1000_probe(struct usb_interface *interface,
FileLength = dsp_fw->size; FileLength = dsp_fw->size;
release_firmware(dsp_fw); release_firmware(dsp_fw);
DEBUG("ft1000_probe: start downloading dsp image...\n"); pr_debug("start downloading dsp image...\n");
ret = init_ft1000_netdev(ft1000dev); ret = init_ft1000_netdev(ft1000dev);
if (ret) if (ret)
...@@ -163,7 +161,7 @@ static int ft1000_probe(struct usb_interface *interface, ...@@ -163,7 +161,7 @@ static int ft1000_probe(struct usb_interface *interface,
pft1000info = netdev_priv(ft1000dev->net); pft1000info = netdev_priv(ft1000dev->net);
DEBUG("In probe: pft1000info=%p\n", pft1000info); pr_debug("pft1000info=%p\n", pft1000info);
ret = dsp_reload(ft1000dev); ret = dsp_reload(ft1000dev);
if (ret) { if (ret) {
pr_err("Problem with DSP image loading\n"); pr_err("Problem with DSP image loading\n");
...@@ -187,10 +185,10 @@ static int ft1000_probe(struct usb_interface *interface, ...@@ -187,10 +185,10 @@ static int ft1000_probe(struct usb_interface *interface,
goto err_thread; goto err_thread;
} }
msleep(100); msleep(100);
DEBUG("ft1000_probe::Waiting for Card Ready\n"); pr_debug("Waiting for Card Ready\n");
} }
DEBUG("ft1000_probe::Card Ready!!!! Registering network device\n"); pr_debug("Card Ready!!!! Registering network device\n");
ret = reg_ft1000_netdev(ft1000dev, interface); ret = reg_ft1000_netdev(ft1000dev, interface);
if (ret) if (ret)
...@@ -216,24 +214,21 @@ static void ft1000_disconnect(struct usb_interface *interface) ...@@ -216,24 +214,21 @@ static void ft1000_disconnect(struct usb_interface *interface)
struct ft1000_info *pft1000info; struct ft1000_info *pft1000info;
struct ft1000_usb *ft1000dev; struct ft1000_usb *ft1000dev;
DEBUG("ft1000_disconnect is called\n");
pft1000info = (struct ft1000_info *)usb_get_intfdata(interface); pft1000info = (struct ft1000_info *)usb_get_intfdata(interface);
DEBUG("In disconnect pft1000info=%p\n", pft1000info); pr_debug("In disconnect pft1000info=%p\n", pft1000info);
if (pft1000info) { if (pft1000info) {
ft1000dev = pft1000info->priv; ft1000dev = pft1000info->priv;
if (ft1000dev->pPollThread) if (ft1000dev->pPollThread)
kthread_stop(ft1000dev->pPollThread); kthread_stop(ft1000dev->pPollThread);
DEBUG("ft1000_disconnect: threads are terminated\n"); pr_debug("threads are terminated\n");
if (ft1000dev->net) { if (ft1000dev->net) {
DEBUG("ft1000_disconnect: destroy char driver\n"); pr_debug("destroy char driver\n");
ft1000_destroy_dev(ft1000dev->net); ft1000_destroy_dev(ft1000dev->net);
unregister_netdev(ft1000dev->net); unregister_netdev(ft1000dev->net);
DEBUG pr_debug("network device unregistered\n");
("ft1000_disconnect: network device unregistered\n");
free_netdev(ft1000dev->net); free_netdev(ft1000dev->net);
} }
...@@ -241,7 +236,7 @@ static void ft1000_disconnect(struct usb_interface *interface) ...@@ -241,7 +236,7 @@ static void ft1000_disconnect(struct usb_interface *interface)
usb_free_urb(ft1000dev->rx_urb); usb_free_urb(ft1000dev->rx_urb);
usb_free_urb(ft1000dev->tx_urb); usb_free_urb(ft1000dev->tx_urb);
DEBUG("ft1000_disconnect: urb freed\n"); pr_debug("urb freed\n");
kfree(ft1000dev); kfree(ft1000dev);
} }
......
...@@ -28,8 +28,6 @@ struct app_info_block { ...@@ -28,8 +28,6 @@ struct app_info_block {
*/ */
} __packed; } __packed;
#define DEBUG(args...) pr_info(args)
#define FALSE 0 #define FALSE 0
#define TRUE 1 #define TRUE 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册