drivers: Simplify headers

Remove all the headers already included through "fp_internal.h" such as
<libusb.h> and <errno.h>, include "assembling.h" and "driver_ids.h" there
as well to avoid doing it in (almost) every driver.
This commit is contained in:
Bastien Nocera 2018-05-24 17:02:15 +02:00
parent 501020921e
commit 994061af44
23 changed files with 18 additions and 200 deletions

View file

@ -26,16 +26,7 @@
#define FP_COMPONENT "aes1610" #define FP_COMPONENT "aes1610"
#include "fp_internal.h" #include "fp_internal.h"
#include "aeslib.h"
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include <assembling.h>
#include <aeslib.h>
#include "driver_ids.h"
static void start_capture(struct fp_img_dev *dev); static void start_capture(struct fp_img_dev *dev);
static void complete_deactivation(struct fp_img_dev *dev); static void complete_deactivation(struct fp_img_dev *dev);

View file

@ -20,21 +20,9 @@
#define FP_COMPONENT "aes1660" #define FP_COMPONENT "aes1660"
#include "fp_internal.h" #include "fp_internal.h"
#include "aeslib.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include <assembling.h>
#include <aeslib.h>
#include "aesx660.h" #include "aesx660.h"
#include "aes1660.h" #include "aes1660.h"
#include "driver_ids.h"
#define FRAME_WIDTH 128 #define FRAME_WIDTH 128
#define IMAGE_WIDTH (FRAME_WIDTH + (FRAME_WIDTH / 2)) #define IMAGE_WIDTH (FRAME_WIDTH + (FRAME_WIDTH / 2))

View file

@ -24,17 +24,8 @@
#define FP_COMPONENT "aes2501" #define FP_COMPONENT "aes2501"
#include "fp_internal.h" #include "fp_internal.h"
#include "aeslib.h"
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include <assembling.h>
#include <aeslib.h>
#include "aes2501.h" #include "aes2501.h"
#include "driver_ids.h"
static void start_capture(struct fp_img_dev *dev); static void start_capture(struct fp_img_dev *dev);
static void complete_deactivation(struct fp_img_dev *dev); static void complete_deactivation(struct fp_img_dev *dev);

View file

@ -24,17 +24,8 @@
#define FP_COMPONENT "aes2550" #define FP_COMPONENT "aes2550"
#include "fp_internal.h" #include "fp_internal.h"
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include <assembling.h>
#include <aeslib.h>
#include "aes2550.h" #include "aes2550.h"
#include "driver_ids.h" #include "aeslib.h"
static void start_capture(struct fp_img_dev *dev); static void start_capture(struct fp_img_dev *dev);
static void complete_deactivation(struct fp_img_dev *dev); static void complete_deactivation(struct fp_img_dev *dev);

View file

@ -20,20 +20,9 @@
#define FP_COMPONENT "aes2660" #define FP_COMPONENT "aes2660"
#include "fp_internal.h" #include "fp_internal.h"
#include "aeslib.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include <assembling.h>
#include <aeslib.h>
#include "aesx660.h" #include "aesx660.h"
#include "aes2660.h" #include "aes2660.h"
#include "driver_ids.h"
#define FRAME_WIDTH 192 #define FRAME_WIDTH 192
#define IMAGE_WIDTH (FRAME_WIDTH + (FRAME_WIDTH / 2)) #define IMAGE_WIDTH (FRAME_WIDTH + (FRAME_WIDTH / 2))

View file

@ -30,16 +30,8 @@
#define FP_COMPONENT "aes3500" #define FP_COMPONENT "aes3500"
#include "fp_internal.h" #include "fp_internal.h"
#include "aeslib.h"
#include <errno.h>
#include <glib.h>
#include <libusb.h>
#include <aeslib.h>
#include "aes3k.h" #include "aes3k.h"
#include "driver_ids.h"
#define DATA_BUFLEN 0x2089 #define DATA_BUFLEN 0x2089

View file

@ -37,14 +37,7 @@
#define FP_COMPONENT "aes3k" #define FP_COMPONENT "aes3k"
#include "fp_internal.h" #include "fp_internal.h"
#include "aeslib.h"
#include <errno.h>
#include <glib.h>
#include <libusb.h>
#include <aeslib.h>
#include "aes3k.h" #include "aes3k.h"
#define CTRL_TIMEOUT 1000 #define CTRL_TIMEOUT 1000

View file

@ -27,16 +27,8 @@
#define FP_COMPONENT "aes4000" #define FP_COMPONENT "aes4000"
#include "fp_internal.h" #include "fp_internal.h"
#include "aeslib.h"
#include <errno.h>
#include <glib.h>
#include <libusb.h>
#include <aeslib.h>
#include "aes3k.h" #include "aes3k.h"
#include "driver_ids.h"
#define DATA_BUFLEN 0x1259 #define DATA_BUFLEN 0x1259

View file

@ -24,17 +24,7 @@
#define FP_COMPONENT "aesX660" #define FP_COMPONENT "aesX660"
#include "fp_internal.h" #include "fp_internal.h"
#include "aeslib.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include <assembling.h>
#include <aeslib.h>
#include "aesx660.h" #include "aesx660.h"
static void start_capture(struct fp_img_dev *dev); static void start_capture(struct fp_img_dev *dev);

View file

@ -21,14 +21,7 @@
#define FP_COMPONENT "elan" #define FP_COMPONENT "elan"
#include "fp_internal.h" #include "fp_internal.h"
#include <errno.h>
#include <libusb.h>
#include <assembling.h>
#include <fprint.h>
#include "elan.h" #include "elan.h"
#include "driver_ids.h"
unsigned char elan_get_pixel(struct fpi_frame_asmbl_ctx *ctx, unsigned char elan_get_pixel(struct fpi_frame_asmbl_ctx *ctx,
struct fpi_frame *frame, unsigned int x, struct fpi_frame *frame, unsigned int x,

View file

@ -36,15 +36,6 @@
#define FP_COMPONENT "etes603" #define FP_COMPONENT "etes603"
#include "fp_internal.h" #include "fp_internal.h"
#include <string.h>
#include <stdint.h>
#include <stdarg.h>
#include <errno.h>
#include <assert.h>
#include <libusb.h>
#include <glib.h>
#include "driver_ids.h" #include "driver_ids.h"
/* libusb defines */ /* libusb defines */

View file

@ -21,14 +21,6 @@
#include "fp_internal.h" #include "fp_internal.h"
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <libusb.h>
#include "driver_ids.h"
#ifndef HAVE_MEMMEM #ifndef HAVE_MEMMEM
gpointer gpointer
memmem(const gpointer haystack, size_t haystack_len, const gpointer needle, size_t needle_len) { memmem(const gpointer haystack, size_t haystack_len, const gpointer needle, size_t needle_len) {

View file

@ -26,17 +26,7 @@
#define FP_COMPONENT "upeksonly" #define FP_COMPONENT "upeksonly"
#include "fp_internal.h" #include "fp_internal.h"
#include <errno.h>
#include <string.h>
#include <glib.h>
#include <libusb.h>
#include <assembling.h>
#include "upeksonly.h" #include "upeksonly.h"
#include "driver_ids.h"
#define CTRL_TIMEOUT 1000 #define CTRL_TIMEOUT 1000
#define NUM_BULK_TRANSFERS 24 #define NUM_BULK_TRANSFERS 24

View file

@ -21,13 +21,7 @@
#define FP_COMPONENT "upektc" #define FP_COMPONENT "upektc"
#include "fp_internal.h" #include "fp_internal.h"
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include "upektc.h" #include "upektc.h"
#include "driver_ids.h"
#define UPEKTC_EP_IN (2 | LIBUSB_ENDPOINT_IN) #define UPEKTC_EP_IN (2 | LIBUSB_ENDPOINT_IN)
#define UPEKTC_EP_OUT (3 | LIBUSB_ENDPOINT_OUT) #define UPEKTC_EP_OUT (3 | LIBUSB_ENDPOINT_OUT)

View file

@ -20,16 +20,8 @@
#define FP_COMPONENT "upektc_img" #define FP_COMPONENT "upektc_img"
#include "fp_internal.h" #include "fp_internal.h"
#include "aeslib.h"
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include <aeslib.h>
#include "upektc_img.h" #include "upektc_img.h"
#include "driver_ids.h"
static void start_capture(struct fp_img_dev *dev); static void start_capture(struct fp_img_dev *dev);
static void start_deactivation(struct fp_img_dev *dev); static void start_deactivation(struct fp_img_dev *dev);

View file

@ -29,14 +29,6 @@
#include "fp_internal.h" #include "fp_internal.h"
#include <errno.h>
#include <string.h>
#include <glib.h>
#include <libusb.h>
#include "driver_ids.h"
#define EP_IN (1 | LIBUSB_ENDPOINT_IN) #define EP_IN (1 | LIBUSB_ENDPOINT_IN)
#define EP_OUT (2 | LIBUSB_ENDPOINT_OUT) #define EP_OUT (2 | LIBUSB_ENDPOINT_OUT)
#define TIMEOUT 5000 #define TIMEOUT 5000

View file

@ -20,17 +20,10 @@
#define FP_COMPONENT "uru4000" #define FP_COMPONENT "uru4000"
#include "fp_internal.h"
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <nss.h> #include <nss.h>
#include <pk11pub.h> #include <pk11pub.h>
#include <libusb.h>
#include "driver_ids.h" #include "fp_internal.h"
#define EP_INTR (1 | LIBUSB_ENDPOINT_IN) #define EP_INTR (1 | LIBUSB_ENDPOINT_IN)
#define EP_DATA (2 | LIBUSB_ENDPOINT_IN) #define EP_DATA (2 | LIBUSB_ENDPOINT_IN)

View file

@ -28,14 +28,6 @@
* powerdown? does windows do anything special on exit? * powerdown? does windows do anything special on exit?
*/ */
#include <errno.h>
#include <string.h>
#include <glib.h>
#include <libusb.h>
#include "driver_ids.h"
#define CTRL_IN 0xc0 #define CTRL_IN 0xc0
#define CTRL_OUT 0x40 #define CTRL_OUT 0x40
#define CTRL_TIMEOUT 1000 #define CTRL_TIMEOUT 1000

View file

@ -20,12 +20,6 @@
#define FP_COMPONENT "vfs0050" #define FP_COMPONENT "vfs0050"
#include "fp_internal.h" #include "fp_internal.h"
#include <errno.h>
#include <string.h>
#include <assembling.h>
#include "driver_ids.h"
#include "vfs0050.h" #include "vfs0050.h"
/* USB functions */ /* USB functions */

View file

@ -21,12 +21,6 @@
#include "fp_internal.h" #include "fp_internal.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "driver_ids.h"
/* Input-Output usb endpoint */ /* Input-Output usb endpoint */
#define EP_IN(n) (n | LIBUSB_ENDPOINT_IN) #define EP_IN(n) (n | LIBUSB_ENDPOINT_IN)
#define EP_OUT(n) (n | LIBUSB_ENDPOINT_OUT) #define EP_OUT(n) (n | LIBUSB_ENDPOINT_OUT)

View file

@ -22,19 +22,7 @@
#define FP_COMPONENT "vfs301" #define FP_COMPONENT "vfs301"
#include "fp_internal.h" #include "fp_internal.h"
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <libusb-1.0/libusb.h>
#include "vfs301_proto.h" #include "vfs301_proto.h"
#include <unistd.h>
#include "driver_ids.h"
/************************** GENERIC STUFF *************************************/ /************************** GENERIC STUFF *************************************/
@ -152,7 +140,7 @@ static void m_loop_state(struct fpi_ssm *ssm)
case M_READ_PRINT_POLL: case M_READ_PRINT_POLL:
{ {
int rv = vfs301_proto_process_event_poll(dev->udev, vdev); int rv = vfs301_proto_process_event_poll(dev->udev, vdev);
assert(rv != VFS301_FAILURE); g_assert(rv != VFS301_FAILURE);
if (rv == VFS301_ONGOING) if (rv == VFS301_ONGOING)
fpi_ssm_jump_to_state(ssm, M_READ_PRINT_WAIT); fpi_ssm_jump_to_state(ssm, M_READ_PRINT_WAIT);
else else
@ -185,7 +173,7 @@ static void m_init_state(struct fpi_ssm *ssm)
struct fp_img_dev *dev = ssm->priv; struct fp_img_dev *dev = ssm->priv;
vfs301_dev_t *vdev = dev->priv; vfs301_dev_t *vdev = dev->priv;
assert(ssm->cur_state == 0); g_assert(ssm->cur_state == 0);
vfs301_proto_init(dev->udev, vdev); vfs301_proto_init(dev->udev, vdev);

View file

@ -18,14 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <stdio.h> #include "fp_internal.h"
#include <errno.h>
#include <string.h>
#include <libusb.h>
#include <fp_internal.h>
#include <assembling.h>
#include "driver_ids.h"
#include "vfs5011_proto.h" #include "vfs5011_proto.h"
/* =================== sync/async USB transfer sequence ==================== */ /* =================== sync/async USB transfer sequence ==================== */

View file

@ -28,10 +28,13 @@
#endif #endif
#include <stdint.h> #include <stdint.h>
#include <errno.h>
#include <glib.h> #include <glib.h>
#include <libusb.h> #include <libusb.h>
#include <fprint.h> #include "fprint.h"
#include "assembling.h"
#include "drivers/driver_ids.h"
#define array_n_elements(array) (sizeof(array) / sizeof(array[0])) #define array_n_elements(array) (sizeof(array) / sizeof(array[0]))