⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usbhub.h

📁 SAMSUNG 5009的源代码
💻 H
字号:
/* usbhub.h - USB Hub Class header */

/* Copyright 2004 TAEBAEK Soft Corp. */

/*
modification history
--------------------
02e,28nov05,jmLee   version control sync.
02d,01aug05,jmLee   version control sync.
02c,25jul05,jmLee   version control sync.
01b,18jul05,jmLee   modify hub structure, fixing the bug when disconnect un-attached hub.
01a,26jul04,jmLee   created.
*/


#ifndef __INCusbhubh
#define __INCusbhubh


#include "usb200.h"


#ifdef  __cplusplus
extern "C" {
#endif


typedef int HUB_STATUS;

/* USB Hub Error Code Definitions */

#define HUBS_OK                         ((HUB_STATUS) 0)
#define HUBS_ERROR                      ((HUB_STATUS)-1)
#define HUBS_NO_MEMORY                  ((HUB_STATUS)-2)
#define HUBS_BIND_FAILURE               ((HUB_STATUS)-4)
#define HUBS_INVALID_SUBCLASS           ((HUB_STATUS)-5)
#define HUBS_INVALID_PROTOCOL           ((HUB_STATUS)-6)
#define HUBS_NO_ENDPOINT                ((HUB_STATUS)-7)

#define HUB_NUM_PORT                    16                  /* 0=reserved, 1 ~ 15 */

typedef struct _USBD_PORT {
    UCHAR   reserved;
    UCHAR   state;                                          /* port state */
    USHORT  status;                                         /* port status */
    PUSBD_DEVICE pdev;
} USBD_PORT, *PUSBD_PORT;

typedef struct _USBD_HUB {
    USBD_PORT ports[HUB_NUM_PORT];
    PVOID   buffer;

    /* Hub descriptor */
    UCHAR   bNbrPorts;
    UCHAR   bHubCharacteristics;
    UCHAR   bPwrOn2PwrGood;
    UCHAR   bHubContrCurrent;

    UCHAR   hub;                                            /* hub no. */
    UCHAR   state;                                          /* hub state */
    USHORT  status;                                         /* hub status */
    URB     urb;
} USBD_HUB, *PUSBD_HUB;


/* Function Prototypes */

#if defined(__STDC__) || defined(__cplusplus)

IMPORT HUB_STATUS hubInit(VOID);
IMPORT HUB_STATUS hubAttachDevice(PUSBD_DEVICE pdev);
IMPORT HUB_STATUS hubDetachDevice(PUSBD_DEVICE pdev);
IMPORT HUB_STATUS hubResetPort(PUSBD_DEVICE pdev);
IMPORT HUB_STATUS hubEnumDevice(PUSBD_DEVICE pdev);
IMPORT HUB_STATUS hubResetDevice(PUSBD_DEVICE pdev);

#else  /* defined(__STDC__) || defined(__cplusplus) */

IMPORT HUB_STATUS hubInit();
IMPORT HUB_STATUS hubAttachDevice();
IMPORT HUB_STATUS hubDetachDevice();
IMPORT HUB_STATUS hubResetPort();
IMPORT HUB_STATUS hubEnumDevice();
IMPORT HUB_STATUS hubResetDevice();

#endif  /* defined(__STDC__) || defined(__cplusplus) */


#ifdef __cplusplus
}
#endif


#endif  /* __INCusbhubh */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -