gcam->data_connected = true;
- ret = gb_svc_link_config(svc, connection->intf->interface_id,
- GB_SVC_LINK_CONFIG_BURST_HS_A, 2, 2, 0);
+ ret = gb_svc_intf_set_power_mode(svc, connection->intf->interface_id,
+ GB_SVC_UNIPRO_HS_SERIES_A,
+ GB_SVC_UNIPRO_FAST_MODE, 2, 2,
+ GB_SVC_UNIPRO_FAST_MODE, 2, 2,
+ GB_SVC_PWRM_RXTERMINATION |
+ GB_SVC_PWRM_TXTERMINATION, 0);
if (ret < 0)
goto error;
- ret = gb_svc_link_config(svc, svc->ap_intf_id,
- GB_SVC_LINK_CONFIG_BURST_HS_A, 2, 2, 0);
+ ret = gb_svc_intf_set_power_mode(svc, svc->ap_intf_id,
+ GB_SVC_UNIPRO_HS_SERIES_A,
+ GB_SVC_UNIPRO_FAST_MODE, 2, 2,
+ GB_SVC_UNIPRO_FAST_MODE, 2, 2,
+ GB_SVC_PWRM_RXTERMINATION |
+ GB_SVC_PWRM_TXTERMINATION, 0);
if (ret < 0)
goto error;
#define GB_SVC_TYPE_DME_PEER_SET 0x0a
#define GB_SVC_TYPE_ROUTE_CREATE 0x0b
#define GB_SVC_TYPE_ROUTE_DESTROY 0x0c
-#define GB_SVC_TYPE_LINK_CONFIG 0x10
+#define GB_SVC_TYPE_INTF_SET_PWRM 0x10
/*
* SVC version request/response has the same payload as
__le16 result_code;
} __packed;
-#define GB_SVC_LINK_CONFIG_BURST_PWM 0
-#define GB_SVC_LINK_CONFIG_BURST_HS_A 1
-#define GB_SVC_LINK_CONFIG_BURST_HS_B 2
-#define GB_SVC_LINK_CONFIG_FLAG_AUTO_SLEEP (1 << 0)
-
-struct gb_svc_link_config_request {
- __u8 intf_id;
- __u8 burst;
- __u8 gear;
- __u8 nlanes;
- __u8 flags;
-} __packed;
-/* link config response has no payload */
-
/* Attributes for peer get/set operations */
#define DME_ATTR_SELECTOR_INDEX 0
/* FIXME: remove ES2 support and DME_ATTR_T_TST_SRC_INCREMENT */
} __packed;
/* route destroy response has no payload */
+#define GB_SVC_UNIPRO_FAST_MODE 0x01
+#define GB_SVC_UNIPRO_SLOW_MODE 0x02
+#define GB_SVC_UNIPRO_FAST_AUTO_MODE 0x04
+#define GB_SVC_UNIPRO_SLOW_AUTO_MODE 0x05
+#define GB_SVC_UNIPRO_MODE_UNCHANGED 0x07
+#define GB_SVC_UNIPRO_HIBERNATE_MODE 0x11
+#define GB_SVC_UNIPRO_OFF_MODE 0x12
+
+#define GB_SVC_PWRM_RXTERMINATION 0x01
+#define GB_SVC_PWRM_TXTERMINATION 0x02
+#define GB_SVC_PWRM_LINE_RESET 0x04
+#define GB_SVC_PWRM_SCRAMBLING 0x20
+
+#define GB_SVC_PWRM_QUIRK_HSSER 0x00000001
+
+#define GB_SVC_UNIPRO_HS_SERIES_A 0x01
+#define GB_SVC_UNIPRO_HS_SERIES_B 0x02
+
+struct gb_svc_intf_set_pwrm_request {
+ __u8 intf_id;
+ __u8 hs_series;
+ __u8 tx_mode;
+ __u8 tx_gear;
+ __u8 tx_nlanes;
+ __u8 rx_mode;
+ __u8 rx_gear;
+ __u8 rx_nlanes;
+ __u8 flags;
+ __le32 quirks;
+} __packed;
+
+struct gb_svc_intf_set_pwrm_response {
+ __le16 result_code;
+} __packed;
/* RAW */
}
}
-int gb_svc_link_config(struct gb_svc *svc, u8 intf_id,
- unsigned int burst, unsigned int gear,
- unsigned int nlanes, unsigned int flags)
+int gb_svc_intf_set_power_mode(struct gb_svc *svc, u8 intf_id, u8 hs_series,
+ u8 tx_mode, u8 tx_gear, u8 tx_nlanes,
+ u8 rx_mode, u8 rx_gear, u8 rx_nlanes,
+ u8 flags, u32 quirks)
{
- struct gb_svc_link_config_request request;
+ struct gb_svc_intf_set_pwrm_request request;
+ struct gb_svc_intf_set_pwrm_response response;
+ int ret;
request.intf_id = intf_id;
- request.burst = burst;
- request.gear = gear;
- request.nlanes = nlanes;
+ request.hs_series = hs_series;
+ request.tx_mode = tx_mode;
+ request.tx_gear = tx_gear;
+ request.tx_nlanes = tx_nlanes;
+ request.rx_mode = rx_mode;
+ request.rx_gear = rx_gear;
+ request.rx_nlanes = rx_nlanes;
request.flags = flags;
+ request.quirks = cpu_to_le32(quirks);
- return gb_operation_sync(svc->connection, GB_SVC_TYPE_LINK_CONFIG,
- &request, sizeof(request), NULL, 0);
+ ret = gb_operation_sync(svc->connection, GB_SVC_TYPE_INTF_SET_PWRM,
+ &request, sizeof(request),
+ &response, sizeof(response));
+ if (ret < 0)
+ return ret;
+
+ return le16_to_cpu(response.result_code);
}
-EXPORT_SYMBOL_GPL(gb_svc_link_config);
+EXPORT_SYMBOL_GPL(gb_svc_intf_set_power_mode);
static int gb_svc_version_request(struct gb_operation *op)
{
u32 *value);
int gb_svc_dme_peer_set(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector,
u32 value);
-int gb_svc_link_config(struct gb_svc *svc, u8 intf_id, unsigned int burst,
- unsigned int gear, unsigned int nlanes,
- unsigned int flags);
+int gb_svc_intf_set_power_mode(struct gb_svc *svc, u8 intf_id, u8 hs_series,
+ u8 tx_mode, u8 tx_gear, u8 tx_nlanes,
+ u8 rx_mode, u8 rx_gear, u8 rx_nlanes,
+ u8 flags, u32 quirks);
int gb_svc_protocol_init(void);
void gb_svc_protocol_exit(void);