RTEMS CPU Kit with SuperCore  4.11.2
Functions
drvmgr_drvinf.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <drvmgr/drvmgr.h>
#include "drvmgr_internal.h"
Include dependency graph for drvmgr_drvinf.c:

Functions

int drvmgr_get_dev (struct drvmgr_drv *drv, int minor, struct drvmgr_dev **pdev)
 Get Device pointer from Driver and Driver minor number. More...
 
int drvmgr_freq_get (struct drvmgr_dev *dev, int options, unsigned int *freq_hz)
 Get Bus frequency in Hertz. More...
 
int drvmgr_get_dev_prefix (struct drvmgr_dev *dev, char *dev_prefix)
 Get device name prefix, this name can be used to register a unique name in the bus->error filesystem or to get an idea where the device is located. More...
 
int drvmgr_interrupt_register (struct drvmgr_dev *dev, int index, const char *info, drvmgr_isr isr, void *arg)
 Register a shared interrupt handler. More...
 
int drvmgr_interrupt_unregister (struct drvmgr_dev *dev, int index, drvmgr_isr isr, void *arg)
 Unregister an interrupt handler. More...
 
int drvmgr_interrupt_clear (struct drvmgr_dev *dev, int index)
 Clear (ACK) pending interrupt. More...
 
int drvmgr_interrupt_unmask (struct drvmgr_dev *dev, int index)
 Force unmasking/enableing an interrupt on the interrupt controller, this is not normally used, if used the caller has masked/disabled the interrupt just before. More...
 
int drvmgr_interrupt_mask (struct drvmgr_dev *dev, int index)
 Force masking/disable an interrupt on the interrupt controller, this is not normally performed since this will stop all other (shared) ISRs to be disabled until _unmask() is called. More...
 
int drvmgr_on_rootbus (struct drvmgr_dev *dev)
 Return 0 if dev is not located on the root bus, 1 if on root bus.
 

Function Documentation

◆ drvmgr_freq_get()

int drvmgr_freq_get ( struct drvmgr_dev dev,
int  options,
unsigned int *  freq_hz 
)

Get Bus frequency in Hertz.

Frequency is stored into address of freq_hz.

Parameters
devThe Device to get Bus frequency for.
optionsBus-type specific options
freq_hzLocation where Bus Frequency will be stored.

◆ drvmgr_get_dev()

int drvmgr_get_dev ( struct drvmgr_drv drv,
int  minor,
struct drvmgr_dev **  pdev 
)

Get Device pointer from Driver and Driver minor number.

Parameters
drvDriver the device is united with.
minorDriver minor number assigned to device.
pdevLocation where the Device point will be stored.
Returns
Zero on success. -1 on failure, when device was not found in driver device list.

◆ drvmgr_get_dev_prefix()

int drvmgr_get_dev_prefix ( struct drvmgr_dev dev,
char *  dev_prefix 
)

Get device name prefix, this name can be used to register a unique name in the bus->error filesystem or to get an idea where the device is located.

Parameters
devThe Device to get the device Prefix for.
dev_prefixLocation where the prefix will be stored.

References drvmgr_bus_params::dev_prefix, drvmgr_bus::ops, and drvmgr_dev::parent.

◆ drvmgr_interrupt_clear()

int drvmgr_interrupt_clear ( struct drvmgr_dev dev,
int  index 
)

Clear (ACK) pending interrupt.

Parameters
devDevice to clear interrupt for.
indexIndex is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number.
isrInterrupt Service Routine, previously registered.
argOptional ISR argument, previously registered.

◆ drvmgr_interrupt_mask()

int drvmgr_interrupt_mask ( struct drvmgr_dev dev,
int  index 
)

Force masking/disable an interrupt on the interrupt controller, this is not normally performed since this will stop all other (shared) ISRs to be disabled until _unmask() is called.

Parameters
devDevice to mask interrupt for.
indexIndex is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number.

◆ drvmgr_interrupt_register()

int drvmgr_interrupt_register ( struct drvmgr_dev dev,
int  index,
const char *  info,
drvmgr_isr  isr,
void *  arg 
)

Register a shared interrupt handler.

Since this service is shared among interrupt drivers/handlers the handler[arg] must be installed before the interrupt can be cleared or disabled. The handler is by default disabled after registration.

Parameters
indexIndex is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number.
isrInterrupt Service Routine.
argOptional ISR argument.

◆ drvmgr_interrupt_unmask()

int drvmgr_interrupt_unmask ( struct drvmgr_dev dev,
int  index 
)

Force unmasking/enableing an interrupt on the interrupt controller, this is not normally used, if used the caller has masked/disabled the interrupt just before.

Parameters
devDevice to clear interrupt for.
indexIndex is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number.
isrInterrupt Service Routine, previously registered.
argOptional ISR argument, previously registered.

◆ drvmgr_interrupt_unregister()

int drvmgr_interrupt_unregister ( struct drvmgr_dev dev,
int  index,
drvmgr_isr  isr,
void *  arg 
)

Unregister an interrupt handler.

This also disables the interrupt before unregistering the interrupt handler.

Parameters
indexIndex is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number.
isrInterrupt Service Routine, previously registered.
argOptional ISR argument, previously registered.