gbsim/loopback_test: make command line interface optarg based
gbsim/loopback_test: make command line interface optarg based

Right now the command line input is clunky and requires all parameters to
be specified directly. We update here to use optarg instead and to take
sensible defaults for paths to sysfs and debugfs that ought to be static
anyway.

Mandatory arguments
   -t     must be one of the test names - sink, transfer or ping
   -i     iteration count - the number of iterations to run the test over
Optional arguments
   -S     sysfs location - location for greybus 'endo' entires default
          /sys/bus/greybus/devices/
   -D     debugfs location - location for loopback debugfs entries default
          /sys/kernel/debug/gb_loopback/
   -s     size of data packet to send during test - defaults to zero
Examples:
  looptest -t transfer -s 128 -i 10000
  looptest -t transfer -s 128 -i 10000 -S /sys/bus/greybus/devices/
           -D /sys/kernel/debug/gb_loopback/

Signed-off-by: Bryan O'Donoghue <165dc05575478af93ac2f97f67be6e1756010094@linaro.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@google.com>

gregkh/gbsim,projectara/gbsim,projectara/gbsim,gregkh/gbsim