laforge has submitted this change. ( https://gerrit.osmocom.org/c/dahdi-linux/+/26967 )
Change subject: icE1usb: update ice1usb_proto.h to firmware 0.2-8 ......................................................................
icE1usb: update ice1usb_proto.h to firmware 0.2-8
git revision cac342af6bccc9820a8617f900afaf663ad608ed of https://git.osmocom.org/osmo-e1-hardware
Change-Id: I1423531470a1c9165d713108fb6a87ff47ff6e29 --- M drivers/dahdi/icE1usb/icE1usb.c M drivers/dahdi/icE1usb/ice1usb_proto.h 2 files changed, 51 insertions(+), 1 deletion(-)
Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/drivers/dahdi/icE1usb/icE1usb.c b/drivers/dahdi/icE1usb/icE1usb.c index 13af6fc..87a7422 100644 --- a/drivers/dahdi/icE1usb/icE1usb.c +++ b/drivers/dahdi/icE1usb/icE1usb.c @@ -1013,6 +1013,8 @@ dev_err(&intf->dev, "Cannot find ON altsetting"); goto error; } + dev_info(&intf->dev, "altsetting off=%u, on=%u\n", + ieu->alt_off->desc.bAlternateSetting, ieu->alt_on->desc.bAlternateSetting);
/* locate ON / OFF altsettings */ if (find_endpoints(ieu, ieu->alt_on) < 4) { @@ -1035,6 +1037,7 @@ //ddev->location = USB_BUS_PATH;
dspan = &ieu->dahdi.span; + /* TODO: include USB path info? */ snprintf(dspan->name, sizeof(dspan->name), "icE1usb/1/%d", ieu->alt_on->desc.bInterfaceNumber); //TDOO: device != 1 snprintf(dspan->desc, sizeof(dspan->desc), "Osmocom icE1USB Card 1 Span %d", diff --git a/drivers/dahdi/icE1usb/ice1usb_proto.h b/drivers/dahdi/icE1usb/ice1usb_proto.h index d0d7304..3170d55 100644 --- a/drivers/dahdi/icE1usb/ice1usb_proto.h +++ b/drivers/dahdi/icE1usb/ice1usb_proto.h @@ -23,8 +23,54 @@ ICE1USB_DEV_CAP_GPSDO, };
+/*********************************************************************** + * Control Endpoint / GPS-DO Interface Requests + ***********************************************************************/
-/* Interface Requests */ +#define ICE1USB_INTF_GET_GPSDO_STATUS 0x10 +#define ICE1USB_INTF_GET_GPSDO_MODE 0x12 /*!< uint8_t */ +#define ICE1USB_INTF_SET_GPSDO_MODE 0x13 /*!< wValue = mode */ +#define ICE1USB_INTF_GET_GPSDO_TUNE 0x14 /*!< data = struct e1usb_gpsdo_tune */ +#define ICE1USB_INTF_SET_GPSDO_TUNE 0x15 /*!< data = struct e1usb_gpsdo_tune */ + +enum ice1usb_gpsdo_mode { + ICE1USB_GPSDO_MODE_DISABLED = 0, + ICE1USB_GPSDO_MODE_AUTO = 1, +}; + +enum ice1usb_gpsdo_antenna_state { + ICE1USB_GPSDO_ANT_UNKNOWN = 0, + ICE1USB_GPSDO_ANT_OK = 1, + ICE1USB_GPSDO_ANT_OPEN = 2, + ICE1USB_GPSDO_ANT_SHORT = 3, +}; + +enum ice1usb_gpsdo_state { + ICE1USB_GPSDO_STATE_DISABLED = 0, + ICE1USB_GPSDO_STATE_CALIBRATE = 1, + ICE1USB_GPSDO_STATE_HOLD_OVER = 2, + ICE1USB_GPSDO_STATE_TUNE_COARSE = 3, + ICE1USB_GPSDO_STATE_TUNE_FINE = 4, +}; + +struct e1usb_gpsdo_tune { + uint16_t coarse; + uint16_t fine; +} __attribute__((packed)); + +struct e1usb_gpsdo_status { + uint8_t state; + uint8_t antenna_state; /*!< Antenna state */ + uint8_t valid_fix; /*!< Valid GPS Fix (0/1) */ + uint8_t mode; /*!< Current configured operating mode */ + struct e1usb_gpsdo_tune tune; /*!< Current VCXO tuning values */ + uint32_t freq_est; /*!< Latest frequency estimate measurement */ +} __attribute__((packed)); + + +/*********************************************************************** + * Control Endpoint / E1 Interface Requests + ***********************************************************************/
/*! returns a bit-mask of optional device capabilities (see enum e1usb_intf_capability) */ #define ICE1USB_INTF_GET_CAPABILITIES 0x01 @@ -32,6 +78,7 @@ #define ICE1USB_INTF_GET_TX_CFG 0x03 /*!< struct ice1usb_tx_config */ #define ICE1USB_INTF_SET_RX_CFG 0x04 /*!< struct ice1usb_rx_config */ #define ICE1USB_INTF_GET_RX_CFG 0x05 /*!< struct ice1usb_rx_config */ +#define ICE1USB_INTF_GET_ERRORS 0x06 /*!< struct ice1usb_irq_err */
//enum e1usb_intf_capability { };