XenevaOS
Loading...
Searching...
No Matches
Macros | Functions | Variables
port.cpp File Reference
#include <stdint.h>
#include "xhci.h"
#include "usb.h"
#include <Mm/kmalloc.h>
#include <string.h>
#include <Mm/pmmngr.h>
#include <Mm/vmmngr.h>
#include <_null.h>
#include <aucon.h>
#include <Drivers/usb.h>
#include <Hal/x86_64_cpu.h>
#include <Hal/serial.h>
#include <Hal/apic.h>
Include dependency graph for port.cpp:

Macros

#define PORTSC_PLS_MASK   (0xF << 5)
 
#define PORTSC_PLS_SHIFT   5
 
#define PORTSC_LWS   (1<<16)
 

Functions

void XHCIPortReset (xhci_port_regs_t *this_port)
 
XHCISlotXHCICreateDeviceCtx (XHCIDevice *dev, uint8_t slot_num, uint8_t port_speed, uint8_t root_port_num)
 
XHCISlotXHCIGetSlot (XHCIDevice *dev, uint8_t port_num)
 
void XHCISlotReleaseEndpoints (XHCISlot *slot)
 
void XHCIPortChecLinkState (xhci_port_regs_t *this_port)
 
uint8_t XHCIRetryEnableSlot (xhci_port_regs_t *regs, XHCIDevice *dev, int port)
 
void XHCIPortInitialise (XHCIDevice *dev, unsigned int port)
 
void XHCIStartDefaultPorts (XHCIDevice *dev)
 

Variables

bool hotPlug = false
 

Macro Definition Documentation

◆ PORTSC_LWS

#define PORTSC_LWS   (1<<16)

◆ PORTSC_PLS_MASK

#define PORTSC_PLS_MASK   (0xF << 5)

◆ PORTSC_PLS_SHIFT

#define PORTSC_PLS_SHIFT   5

Function Documentation

◆ XHCICreateDeviceCtx()

XHCISlot * XHCICreateDeviceCtx ( XHCIDevice dev,
uint8_t  slot_num,
uint8_t  port_speed,
uint8_t  root_port_num 
)

◆ XHCIGetSlot()

XHCISlot * XHCIGetSlot ( XHCIDevice dev,
uint8_t  port_num 
)

◆ XHCIPortChecLinkState()

void XHCIPortChecLinkState ( xhci_port_regs_t this_port)

◆ XHCIPortInitialise()

void XHCIPortInitialise ( XHCIDevice dev,
unsigned int  port 
)

BSD 2-Clause License

Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ XHCIPortReset()

void XHCIPortReset ( xhci_port_regs_t this_port)

BSD 2-Clause License

Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ XHCIRetryEnableSlot()

uint8_t XHCIRetryEnableSlot ( xhci_port_regs_t regs,
XHCIDevice dev,
int  port 
)

◆ XHCISlotReleaseEndpoints()

void XHCISlotReleaseEndpoints ( XHCISlot slot)

◆ XHCIStartDefaultPorts()

void XHCIStartDefaultPorts ( XHCIDevice dev)

Variable Documentation

◆ hotPlug

bool hotPlug = false