fjes: ES information acquisition routine
[deliverable/linux.git] / drivers / net / fjes / fjes_hw.h
index 1b3e9cac2746cae51753977f6fef18a137b18145..cc1ef2100dc435b5b480fcb697013fde269a5551 100644 (file)
@@ -34,6 +34,12 @@ struct fjes_hw;
 #define EP_BUFFER_INFO_SIZE 4096
 
 #define FJES_DEVICE_RESET_TIMEOUT  ((17 + 1) * 3) /* sec */
+#define FJES_COMMAND_REQ_TIMEOUT  (5 + 1) /* sec */
+
+#define FJES_CMD_REQ_ERR_INFO_PARAM  (0x0001)
+#define FJES_CMD_REQ_ERR_INFO_STATUS (0x0002)
+
+#define FJES_CMD_REQ_RES_CODE_NORMAL (0)
 
 #define EP_BUFFER_SIZE \
        (((sizeof(union ep_buffer_info) + (128 * (64 * 1024))) \
@@ -50,6 +56,7 @@ struct fjes_hw;
        ((size) - sizeof(struct esmem_frame) - \
        (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN))
 
+#define FJES_DEV_COMMAND_INFO_REQ_LEN  (4)
 #define FJES_DEV_COMMAND_INFO_RES_LEN(epnum) (8 + 2 * (epnum))
 #define FJES_DEV_COMMAND_SHARE_BUFFER_REQ_LEN(txb, rxb) \
        (24 + (8 * ((txb) / EP_BUFFER_INFO_SIZE + (rxb) / EP_BUFFER_INFO_SIZE)))
@@ -124,6 +131,13 @@ union fjes_device_command_res {
        } stop_trace;
 };
 
+/* request command type */
+enum fjes_dev_command_request_type {
+       FJES_CMD_REQ_INFO               = 0x0001,
+       FJES_CMD_REQ_SHARE_BUFFER       = 0x0002,
+       FJES_CMD_REQ_UNSHARE_BUFFER     = 0x0004,
+};
+
 /* parameter for command control */
 struct fjes_device_command_param {
        u32 req_len;
@@ -133,6 +147,15 @@ struct fjes_device_command_param {
        phys_addr_t share_start;
 };
 
+/* error code for command control */
+enum fjes_dev_command_response_e {
+       FJES_CMD_STATUS_UNKNOWN,
+       FJES_CMD_STATUS_NORMAL,
+       FJES_CMD_STATUS_TIMEOUT,
+       FJES_CMD_STATUS_ERROR_PARAM,
+       FJES_CMD_STATUS_ERROR_STATUS,
+};
+
 /* EP buffer information */
 union ep_buffer_info {
        u8 raw[EP_BUFFER_INFO_SIZE];
@@ -243,6 +266,7 @@ struct fjes_hw {
 int fjes_hw_init(struct fjes_hw *);
 void fjes_hw_exit(struct fjes_hw *);
 int fjes_hw_reset(struct fjes_hw *);
+int fjes_hw_request_info(struct fjes_hw *);
 
 void fjes_hw_init_command_registers(struct fjes_hw *,
                                    struct fjes_device_command_param *);
This page took 0.025229 seconds and 5 git commands to generate.