libqiprog: Store context pointer in each device struct

Some drivers may need to have access to the qiprog context. For example,
the USB host driver needs the libusb context pointer (stored in the qiprog
context) for asynchronous USB transactions. Store a pointer to the qiprog
context in each device struct.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
libqiprog: Add macros for MIN and MAX

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
usb_dev: Declare ctrl buffer inside qiprog_handle_control_request

The control buffer should not be visible outside of
qiprog_handle_control_request.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
usb_dev: Add preliminary infrastructure for bulk-reading chip

This is the minimum infrastructure needed to handle bulk reading of the
flash chip in firmware. On the VultureProg test hadware, it achieves bulk
reading with insignificant deadtime on the LPC bus.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
qiprog: Build with -Wextra, and eliminate warnings

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
libqiprog: Build with -Wextra, and eliminate warnings

CMake does not propagate compiler definitions into subirectories, so add
-Wall and -Wextra to libqiprog as well, then fix the warnings.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
buildsys: Allow libqiprog to be built standalone

Move all of libqiprog's dependencies in libqiprog/CMakeLists.txt to allow
libqiprog to be built independent of the qiprog application.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
usb_master: Implement preliminary bulk-reading of flash chip

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
usb_master: Do not rely on structs being packed

mingw32/64 and friends have a hard time understanding packed structs. Stop
relying on the structs being packed and serialize/deserialize properly.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>