I am trying to compile usb/modeswitch for a MIPS board. Is there any kind of requirements to make it work?
My kernel is 2.6.22.15 and gcc is 4.3.4. I already cross-compiled libusb without problems. But Im getting errors when doing so for usb_modeswitch
Code: Select all
$ mips-linux-gcc -o usb_modeswitch usb_modeswitch.c -Wall -l usb -L ../lib/ -L ../include/libusb-1.0/
usb_modeswitch.c:58:17: error: usb.h: No such file or directory
In file included from usb_modeswitch.c:59:
usb_modeswitch.h:53: warning: 'struct usb_dev_handle' declared inside parameter list
usb_modeswitch.h:53: warning: its scope is only this definition or declaration, which is probably not what you want
usb_modeswitch.c: In function 'main':
usb_modeswitch.c:416: warning: implicit declaration of function 'usb_init'
usb_modeswitch.c:419: warning: implicit declaration of function 'usb_set_debug'
usb_modeswitch.c:421: warning: implicit declaration of function 'usb_find_busses'
usb_modeswitch.c:422: warning: implicit declaration of function 'usb_find_devices'
usb_modeswitch.c:448: error: dereferencing pointer to incomplete type
usb_modeswitch.c:449: error: dereferencing pointer to incomplete type
usb_modeswitch.c:452: warning: implicit declaration of function 'usb_open'
usb_modeswitch.c:452: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:465: warning: passing argument 1 of 'get_current_configuration' from incompatible pointer type
usb_modeswitch.c:472: error: dereferencing pointer to incomplete type
usb_modeswitch.c:489: error: dereferencing pointer to incomplete type
usb_modeswitch.c:612: warning: passing argument 1 of 'get_current_configuration' from incompatible pointer type
usb_modeswitch.c:630: warning: implicit declaration of function 'usb_close'
usb_modeswitch.c: In function 'deviceDescription':
usb_modeswitch.c:693: error: dereferencing pointer to incomplete type
usb_modeswitch.c:694: warning: implicit declaration of function 'usb_get_string_simple'
usb_modeswitch.c:694: error: dereferencing pointer to incomplete type
usb_modeswitch.c:703: error: dereferencing pointer to incomplete type
usb_modeswitch.c:704: error: dereferencing pointer to incomplete type
usb_modeswitch.c:713: error: dereferencing pointer to incomplete type
usb_modeswitch.c:714: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function 'deviceInquire':
usb_modeswitch.c:746: warning: implicit declaration of function 'usb_claim_interface'
usb_modeswitch.c:751: warning: implicit declaration of function 'usb_clear_halt'
usb_modeswitch.c:753: warning: implicit declaration of function 'usb_bulk_write'
usb_modeswitch.c:759: warning: implicit declaration of function 'usb_bulk_read'
usb_modeswitch.c:786: warning: implicit declaration of function 'usb_release_interface'
usb_modeswitch.c: In function 'resetUSB':
usb_modeswitch.c:802: warning: implicit declaration of function 'sleep'
usb_modeswitch.c:804: warning: implicit declaration of function 'usb_reset'
usb_modeswitch.c: In function 'switchSendMessage':
usb_modeswitch.c:877: warning: implicit declaration of function 'usleep'
usb_modeswitch.c: In function 'switchConfiguration':
usb_modeswitch.c:900: warning: implicit declaration of function 'usb_set_configuration'
usb_modeswitch.c: In function 'switchAltSetting':
usb_modeswitch.c:919: warning: implicit declaration of function 'usb_set_altinterface'
usb_modeswitch.c: In function 'switchHuaweiMode':
usb_modeswitch.c:936: warning: implicit declaration of function 'usb_control_msg'
usb_modeswitch.c:936: error: 'USB_TYPE_STANDARD' undeclared (first use in this function)
usb_modeswitch.c:936: error: (Each undeclared identifier is reported only once
usb_modeswitch.c:936: error: for each function it appears in.)
usb_modeswitch.c:936: error: 'USB_RECIP_DEVICE' undeclared (first use in this function)
usb_modeswitch.c:936: error: 'USB_REQ_SET_FEATURE' undeclared (first use in this function)
usb_modeswitch.c: In function 'switchKobilMode':
usb_modeswitch.c:982: error: 'USB_TYPE_VENDOR' undeclared (first use in this function)
usb_modeswitch.c:982: error: 'USB_RECIP_DEVICE' undeclared (first use in this function)
usb_modeswitch.c:982: error: 'USB_ENDPOINT_IN' undeclared (first use in this function)
usb_modeswitch.c: In function 'switchSonyMode':
usb_modeswitch.c:1051: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c: In function 'switchActionMode':
usb_modeswitch.c:1085: error: 'USB_TYPE_CLASS' undeclared (first use in this function)
usb_modeswitch.c:1085: error: 'USB_RECIP_INTERFACE' undeclared (first use in this function)
usb_modeswitch.c:1088: warning: implicit declaration of function 'usb_interrupt_read'
usb_modeswitch.c:1091: warning: implicit declaration of function 'usb_interrupt_write'
usb_modeswitch.c: In function 'switchSequansMode':
usb_modeswitch.c:1139: error: 'USB_TYPE_VENDOR' undeclared (first use in this function)
usb_modeswitch.c:1139: error: 'USB_RECIP_DEVICE' undeclared (first use in this function)
usb_modeswitch.c: In function 'detachDriver':
usb_modeswitch.c:1215: warning: implicit declaration of function 'usb_get_driver_np'
usb_modeswitch.c:1233: warning: implicit declaration of function 'usb_detach_kernel_driver_np'
usb_modeswitch.c: In function 'checkSuccess':
usb_modeswitch.c:1333: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1338: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1338: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function 'search_devices':
usb_modeswitch.c:1459: warning: implicit declaration of function 'usb_get_busses'
usb_modeswitch.c:1459: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1459: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1461: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1464: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1464: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1466: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1472: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1472: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1473: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1494: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1501: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1501: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1503: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1512: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1520: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1522: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1525: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1526: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1550: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1551: warning: passing argument 1 of 'get_current_configuration' from incompatible pointer type
usb_modeswitch.c: In function 'find_first_bulk_output_endpoint':
usb_modeswitch.c:1581: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1584: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1585: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1586: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1586: error: 'USB_ENDPOINT_TYPE_MASK' undeclared (first use in this function)
usb_modeswitch.c:1586: error: 'USB_ENDPOINT_TYPE_BULK' undeclared (first use in this function)
usb_modeswitch.c:1587: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1587: error: 'USB_ENDPOINT_DIR_MASK' undeclared (first use in this function)
usb_modeswitch.c:1588: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function 'find_first_bulk_input_endpoint':
usb_modeswitch.c:1599: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1602: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1603: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1604: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1604: error: 'USB_ENDPOINT_TYPE_MASK' undeclared (first use in this function)
usb_modeswitch.c:1604: error: 'USB_ENDPOINT_TYPE_BULK' undeclared (first use in this function)
usb_modeswitch.c:1605: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1605: error: 'USB_ENDPOINT_DIR_MASK' undeclared (first use in this function)
usb_modeswitch.c:1606: error: dereferencing pointer to incomplete type
usb_modeswitch.c: At top level:
usb_modeswitch.c:1613: error: conflicting types for 'get_current_configuration'
usb_modeswitch.h:53: error: previous declaration of 'get_current_configuration' was here
usb_modeswitch.c: In function 'get_current_configuration':
usb_modeswitch.c:1618: error: 'USB_TYPE_STANDARD' undeclared (first use in this function)
usb_modeswitch.c:1618: error: 'USB_RECIP_DEVICE' undeclared (first use in this function)
usb_modeswitch.c:1618: error: 'USB_REQ_GET_CONFIGURATION' undeclared (first use in this function)
usb_modeswitch.c: In function 'get_interface0_class':
usb_modeswitch.c:1638: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1641: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1642: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1643: error: dereferencing pointer to incomplete type