Home | History | Annotate | Download | only in hid
      1 /******************************************************************************
      2  *
      3  *  Copyright 2002-2012 Broadcom Corporation
      4  *
      5  *  Licensed under the Apache License, Version 2.0 (the "License");
      6  *  you may not use this file except in compliance with the License.
      7  *  You may obtain a copy of the License at:
      8  *
      9  *  http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  *
     17  ******************************************************************************/
     18 
     19 /******************************************************************************
     20  *
     21  *  This file contains HID connection internal definitions
     22  *
     23  ******************************************************************************/
     24 
     25 #ifndef HID_CONN_H
     26 #define HID_CONN_H
     27 
     28 #include "osi/include/alarm.h"
     29 
     30 /* Define the HID Connection Block
     31 */
     32 typedef struct hid_conn {
     33 #define HID_CONN_STATE_UNUSED (0)
     34 #define HID_CONN_STATE_CONNECTING_CTRL (1)
     35 #define HID_CONN_STATE_CONNECTING_INTR (2)
     36 #define HID_CONN_STATE_CONFIG (3)
     37 #define HID_CONN_STATE_CONNECTED (4)
     38 #define HID_CONN_STATE_DISCONNECTING (5)
     39 #define HID_CONN_STATE_SECURITY (6)
     40 
     41   uint8_t conn_state;
     42 
     43 #define HID_CONN_FLAGS_IS_ORIG (0x01)
     44 #define HID_CONN_FLAGS_HIS_CTRL_CFG_DONE (0x02)
     45 #define HID_CONN_FLAGS_MY_CTRL_CFG_DONE (0x04)
     46 #define HID_CONN_FLAGS_HIS_INTR_CFG_DONE (0x08)
     47 #define HID_CONN_FLAGS_MY_INTR_CFG_DONE (0x10)
     48 #define HID_CONN_FLAGS_ALL_CONFIGURED (0x1E) /* All the config done */
     49 #define HID_CONN_FLAGS_CONGESTED (0x20)
     50 #define HID_CONN_FLAGS_INACTIVE (0x40)
     51 
     52   uint8_t conn_flags;
     53 
     54   uint8_t ctrl_id;
     55   uint16_t ctrl_cid;
     56   uint16_t intr_cid;
     57   uint16_t rem_mtu_size;
     58   uint16_t disc_reason; /* Reason for disconnecting (for HID_HDEV_EVT_CLOSE) */
     59   alarm_t* process_repage_timer;
     60 } tHID_CONN;
     61 
     62 #define HID_SEC_CHN 1
     63 #define HID_NOSEC_CHN 2
     64 
     65 #define HIDD_SEC_CHN 3
     66 #define HIDD_NOSEC_CHN 4
     67 
     68 #endif
     69