From 8d91c1e411f55d7ea91b1183a2e9f8088fb4d5be Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Tue, 15 Dec 2015 14:52:16 -0300 Subject: Linux-libre 4.3.2-gnu --- drivers/staging/ft1000/ft1000-pcmcia/ft1000.h | 19 +++++++------ drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 31 +++++++++++++++------- .../staging/ft1000/ft1000-usb/ft1000_download.c | 24 ++++++++++------- drivers/staging/ft1000/ft1000-usb/ft1000_hw.c | 1 - drivers/staging/ft1000/ft1000-usb/ft1000_usb.h | 4 +-- 5 files changed, 47 insertions(+), 32 deletions(-) (limited to 'drivers/staging/ft1000') diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000.h b/drivers/staging/ft1000/ft1000-pcmcia/ft1000.h index 5992670f7..e1861cf5d 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000.h +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000.h @@ -42,17 +42,16 @@ struct ft1000_pcmcia { struct pcmcia_device; struct net_device; -extern struct net_device *init_ft1000_card(struct pcmcia_device *link, - void *ft1000_reset); -extern void stop_ft1000_card(struct net_device *dev); -extern int card_download(struct net_device *dev, const u8 *pFileStart, - size_t FileLength); +struct net_device *init_ft1000_card(struct pcmcia_device *link, + void *ft1000_reset); +void stop_ft1000_card(struct net_device *dev); +int card_download(struct net_device *dev, const u8 *pFileStart, + size_t FileLength); -extern u16 ft1000_read_dpram(struct net_device *dev, int offset); -extern void card_bootload(struct net_device *dev); -extern u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, - int Index); -extern u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset); +u16 ft1000_read_dpram(struct net_device *dev, int offset); +void card_bootload(struct net_device *dev); +u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, int Index); +u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset); void ft1000_write_dpram_mag_32(struct net_device *dev, int offset, u32 value); /* Read the value of a given ASIC register. */ diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c index 409266b1a..f241a3a5a 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c @@ -260,7 +260,8 @@ void ft1000_destroy_dev(struct net_device *netdev) /* Make sure we free any memory reserve for slow Queue */ for (i = 0; i < MAX_NUM_APP; i++) { while (list_empty(&dev->app_info[i].app_sqlist) == 0) { - pdpram_blk = list_entry(dev->app_info[i].app_sqlist.next, struct dpram_blk, list); + pdpram_blk = list_entry(dev->app_info[i].app_sqlist.next, + struct dpram_blk, list); list_del(&pdpram_blk->list); ft1000_free_buffer(pdpram_blk, &freercvpool); @@ -415,12 +416,19 @@ static long ft1000_ioctl(struct file *file, unsigned int command, struct timeval tv; struct IOCTL_GET_VER get_ver_data; struct IOCTL_GET_DSP_STAT get_stat_data; - u8 ConnectionMsg[] = {0x00, 0x44, 0x10, 0x20, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x93, 0x64, - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x37, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x7f, 0x00, - 0x00, 0x01, 0x00, 0x00}; + u8 ConnectionMsg[] = { + 0x00, 0x44, 0x10, 0x20, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x93, 0x64, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x37, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00 + }; unsigned short ledStat = 0; unsigned short conStat = 0; @@ -495,10 +503,12 @@ static long ft1000_ioctl(struct file *file, unsigned int command, memcpy(get_stat_data.eui64, info->eui64, EUISZ); 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); 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); pr_debug("ConStat = 0x%x\n", get_stat_data.ConStat); } else { @@ -689,7 +699,8 @@ static long ft1000_ioctl(struct file *file, unsigned int command, if (list_empty(&ft1000dev->app_info[i].app_sqlist) == 0) { /* pr_debug("Message detected in slow queue\n"); */ 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); ft1000dev->app_info[i].NumOfMsg--; /* pr_debug("NumOfMsg for app %d = %d\n", i, ft1000dev->app_info[i].NumOfMsg); */ diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index 5def347be..297b7aece 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c @@ -95,7 +95,6 @@ struct dsp_file_hdr { long nDspImages; /* Number of DSP images in file. */ }; -#pragma pack(1) struct dsp_image_info { long coff_date; /* Date/time when DSP Coff image was built. */ long begin_offset; /* Offset in file where image begins. */ @@ -105,7 +104,7 @@ struct dsp_image_info { long version; /* Embedded version # of DSP code. */ unsigned short checksum; /* DSP File checksum */ unsigned short pad1; -}; +} __packed; /* checks if the doorbell register is cleared */ @@ -180,7 +179,8 @@ static u16 get_handshake(struct ft1000_usb *ft1000dev, u16 expected_value) } status = ft1000_read_dpram16(ft1000dev, - DWNLD_MAG1_HANDSHAKE_LOC, (u8 *)&handshake, 1); + DWNLD_MAG1_HANDSHAKE_LOC, + (u8 *)&handshake, 1); handshake = ntohs(handshake); if (status) @@ -281,12 +281,14 @@ static u16 get_request_type(struct ft1000_usb *ft1000dev) if (ft1000dev->bootmode == 1) { status = fix_ft1000_read_dpram32(ft1000dev, - DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx); + DWNLD_MAG1_TYPE_LOC, + (u8 *)&tempx); tempx = ntohl(tempx); } else { tempx = 0; status = ft1000_read_dpram16(ft1000dev, - DWNLD_MAG1_TYPE_LOC, (u8 *)&tempword, 1); + DWNLD_MAG1_TYPE_LOC, + (u8 *)&tempword, 1); tempx |= (tempword << 16); tempx = ntohl(tempx); } @@ -304,7 +306,8 @@ static u16 get_request_type_usb(struct ft1000_usb *ft1000dev) if (ft1000dev->bootmode == 1) { status = fix_ft1000_read_dpram32(ft1000dev, - DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx); + DWNLD_MAG1_TYPE_LOC, + (u8 *)&tempx); tempx = ntohl(tempx); } else { if (ft1000dev->usbboot == 2) { @@ -332,14 +335,17 @@ static long get_request_value(struct ft1000_usb *ft1000dev) if (ft1000dev->bootmode == 1) { status = fix_ft1000_read_dpram32(ft1000dev, - DWNLD_MAG1_SIZE_LOC, (u8 *)&value); + DWNLD_MAG1_SIZE_LOC, + (u8 *)&value); value = ntohl(value); } else { status = ft1000_read_dpram16(ft1000dev, - DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 0); + DWNLD_MAG1_SIZE_LOC, + (u8 *)&tempword, 0); value = tempword; status = ft1000_read_dpram16(ft1000dev, - DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 1); + DWNLD_MAG1_SIZE_LOC, + (u8 *)&tempword, 1); value |= (tempword << 16); value = ntohl(value); } diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c index e6b5976a0..96209703b 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c @@ -842,7 +842,6 @@ static int ft1000_copy_up_pkt(struct urb *urb) skb = dev_alloc_skb(len + 12 + 2); if (skb == NULL) { - pr_debug("No Network buffers available\n"); info->stats.rx_errors++; ft1000_submit_rx_urb(info); return -1; diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h index fea60d565..9b5050fcb 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h @@ -134,8 +134,8 @@ extern spinlock_t free_buff_lock; int ft1000_create_dev(struct ft1000_usb *dev); void ft1000_destroy_dev(struct net_device *dev); -extern int card_send_command(struct ft1000_usb *ft1000dev, - void *ptempbuffer, int size); +int card_send_command(struct ft1000_usb *ft1000dev, + void *ptempbuffer, int size); struct dpram_blk *ft1000_get_buffer(struct list_head *bufflist); void ft1000_free_buffer(struct dpram_blk *pdpram_blk, struct list_head *plist); -- cgit v1.2.3-54-g00ecf