Replace u16_t by uint16_t
This commit is contained in:
@@ -522,7 +522,7 @@ static void do_io(config_t *cpe, struct rs_start *rs_start)
|
||||
|
||||
static void do_pci_device(config_t *cpe, struct rs_start *rs_start)
|
||||
{
|
||||
u16_t vid, did, sub_vid, sub_did;
|
||||
uint16_t vid, did, sub_vid, sub_did;
|
||||
char *check, *check2;
|
||||
|
||||
/* Process a list of PCI device IDs */
|
||||
|
||||
@@ -22,7 +22,7 @@ static int free_buf(u32_t *val, int *len, int num);
|
||||
static int dev_reset(u32_t *base);
|
||||
static void dev_configure(u32_t *base);
|
||||
static void dev_init_mixer(u32_t *base);
|
||||
static void dev_set_sample_rate(u32_t *base, u16_t sample_rate);
|
||||
static void dev_set_sample_rate(u32_t *base, uint16_t sample_rate);
|
||||
static void dev_set_format(u32_t *base, u32_t bits, u32_t sign,
|
||||
u32_t stereo, u32_t sample_count);
|
||||
static void dev_start_channel(u32_t *base, int sub_dev);
|
||||
@@ -122,7 +122,7 @@ static void dev_init_mixer(u32_t *base) {
|
||||
}
|
||||
|
||||
/* Set DAC and ADC sample rate (### SET_SAMPLE_RATE ###) */
|
||||
static void dev_set_sample_rate(u32_t *base, u16_t sample_rate) {
|
||||
static void dev_set_sample_rate(u32_t *base, uint16_t sample_rate) {
|
||||
u32_t base0 = base[0];
|
||||
dev_command(base0, CMD_SAMPLE_RATE_OUT);
|
||||
dev_command(base0, sample_rate >> 8);
|
||||
@@ -269,7 +269,7 @@ static void dev_intr_enable(u32_t *base, int flag) {
|
||||
static int dev_probe(void) {
|
||||
int devind, i, ioflag;
|
||||
u32_t device, bar, size, base;
|
||||
u16_t vid, did, temp;
|
||||
uint16_t vid, did, temp;
|
||||
uint8_t *reg;
|
||||
|
||||
pci_init();
|
||||
|
||||
@@ -89,7 +89,7 @@ static u32_t g_sample_rate[] = {
|
||||
/* Driver Data Structure */
|
||||
typedef struct aud_sub_dev_conf_t {
|
||||
u32_t stereo;
|
||||
u16_t sample_rate;
|
||||
uint16_t sample_rate;
|
||||
u32_t nr_of_bits;
|
||||
u32_t sign;
|
||||
u32_t busy;
|
||||
@@ -99,8 +99,8 @@ typedef struct aud_sub_dev_conf_t {
|
||||
|
||||
typedef struct DEV_STRUCT {
|
||||
char *name;
|
||||
u16_t vid;
|
||||
u16_t did;
|
||||
uint16_t vid;
|
||||
uint16_t did;
|
||||
u32_t devind;
|
||||
u32_t base[6];
|
||||
char irq;
|
||||
|
||||
@@ -19,16 +19,16 @@ static uint8_t my_inb(u32_t port) {
|
||||
}
|
||||
#define sdr_in8(port, offset) (my_inb((port) + (offset)))
|
||||
|
||||
static u16_t my_inw(u32_t port) {
|
||||
static uint16_t my_inw(u32_t port) {
|
||||
u32_t value;
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
value = *(volatile u16_t *)(port);
|
||||
value = *(volatile uint16_t *)(port);
|
||||
#else
|
||||
if ((r = sys_inw(port, &value)) != OK)
|
||||
printf("SDR: sys_inw failed: %d\n", r);
|
||||
#endif
|
||||
return (u16_t)value;
|
||||
return (uint16_t)value;
|
||||
}
|
||||
#define sdr_in16(port, offset) (my_inw((port) + (offset)))
|
||||
|
||||
@@ -60,9 +60,9 @@ static void my_outb(u32_t port, u32_t value) {
|
||||
static void my_outw(u32_t port, u32_t value) {
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
*(volatile u16_t *)(port) = value;
|
||||
*(volatile uint16_t *)(port) = value;
|
||||
#else
|
||||
if ((r = sys_outw(port, (u16_t)value)) != OK)
|
||||
if ((r = sys_outw(port, (uint16_t)value)) != OK)
|
||||
printf("SDR: sys_outw failed: %d\n", r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -205,8 +205,8 @@ int get_set_volume(u32_t *base, struct volume_level *level, int flag) {
|
||||
else {
|
||||
/* ### READ_MIXER_REG ### */
|
||||
data = dev_mixer_read(base, cmd);
|
||||
level->left = (u16_t)(data >> 8);
|
||||
level->right = (u16_t)(data & 0xff);
|
||||
level->left = (uint16_t)(data >> 8);
|
||||
level->right = (uint16_t)(data & 0xff);
|
||||
if (level->right < 0)
|
||||
level->right = 0;
|
||||
else if (level->right > max_level)
|
||||
|
||||
@@ -22,7 +22,7 @@ static int free_buf(u32_t *val, int *len, int num);
|
||||
static int dev_reset(u32_t *base);
|
||||
static void dev_configure(u32_t *base);
|
||||
static void dev_init_mixer(u32_t *base);
|
||||
static void dev_set_sample_rate(u32_t *base, u16_t sample_rate);
|
||||
static void dev_set_sample_rate(u32_t *base, uint16_t sample_rate);
|
||||
static void dev_set_format(u32_t *base, u32_t bits, u32_t sign,
|
||||
u32_t stereo, u32_t sample_count);
|
||||
static void dev_start_channel(u32_t *base, int sub_dev);
|
||||
@@ -96,7 +96,7 @@ static void dev_init_mixer(u32_t *base) {
|
||||
}
|
||||
|
||||
/* Set DAC and ADC sample rate (### SET_SAMPLE_RATE ###) */
|
||||
static void dev_set_sample_rate(u32_t *base, u16_t sample_rate) {
|
||||
static void dev_set_sample_rate(u32_t *base, uint16_t sample_rate) {
|
||||
int i;
|
||||
u32_t data, rate = 0, base0 = base[0];
|
||||
for (i = 0; i < 8; i++) {
|
||||
@@ -225,7 +225,7 @@ static void dev_intr_enable(u32_t *base, int flag) {
|
||||
static int dev_probe(void) {
|
||||
int devind, i, ioflag;
|
||||
u32_t device, bar, size, base;
|
||||
u16_t vid, did, temp;
|
||||
uint16_t vid, did, temp;
|
||||
uint8_t *reg;
|
||||
|
||||
pci_init();
|
||||
|
||||
@@ -88,7 +88,7 @@ static u32_t g_sample_rate[] = {
|
||||
/* Driver Data Structure */
|
||||
typedef struct aud_sub_dev_conf_t {
|
||||
u32_t stereo;
|
||||
u16_t sample_rate;
|
||||
uint16_t sample_rate;
|
||||
u32_t nr_of_bits;
|
||||
u32_t sign;
|
||||
u32_t busy;
|
||||
@@ -98,8 +98,8 @@ typedef struct aud_sub_dev_conf_t {
|
||||
|
||||
typedef struct DEV_STRUCT {
|
||||
char *name;
|
||||
u16_t vid;
|
||||
u16_t did;
|
||||
uint16_t vid;
|
||||
uint16_t did;
|
||||
u32_t devind;
|
||||
u32_t base[6];
|
||||
char irq;
|
||||
|
||||
@@ -19,16 +19,16 @@ static uint8_t my_inb(u32_t port) {
|
||||
}
|
||||
#define sdr_in8(port, offset) (my_inb((port) + (offset)))
|
||||
|
||||
static u16_t my_inw(u32_t port) {
|
||||
static uint16_t my_inw(u32_t port) {
|
||||
u32_t value;
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
value = *(volatile u16_t *)(port);
|
||||
value = *(volatile uint16_t *)(port);
|
||||
#else
|
||||
if ((r = sys_inw(port, &value)) != OK)
|
||||
printf("SDR: sys_inw failed: %d\n", r);
|
||||
#endif
|
||||
return (u16_t)value;
|
||||
return (uint16_t)value;
|
||||
}
|
||||
#define sdr_in16(port, offset) (my_inw((port) + (offset)))
|
||||
|
||||
@@ -60,9 +60,9 @@ static void my_outb(u32_t port, u32_t value) {
|
||||
static void my_outw(u32_t port, u32_t value) {
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
*(volatile u16_t *)(port) = value;
|
||||
*(volatile uint16_t *)(port) = value;
|
||||
#else
|
||||
if ((r = sys_outw(port, (u16_t)value)) != OK)
|
||||
if ((r = sys_outw(port, (uint16_t)value)) != OK)
|
||||
printf("SDR: sys_outw failed: %d\n", r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -205,8 +205,8 @@ int get_set_volume(u32_t *base, struct volume_level *level, int flag) {
|
||||
else {
|
||||
/* ### READ_MIXER_REG ### */
|
||||
data = dev_mixer_read(base, cmd);
|
||||
level->left = (u16_t)(data >> 8);
|
||||
level->right = (u16_t)(data & 0xff);
|
||||
level->left = (uint16_t)(data >> 8);
|
||||
level->right = (uint16_t)(data & 0xff);
|
||||
if (level->right < 0)
|
||||
level->right = 0;
|
||||
else if (level->right > max_level)
|
||||
|
||||
@@ -22,7 +22,7 @@ static int free_buf(u32_t *val, int *len, int num);
|
||||
static int dev_reset(u32_t *base);
|
||||
static void dev_configure(u32_t *base);
|
||||
static void dev_init_mixer(u32_t *base);
|
||||
static void dev_set_sample_rate(u32_t *base, u16_t sample_rate);
|
||||
static void dev_set_sample_rate(u32_t *base, uint16_t sample_rate);
|
||||
static void dev_set_format(u32_t *base, u32_t bits, u32_t sign,
|
||||
u32_t stereo, u32_t sample_count);
|
||||
static void dev_start_channel(u32_t *base, int sub_dev);
|
||||
@@ -132,7 +132,7 @@ static void dev_init_mixer(u32_t *base) {
|
||||
}
|
||||
|
||||
/* Set DAC and ADC sample rate (### SET_SAMPLE_RATE ###) */
|
||||
static void dev_set_sample_rate(u32_t *base, u16_t sample_rate) {
|
||||
static void dev_set_sample_rate(u32_t *base, uint16_t sample_rate) {
|
||||
u32_t i, data = 0, base0 = base[0];
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (g_sample_rate[i] == sample_rate) {
|
||||
@@ -233,7 +233,7 @@ static u32_t dev_read_dma_current(u32_t *base, int sub_dev) {
|
||||
else if (sub_dev == ADC)
|
||||
data = sdr_in16(base0, REG_ADC_DCC);
|
||||
data &= 0xffff;
|
||||
return (u16_t)data;
|
||||
return (uint16_t)data;
|
||||
}
|
||||
|
||||
/* Pause the DMA (### PAUSE_DMA ###) */
|
||||
@@ -300,7 +300,7 @@ static void dev_intr_enable(u32_t *base, int flag) {
|
||||
static int dev_probe(void) {
|
||||
int devind, i, ioflag;
|
||||
u32_t device, bar, size, base;
|
||||
u16_t vid, did, temp;
|
||||
uint16_t vid, did, temp;
|
||||
uint8_t *reg;
|
||||
|
||||
pci_init();
|
||||
|
||||
@@ -114,7 +114,7 @@ static u32_t g_sample_rate[] = {
|
||||
/* Driver Data Structure */
|
||||
typedef struct aud_sub_dev_conf_t {
|
||||
u32_t stereo;
|
||||
u16_t sample_rate;
|
||||
uint16_t sample_rate;
|
||||
u32_t nr_of_bits;
|
||||
u32_t sign;
|
||||
u32_t busy;
|
||||
@@ -124,8 +124,8 @@ typedef struct aud_sub_dev_conf_t {
|
||||
|
||||
typedef struct DEV_STRUCT {
|
||||
char *name;
|
||||
u16_t vid;
|
||||
u16_t did;
|
||||
uint16_t vid;
|
||||
uint16_t did;
|
||||
u32_t devind;
|
||||
u32_t base[6];
|
||||
char irq;
|
||||
|
||||
@@ -19,16 +19,16 @@ static uint8_t my_inb(u32_t port) {
|
||||
}
|
||||
#define sdr_in8(port, offset) (my_inb((port) + (offset)))
|
||||
|
||||
static u16_t my_inw(u32_t port) {
|
||||
static uint16_t my_inw(u32_t port) {
|
||||
u32_t value;
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
value = *(volatile u16_t *)(port);
|
||||
value = *(volatile uint16_t *)(port);
|
||||
#else
|
||||
if ((r = sys_inw(port, &value)) != OK)
|
||||
printf("SDR: sys_inw failed: %d\n", r);
|
||||
#endif
|
||||
return (u16_t)value;
|
||||
return (uint16_t)value;
|
||||
}
|
||||
#define sdr_in16(port, offset) (my_inw((port) + (offset)))
|
||||
|
||||
@@ -60,9 +60,9 @@ static void my_outb(u32_t port, u32_t value) {
|
||||
static void my_outw(u32_t port, u32_t value) {
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
*(volatile u16_t *)(port) = value;
|
||||
*(volatile uint16_t *)(port) = value;
|
||||
#else
|
||||
if ((r = sys_outw(port, (u16_t)value)) != OK)
|
||||
if ((r = sys_outw(port, (uint16_t)value)) != OK)
|
||||
printf("SDR: sys_outw failed: %d\n", r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -205,8 +205,8 @@ int get_set_volume(u32_t *base, struct volume_level *level, int flag) {
|
||||
else {
|
||||
/* ### READ_MIXER_REG ### */
|
||||
data = dev_mixer_read(base, cmd);
|
||||
level->left = (u16_t)(data >> 8);
|
||||
level->right = (u16_t)(data & 0xff);
|
||||
level->left = (uint16_t)(data >> 8);
|
||||
level->right = (uint16_t)(data & 0xff);
|
||||
if (level->right < 0)
|
||||
level->right = 0;
|
||||
else if (level->right > max_level)
|
||||
|
||||
@@ -5,31 +5,31 @@
|
||||
registers. See Intel's Audio Codec 97 standard (rev2.3) for info. */
|
||||
|
||||
typedef struct ac97_struct {
|
||||
u16_t Reset; /* 0x00 */
|
||||
u16_t MasterVolume; /* 0x02 */
|
||||
u16_t AUXOutVolume; /* 0x04 */
|
||||
u16_t MonoVolume; /* 0x06 */
|
||||
u16_t MasterTone; /* 0x08 */
|
||||
u16_t PCBeepVolume; /* 0x0A */
|
||||
u16_t PhoneVolume; /* 0x0C */
|
||||
u16_t MicVolume; /* 0x0E */
|
||||
u16_t LineInVolume; /* 0x10 */
|
||||
u16_t CDVolume; /* 0x12 */
|
||||
u16_t VideoVolume; /* 0x14 */
|
||||
u16_t AUXInVolume; /* 0x16 */
|
||||
u16_t PCMOutVolume; /* 0x18 */
|
||||
u16_t RecordSelect; /* 0x1A */
|
||||
u16_t RecordGain; /* 0x1C */
|
||||
u16_t RecordGainMic; /* 0x1E */
|
||||
u16_t GeneralPurpose; /* 0x20 */
|
||||
u16_t Control3D; /* 0x22 */
|
||||
u16_t AudioIntAndPaging; /* 0x24 */
|
||||
u16_t PowerdownControlAndStat; /* 0x26 */
|
||||
u16_t ExtendedAudio1; /* 0x28 */
|
||||
u16_t ExtendedAudio2; /* 0x2A */
|
||||
uint16_t Reset; /* 0x00 */
|
||||
uint16_t MasterVolume; /* 0x02 */
|
||||
uint16_t AUXOutVolume; /* 0x04 */
|
||||
uint16_t MonoVolume; /* 0x06 */
|
||||
uint16_t MasterTone; /* 0x08 */
|
||||
uint16_t PCBeepVolume; /* 0x0A */
|
||||
uint16_t PhoneVolume; /* 0x0C */
|
||||
uint16_t MicVolume; /* 0x0E */
|
||||
uint16_t LineInVolume; /* 0x10 */
|
||||
uint16_t CDVolume; /* 0x12 */
|
||||
uint16_t VideoVolume; /* 0x14 */
|
||||
uint16_t AUXInVolume; /* 0x16 */
|
||||
uint16_t PCMOutVolume; /* 0x18 */
|
||||
uint16_t RecordSelect; /* 0x1A */
|
||||
uint16_t RecordGain; /* 0x1C */
|
||||
uint16_t RecordGainMic; /* 0x1E */
|
||||
uint16_t GeneralPurpose; /* 0x20 */
|
||||
uint16_t Control3D; /* 0x22 */
|
||||
uint16_t AudioIntAndPaging; /* 0x24 */
|
||||
uint16_t PowerdownControlAndStat; /* 0x26 */
|
||||
uint16_t ExtendedAudio1; /* 0x28 */
|
||||
uint16_t ExtendedAudio2; /* 0x2A */
|
||||
/* ... */
|
||||
u16_t VendorID1; /* 0x7C */
|
||||
u16_t VendorID2; /* 0x7E */
|
||||
uint16_t VendorID1; /* 0x7C */
|
||||
uint16_t VendorID2; /* 0x7E */
|
||||
} ac97_t;
|
||||
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ static int ak4531_finished(void);
|
||||
static int set_volume(struct volume_level *level, int cmd_left, int
|
||||
cmd_right, int max_level);
|
||||
|
||||
static u16_t base_address;
|
||||
static u16_t status_register;
|
||||
static u16_t status_bit;
|
||||
static u16_t poll_address;
|
||||
static uint16_t base_address;
|
||||
static uint16_t status_register;
|
||||
static uint16_t status_bit;
|
||||
static uint16_t poll_address;
|
||||
|
||||
uint8_t mixer_values[0x20] = {
|
||||
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 0x00 - 0x07 */
|
||||
@@ -55,7 +55,7 @@ uint8_t mixer_values[0x20] = {
|
||||
|
||||
static int ak4531_finished(void) {
|
||||
int i;
|
||||
u16_t cstat;
|
||||
uint16_t cstat;
|
||||
for (i = 0; i < 0x40000; i++) {
|
||||
cstat = pci_inw(status_register);
|
||||
if (!(cstat & status_bit)) {
|
||||
@@ -67,12 +67,12 @@ static int ak4531_finished(void) {
|
||||
|
||||
|
||||
static int ak4531_write (uint8_t address, uint8_t data) {
|
||||
u16_t to_be_written;
|
||||
uint16_t to_be_written;
|
||||
|
||||
|
||||
if (address > MIC_AMP_GAIN) return -1;
|
||||
|
||||
to_be_written = (u16_t)((address << 8) | data);
|
||||
to_be_written = (uint16_t)((address << 8) | data);
|
||||
|
||||
if (!ak4531_finished()) return -1;
|
||||
pci_outw(base_address, to_be_written);
|
||||
@@ -80,8 +80,8 @@ static int ak4531_write (uint8_t address, uint8_t data) {
|
||||
}
|
||||
|
||||
|
||||
int ak4531_init(u16_t base, u16_t status_reg, u16_t bit,
|
||||
u16_t poll) {
|
||||
int ak4531_init(uint16_t base, uint16_t status_reg, uint16_t bit,
|
||||
uint16_t poll) {
|
||||
int i;
|
||||
|
||||
base_address = base;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <minix/drivers.h>
|
||||
#include <minix/sound.h>
|
||||
|
||||
int ak4531_init(u16_t base, u16_t status_reg, u16_t bit, u16_t poll);
|
||||
int ak4531_init(uint16_t base, uint16_t status_reg, uint16_t bit, uint16_t poll);
|
||||
int ak4531_get_set_volume(struct volume_level *level, int flag);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -107,8 +107,8 @@ int drv_init(void) {
|
||||
|
||||
|
||||
int drv_init_hw (void) {
|
||||
u16_t i, j;
|
||||
u16_t chip_sel_ctrl_reg;
|
||||
uint16_t i, j;
|
||||
uint16_t chip_sel_ctrl_reg;
|
||||
|
||||
/* First, detect the hardware */
|
||||
if (detect_hw() != OK) {
|
||||
@@ -170,7 +170,7 @@ int drv_init_hw (void) {
|
||||
static int detect_hw(void) {
|
||||
u32_t device;
|
||||
int devind;
|
||||
u16_t v_id, d_id;
|
||||
uint16_t v_id, d_id;
|
||||
|
||||
/* detect_hw tries to find device and get IRQ and base address
|
||||
with a little (much) help from the PCI library.
|
||||
@@ -399,7 +399,7 @@ int drv_int(int sub_dev) {
|
||||
|
||||
|
||||
int drv_reenable_int(int chan) {
|
||||
u16_t ser_interface, int_en_bit;
|
||||
uint16_t ser_interface, int_en_bit;
|
||||
|
||||
switch(chan) {
|
||||
case ADC1_CHAN: int_en_bit = R1_INT_EN; break;
|
||||
@@ -457,7 +457,7 @@ int drv_resume(int sub_dev) {
|
||||
|
||||
static int set_bits(u32_t nr_of_bits, int sub_dev) {
|
||||
/* set format bits for specified channel. */
|
||||
u16_t size_16_bit, ser_interface;
|
||||
uint16_t size_16_bit, ser_interface;
|
||||
|
||||
switch(sub_dev) {
|
||||
case ADC1_CHAN: size_16_bit = R1_S_EB; break;
|
||||
@@ -481,7 +481,7 @@ static int set_bits(u32_t nr_of_bits, int sub_dev) {
|
||||
|
||||
static int set_stereo(u32_t stereo, int sub_dev) {
|
||||
/* set format bits for specified channel. */
|
||||
u16_t stereo_bit, ser_interface;
|
||||
uint16_t stereo_bit, ser_interface;
|
||||
|
||||
switch(sub_dev) {
|
||||
case ADC1_CHAN: stereo_bit = R1_S_MB; break;
|
||||
@@ -541,7 +541,7 @@ static int set_int_cnt(int chan) {
|
||||
After <DspFragmentSize> bytes, an interrupt will be generated */
|
||||
|
||||
int sample_count;
|
||||
u16_t int_cnt_reg;
|
||||
uint16_t int_cnt_reg;
|
||||
|
||||
if (aud_conf[chan].fragment_size >
|
||||
(sub_dev[chan].DmaSize / sub_dev[chan].NrOfDmaFragments)
|
||||
@@ -582,7 +582,7 @@ static int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) {
|
||||
|
||||
|
||||
static int disable_int(int chan) {
|
||||
u16_t ser_interface, int_en_bit;
|
||||
uint16_t ser_interface, int_en_bit;
|
||||
|
||||
switch(chan) {
|
||||
case ADC1_CHAN: int_en_bit = R1_INT_EN; break;
|
||||
@@ -598,9 +598,9 @@ static int disable_int(int chan) {
|
||||
|
||||
|
||||
static int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
|
||||
u16_t samp_ct_reg;
|
||||
u16_t curr_samp_ct_reg;
|
||||
u16_t curr_samp_ct; /* counts back from SAMP_CT till 0 */
|
||||
uint16_t samp_ct_reg;
|
||||
uint16_t curr_samp_ct_reg;
|
||||
uint16_t curr_samp_ct; /* counts back from SAMP_CT till 0 */
|
||||
|
||||
*len = sizeof(*samples_in_buf);
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
typedef struct {
|
||||
u32_t stereo;
|
||||
u16_t sample_rate;
|
||||
uint16_t sample_rate;
|
||||
u32_t nr_of_bits;
|
||||
u32_t sign;
|
||||
u32_t busy;
|
||||
@@ -111,8 +111,8 @@ typedef struct {
|
||||
|
||||
typedef struct DEVSTRUCT {
|
||||
char* name;
|
||||
u16_t v_id; /* vendor id */
|
||||
u16_t d_id; /* device id */
|
||||
uint16_t v_id; /* vendor id */
|
||||
uint16_t d_id; /* device id */
|
||||
u32_t devind; /* minix pci device id, for
|
||||
* pci configuration space */
|
||||
u32_t base; /* changed to 32 bits */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/*===========================================================================*
|
||||
* helper functions for I/O *
|
||||
*===========================================================================*/
|
||||
u32_t pci_inb(u16_t port) {
|
||||
u32_t pci_inb(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inb(port, &value)) !=OK)
|
||||
@@ -23,7 +23,7 @@ u32_t pci_inb(u16_t port) {
|
||||
}
|
||||
|
||||
|
||||
u32_t pci_inw(u16_t port) {
|
||||
u32_t pci_inw(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inw(port, &value)) !=OK)
|
||||
@@ -32,7 +32,7 @@ u32_t pci_inw(u16_t port) {
|
||||
}
|
||||
|
||||
|
||||
u32_t pci_inl(u16_t port) {
|
||||
u32_t pci_inl(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inl(port, &value)) !=OK)
|
||||
@@ -41,21 +41,21 @@ u32_t pci_inl(u16_t port) {
|
||||
}
|
||||
|
||||
|
||||
void pci_outb(u16_t port, uint8_t value) {
|
||||
void pci_outb(uint16_t port, uint8_t value) {
|
||||
int s;
|
||||
if ((s=sys_outb(port, value)) !=OK)
|
||||
printf("%s: warning, sys_outb failed: %d\n", DRIVER_NAME, s);
|
||||
}
|
||||
|
||||
|
||||
void pci_outw(u16_t port, u16_t value) {
|
||||
void pci_outw(uint16_t port, uint16_t value) {
|
||||
int s;
|
||||
if ((s=sys_outw(port, value)) !=OK)
|
||||
printf("%s: warning, sys_outw failed: %d\n", DRIVER_NAME, s);
|
||||
}
|
||||
|
||||
|
||||
void pci_outl(u16_t port, u32_t value) {
|
||||
void pci_outl(uint16_t port, u32_t value) {
|
||||
int s;
|
||||
if ((s=sys_outl(port, value)) !=OK)
|
||||
printf("%s: warning, sys_outl failed: %d\n", DRIVER_NAME, s);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef PCI_HELPER
|
||||
#define PCI_HELPER
|
||||
|
||||
unsigned pci_inb(u16_t port);
|
||||
unsigned pci_inw(u16_t port);
|
||||
unsigned pci_inl(u16_t port);
|
||||
unsigned pci_inb(uint16_t port);
|
||||
unsigned pci_inw(uint16_t port);
|
||||
unsigned pci_inl(uint16_t port);
|
||||
|
||||
void pci_outb(u16_t port, uint8_t value);
|
||||
void pci_outw(u16_t port, u16_t value);
|
||||
void pci_outl(u16_t port, u32_t value);
|
||||
void pci_outb(uint16_t port, uint8_t value);
|
||||
void pci_outw(uint16_t port, uint16_t value);
|
||||
void pci_outl(uint16_t port, u32_t value);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
/* AC97 Mixer and Mode control function prototypes */
|
||||
|
||||
static int AC97_write(const DEV_STRUCT * pCC, u16_t wAddr, u16_t
|
||||
static int AC97_write(const DEV_STRUCT * pCC, uint16_t wAddr, uint16_t
|
||||
wData);
|
||||
static int AC97_write_unsynced(const DEV_STRUCT * pCC, u16_t wAddr,
|
||||
u16_t wData);
|
||||
static int AC97_read_unsynced(const DEV_STRUCT * pCC, u16_t wAddr,
|
||||
u16_t *data);
|
||||
static int AC97_write_unsynced(const DEV_STRUCT * pCC, uint16_t wAddr,
|
||||
uint16_t wData);
|
||||
static int AC97_read_unsynced(const DEV_STRUCT * pCC, uint16_t wAddr,
|
||||
uint16_t *data);
|
||||
static void set_nice_volume(void);
|
||||
static int AC97_get_volume(struct volume_level *level);
|
||||
static int AC97_set_volume(const struct volume_level *level);
|
||||
@@ -68,10 +68,10 @@ static void set_src_sync_state (int state)
|
||||
#endif
|
||||
|
||||
|
||||
static int AC97_write (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData)
|
||||
static int AC97_write (const DEV_STRUCT * pCC, uint16_t wAddr, uint16_t wData)
|
||||
{
|
||||
u32_t dtemp, i;
|
||||
u16_t wBaseAddr = pCC->base;
|
||||
uint16_t wBaseAddr = pCC->base;
|
||||
|
||||
/* wait for WIP bit (Write In Progress) to go away */
|
||||
/* remember, register CODEC_READ (0x14)
|
||||
@@ -133,10 +133,10 @@ u16_t wBaseAddr = pCC->base;
|
||||
|
||||
|
||||
#if 0
|
||||
static int AC97_read (const DEV_STRUCT * pCC, u16_t wAddr, u16_t *data)
|
||||
static int AC97_read (const DEV_STRUCT * pCC, uint16_t wAddr, uint16_t *data)
|
||||
{
|
||||
u32_t dtemp, i;
|
||||
u16_t base = pCC->base;
|
||||
uint16_t base = pCC->base;
|
||||
|
||||
/* wait for WIP to go away */
|
||||
if (WaitBitd (base + CODEC_READ, 30, 0, WIP_TIMEOUT))
|
||||
@@ -200,15 +200,15 @@ u16_t base = pCC->base;
|
||||
dtemp = pci_inl(base + CODEC_READ);
|
||||
|
||||
if (data)
|
||||
*data = (u16_t) dtemp;
|
||||
*data = (uint16_t) dtemp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int AC97_write_unsynced (const DEV_STRUCT * pCC, u16_t wAddr,
|
||||
u16_t wData)
|
||||
static int AC97_write_unsynced (const DEV_STRUCT * pCC, uint16_t wAddr,
|
||||
uint16_t wData)
|
||||
{
|
||||
/* wait for WIP to go away */
|
||||
if (WaitBitd (pCC->base + CODEC_READ, 30, 0, WIP_TIMEOUT))
|
||||
@@ -220,8 +220,8 @@ static int AC97_write_unsynced (const DEV_STRUCT * pCC, u16_t wAddr,
|
||||
}
|
||||
|
||||
|
||||
static int AC97_read_unsynced (const DEV_STRUCT * pCC, u16_t wAddr,
|
||||
u16_t *data)
|
||||
static int AC97_read_unsynced (const DEV_STRUCT * pCC, uint16_t wAddr,
|
||||
uint16_t *data)
|
||||
{
|
||||
u32_t dtemp;
|
||||
|
||||
@@ -239,7 +239,7 @@ u32_t dtemp;
|
||||
dtemp = pci_inl(pCC->base + CODEC_READ);
|
||||
|
||||
if (data)
|
||||
*data = (u16_t) dtemp;
|
||||
*data = (uint16_t) dtemp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -341,9 +341,9 @@ static void set_nice_volume(void) {
|
||||
|
||||
|
||||
static int get_volume(uint8_t *left, uint8_t *right, int cmd) {
|
||||
u16_t value = 0;
|
||||
uint16_t value = 0;
|
||||
|
||||
AC97_read_unsynced(dev, (u16_t)cmd, &value);
|
||||
AC97_read_unsynced(dev, (uint16_t)cmd, &value);
|
||||
|
||||
*left = value>>8;
|
||||
*right = value&0xff;
|
||||
@@ -353,11 +353,11 @@ static int get_volume(uint8_t *left, uint8_t *right, int cmd) {
|
||||
|
||||
|
||||
static int set_volume(int left, int right, int cmd) {
|
||||
u16_t waarde;
|
||||
uint16_t waarde;
|
||||
|
||||
waarde = (u16_t)((left<<8)|right);
|
||||
waarde = (uint16_t)((left<<8)|right);
|
||||
|
||||
AC97_write_unsynced(dev, (u16_t)cmd, waarde);
|
||||
AC97_write_unsynced(dev, (uint16_t)cmd, waarde);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -21,31 +21,31 @@ int AC97_get_set_volume(struct volume_level *level, int flag);
|
||||
registers. See Intel's Audio Codec 97 standard (rev2.3) for info. */
|
||||
|
||||
typedef struct ac97_struct {
|
||||
u16_t Reset; /* 0x00 */
|
||||
u16_t MasterVolume; /* 0x02 */
|
||||
u16_t AUXOutVolume; /* 0x04 */
|
||||
u16_t MonoVolume; /* 0x06 */
|
||||
u16_t MasterTone; /* 0x08 */
|
||||
u16_t PCBeepVolume; /* 0x0A */
|
||||
u16_t PhoneVolume; /* 0x0C */
|
||||
u16_t MicVolume; /* 0x0E */
|
||||
u16_t LineInVolume; /* 0x10 */
|
||||
u16_t CDVolume; /* 0x12 */
|
||||
u16_t VideoVolume; /* 0x14 */
|
||||
u16_t AUXInVolume; /* 0x16 */
|
||||
u16_t PCMOutVolume; /* 0x18 */
|
||||
u16_t RecordSelect; /* 0x1A */
|
||||
u16_t RecordGain; /* 0x1C */
|
||||
u16_t RecordGainMic; /* 0x1E */
|
||||
u16_t GeneralPurpose; /* 0x20 */
|
||||
u16_t Control3D; /* 0x22 */
|
||||
u16_t AudioIntAndPaging; /* 0x24 */
|
||||
u16_t PowerdownControlAndStat; /* 0x26 */
|
||||
u16_t ExtendedAudio1; /* 0x28 */
|
||||
u16_t ExtendedAudio2; /* 0x2A */
|
||||
uint16_t Reset; /* 0x00 */
|
||||
uint16_t MasterVolume; /* 0x02 */
|
||||
uint16_t AUXOutVolume; /* 0x04 */
|
||||
uint16_t MonoVolume; /* 0x06 */
|
||||
uint16_t MasterTone; /* 0x08 */
|
||||
uint16_t PCBeepVolume; /* 0x0A */
|
||||
uint16_t PhoneVolume; /* 0x0C */
|
||||
uint16_t MicVolume; /* 0x0E */
|
||||
uint16_t LineInVolume; /* 0x10 */
|
||||
uint16_t CDVolume; /* 0x12 */
|
||||
uint16_t VideoVolume; /* 0x14 */
|
||||
uint16_t AUXInVolume; /* 0x16 */
|
||||
uint16_t PCMOutVolume; /* 0x18 */
|
||||
uint16_t RecordSelect; /* 0x1A */
|
||||
uint16_t RecordGain; /* 0x1C */
|
||||
uint16_t RecordGainMic; /* 0x1E */
|
||||
uint16_t GeneralPurpose; /* 0x20 */
|
||||
uint16_t Control3D; /* 0x22 */
|
||||
uint16_t AudioIntAndPaging; /* 0x24 */
|
||||
uint16_t PowerdownControlAndStat; /* 0x26 */
|
||||
uint16_t ExtendedAudio1; /* 0x28 */
|
||||
uint16_t ExtendedAudio2; /* 0x2A */
|
||||
/* ... */
|
||||
u16_t VendorID1; /* 0x7C */
|
||||
u16_t VendorID2; /* 0x7E */
|
||||
uint16_t VendorID1; /* 0x7C */
|
||||
uint16_t VendorID2; /* 0x7E */
|
||||
} ac97_t;
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ int SRCInit ( DEV_STRUCT * DSP )
|
||||
pci_outl(reg(CONC_dSRCIO_OFF), SRC_DISABLE);
|
||||
|
||||
for( i = 0; i < 0x80; ++i )
|
||||
if (SRC_SUCCESS != (retVal = SRCRegWrite(DSP, (u16_t)i, 0U)))
|
||||
if (SRC_SUCCESS != (retVal = SRCRegWrite(DSP, (uint16_t)i, 0U)))
|
||||
return (retVal);
|
||||
|
||||
if (SRC_SUCCESS != (retVal = SRCRegWrite(DSP, SRC_SYNTH_BASE + SRC_TRUNC_N_OFF, 16 << 4)))
|
||||
@@ -55,7 +55,7 @@ int SRCInit ( DEV_STRUCT * DSP )
|
||||
}
|
||||
|
||||
|
||||
int SRCRegRead(DEV_STRUCT * DSP, u16_t reg, u16_t *data)
|
||||
int SRCRegRead(DEV_STRUCT * DSP, uint16_t reg, uint16_t *data)
|
||||
{
|
||||
u32_t dtemp;
|
||||
|
||||
@@ -74,13 +74,13 @@ int SRCRegRead(DEV_STRUCT * DSP, u16_t reg, u16_t *data)
|
||||
return (SRC_ERR_NOT_BUSY_TIMEOUT);
|
||||
|
||||
if (NULL != data)
|
||||
*data = (u16_t) pci_inl(reg(CONC_dSRCIO_OFF));
|
||||
*data = (uint16_t) pci_inl(reg(CONC_dSRCIO_OFF));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SRCRegWrite(DEV_STRUCT * DSP, u16_t reg, u16_t val)
|
||||
int SRCRegWrite(DEV_STRUCT * DSP, uint16_t reg, uint16_t val)
|
||||
{
|
||||
u32_t dtemp;
|
||||
|
||||
@@ -99,10 +99,10 @@ int SRCRegWrite(DEV_STRUCT * DSP, u16_t reg, u16_t val)
|
||||
}
|
||||
|
||||
|
||||
void SRCSetRate(DEV_STRUCT * DSP, char base, u16_t rate)
|
||||
void SRCSetRate(DEV_STRUCT * DSP, char base, uint16_t rate)
|
||||
{
|
||||
u32_t freq, dtemp, i;
|
||||
u16_t N, truncM, truncStart, wtemp;
|
||||
uint16_t N, truncM, truncStart, wtemp;
|
||||
|
||||
|
||||
if( base != SRC_ADC_BASE )
|
||||
@@ -123,9 +123,9 @@ void SRCSetRate(DEV_STRUCT * DSP, char base, u16_t rate)
|
||||
|
||||
SRCRegWrite(DSP, base + SRC_INT_REGS_OFF,
|
||||
(wtemp & 0x00ffU) |
|
||||
(u16_t) (freq >> 6) & 0xfc00);
|
||||
(uint16_t) (freq >> 6) & 0xfc00);
|
||||
|
||||
SRCRegWrite(DSP, base + SRC_VFREQ_FRAC_OFF, (u16_t) freq >> 1);
|
||||
SRCRegWrite(DSP, base + SRC_VFREQ_FRAC_OFF, (uint16_t) freq >> 1);
|
||||
|
||||
/* un-freeze the channel */
|
||||
dtemp = base == SRC_SYNTH_BASE ? SRC_SYNTHFREEZE : SRC_DACFREEZE;
|
||||
@@ -179,8 +179,8 @@ void SRCSetRate(DEV_STRUCT * DSP, char base, u16_t rate)
|
||||
SRCRegRead(DSP, base + SRC_INT_REGS_OFF, &wtemp);
|
||||
SRCRegWrite(DSP, base + SRC_INT_REGS_OFF,
|
||||
(wtemp & 0x00ffU) |
|
||||
(u16_t) (freq >> 6) & 0xfc00);
|
||||
SRCRegWrite(DSP, base + SRC_VFREQ_FRAC_OFF, (u16_t) freq >> 1);
|
||||
(uint16_t) (freq >> 6) & 0xfc00);
|
||||
SRCRegWrite(DSP, base + SRC_VFREQ_FRAC_OFF, (uint16_t) freq >> 1);
|
||||
|
||||
/* un-freeze the channel */
|
||||
for( i = 0; i < SRC_IOPOLL_COUNT; ++i )
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
#include "wait.h"
|
||||
|
||||
int SRCInit(DEV_STRUCT * DSP);
|
||||
int SRCRegRead(DEV_STRUCT * DSP, u16_t reg, u16_t *data);
|
||||
int SRCRegWrite(DEV_STRUCT * DSP, u16_t reg, u16_t val);
|
||||
void SRCSetRate(DEV_STRUCT * DSP, char src_base, u16_t rate);
|
||||
int SRCRegRead(DEV_STRUCT * DSP, uint16_t reg, uint16_t *data);
|
||||
int SRCRegWrite(DEV_STRUCT * DSP, uint16_t reg, uint16_t val);
|
||||
void SRCSetRate(DEV_STRUCT * DSP, char src_base, uint16_t rate);
|
||||
|
||||
|
||||
/* register/base and control equates for the SRC RAM */
|
||||
|
||||
@@ -26,10 +26,10 @@ void CodecSetSrcSyncState (int state)
|
||||
}
|
||||
|
||||
|
||||
int CodecWrite (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData)
|
||||
int CodecWrite (DEV_STRUCT * pCC, uint16_t wAddr, uint16_t wData)
|
||||
{
|
||||
u32_t dtemp, i;
|
||||
u16_t wBaseAddr = pCC->base;
|
||||
uint16_t wBaseAddr = pCC->base;
|
||||
|
||||
/* wait for WIP bit (Write In Progress) to go away */
|
||||
/* remember, register CONC_dCODECCTL_OFF (0x14)
|
||||
@@ -89,10 +89,10 @@ u16_t wBaseAddr = pCC->base;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CodecRead (DEV_STRUCT * pCC, u16_t wAddr, u16_t *data)
|
||||
int CodecRead (DEV_STRUCT * pCC, uint16_t wAddr, uint16_t *data)
|
||||
{
|
||||
u32_t dtemp, i;
|
||||
u16_t base = pCC->base;
|
||||
uint16_t base = pCC->base;
|
||||
|
||||
/* wait for WIP to go away */
|
||||
if (WaitBitd (base + CONC_dCODECCTL_OFF, 30, 0, WIP_TIMEOUT))
|
||||
@@ -156,13 +156,13 @@ u16_t base = pCC->base;
|
||||
dtemp = pci_inl(base + CONC_dCODECCTL_OFF);
|
||||
|
||||
if (data)
|
||||
*data = (u16_t) dtemp;
|
||||
*data = (uint16_t) dtemp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int CodecWriteUnsynced (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData)
|
||||
int CodecWriteUnsynced (DEV_STRUCT * pCC, uint16_t wAddr, uint16_t wData)
|
||||
{
|
||||
/* wait for WIP to go away */
|
||||
if (WaitBitd (pCC->base + CONC_dCODECCTL_OFF, 30, 0, WIP_TIMEOUT))
|
||||
@@ -174,7 +174,7 @@ int CodecWriteUnsynced (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData)
|
||||
}
|
||||
|
||||
|
||||
int CodecReadUnsynced (DEV_STRUCT * pCC, u16_t wAddr, u16_t *data)
|
||||
int CodecReadUnsynced (DEV_STRUCT * pCC, uint16_t wAddr, uint16_t *data)
|
||||
{
|
||||
u32_t dtemp;
|
||||
|
||||
@@ -192,7 +192,7 @@ u32_t dtemp;
|
||||
dtemp = pci_inl(pCC->base + CONC_dCODECCTL_OFF);
|
||||
|
||||
if (data)
|
||||
*data = (u16_t) dtemp;
|
||||
*data = (uint16_t) dtemp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@ void CodecSetVendorId (char *tbuf);
|
||||
|
||||
/* CODEC Mixer and Mode control function prototypes */
|
||||
|
||||
int CodecRead (DEV_STRUCT * pCC, u16_t wAddr, u16_t *data);
|
||||
int CodecWrite (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData);
|
||||
int CodecRead (DEV_STRUCT * pCC, uint16_t wAddr, uint16_t *data);
|
||||
int CodecWrite (DEV_STRUCT * pCC, uint16_t wAddr, uint16_t wData);
|
||||
void CodecSetSrcSyncState (int state);
|
||||
int CodecWriteUnsynced (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData);
|
||||
int CodecReadUnsynced (DEV_STRUCT * pCC, u16_t wAddr, u16_t *data);
|
||||
int CodecWriteUnsynced (DEV_STRUCT * pCC, uint16_t wAddr, uint16_t wData);
|
||||
int CodecReadUnsynced (DEV_STRUCT * pCC, uint16_t wAddr, uint16_t *data);
|
||||
|
||||
/*
|
||||
This function initializes the CODEC to a default mode.
|
||||
|
||||
@@ -113,7 +113,7 @@ int drv_init(void) {
|
||||
|
||||
|
||||
int drv_init_hw (void) {
|
||||
u16_t i, j;
|
||||
uint16_t i, j;
|
||||
|
||||
/* First, detect the hardware */
|
||||
if (detect_hw() != OK) {
|
||||
@@ -172,7 +172,7 @@ int drv_init_hw (void) {
|
||||
static int detect_hw(void) {
|
||||
u32_t device;
|
||||
int devind;
|
||||
u16_t v_id, d_id;
|
||||
uint16_t v_id, d_id;
|
||||
|
||||
/* detect_hw tries to find device and get IRQ and base address
|
||||
with a little (much) help from the PCI library.
|
||||
@@ -400,7 +400,7 @@ int drv_int(int sub_dev) {
|
||||
|
||||
|
||||
int drv_reenable_int(int chan) {
|
||||
u16_t ser_interface, int_en_bit;
|
||||
uint16_t ser_interface, int_en_bit;
|
||||
|
||||
switch(chan) {
|
||||
case ADC1_CHAN: int_en_bit = R1_INT_EN; break;
|
||||
@@ -458,7 +458,7 @@ int drv_resume(int sub_dev) {
|
||||
|
||||
static int set_bits(u32_t nr_of_bits, int sub_dev) {
|
||||
/* set format bits for specified channel. */
|
||||
u16_t size_16_bit, ser_interface;
|
||||
uint16_t size_16_bit, ser_interface;
|
||||
|
||||
switch(sub_dev) {
|
||||
case ADC1_CHAN: size_16_bit = R1_S_EB; break;
|
||||
@@ -482,7 +482,7 @@ static int set_bits(u32_t nr_of_bits, int sub_dev) {
|
||||
|
||||
static int set_stereo(u32_t stereo, int sub_dev) {
|
||||
/* set format bits for specified channel. */
|
||||
u16_t stereo_bit, ser_interface;
|
||||
uint16_t stereo_bit, ser_interface;
|
||||
|
||||
switch(sub_dev) {
|
||||
case ADC1_CHAN: stereo_bit = R1_S_MB; break;
|
||||
@@ -543,7 +543,7 @@ static int set_int_cnt(int chan) {
|
||||
After <DspFragmentSize> bytes, an interrupt will be generated */
|
||||
|
||||
int sample_count;
|
||||
u16_t int_cnt_reg;
|
||||
uint16_t int_cnt_reg;
|
||||
|
||||
if (aud_conf[chan].fragment_size >
|
||||
(sub_dev[chan].DmaSize / sub_dev[chan].NrOfDmaFragments)
|
||||
@@ -584,7 +584,7 @@ static int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) {
|
||||
|
||||
|
||||
static int disable_int(int chan) {
|
||||
u16_t ser_interface, int_en_bit;
|
||||
uint16_t ser_interface, int_en_bit;
|
||||
|
||||
switch(chan) {
|
||||
case ADC1_CHAN: int_en_bit = R1_INT_EN; break;
|
||||
@@ -600,9 +600,9 @@ static int disable_int(int chan) {
|
||||
|
||||
|
||||
static int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
|
||||
u16_t samp_ct_reg;
|
||||
u16_t curr_samp_ct_reg;
|
||||
u16_t curr_samp_ct; /* counts back from SAMP_CT till 0 */
|
||||
uint16_t samp_ct_reg;
|
||||
uint16_t curr_samp_ct_reg;
|
||||
uint16_t curr_samp_ct; /* counts back from SAMP_CT till 0 */
|
||||
|
||||
*len = sizeof(*samples_in_buf);
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
typedef struct {
|
||||
u32_t stereo;
|
||||
u16_t sample_rate;
|
||||
uint16_t sample_rate;
|
||||
u32_t nr_of_bits;
|
||||
u32_t sign;
|
||||
u32_t busy;
|
||||
@@ -113,8 +113,8 @@ typedef struct {
|
||||
|
||||
typedef struct DEVSTRUCT {
|
||||
char* name;
|
||||
u16_t v_id; /* vendor id */
|
||||
u16_t d_id; /* device id */
|
||||
uint16_t v_id; /* vendor id */
|
||||
uint16_t d_id; /* device id */
|
||||
u32_t devind; /* minix pci device id, for
|
||||
* pci configuration space */
|
||||
u32_t base; /* changed to 32 bits */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/*===========================================================================*
|
||||
* helper functions for I/O *
|
||||
*===========================================================================*/
|
||||
u32_t pci_inb(u16_t port) {
|
||||
u32_t pci_inb(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inb(port, &value)) !=OK)
|
||||
@@ -23,7 +23,7 @@ u32_t pci_inb(u16_t port) {
|
||||
}
|
||||
|
||||
|
||||
u32_t pci_inw(u16_t port) {
|
||||
u32_t pci_inw(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inw(port, &value)) !=OK)
|
||||
@@ -32,7 +32,7 @@ u32_t pci_inw(u16_t port) {
|
||||
}
|
||||
|
||||
|
||||
u32_t pci_inl(u16_t port) {
|
||||
u32_t pci_inl(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inl(port, &value)) !=OK)
|
||||
@@ -41,21 +41,21 @@ u32_t pci_inl(u16_t port) {
|
||||
}
|
||||
|
||||
|
||||
void pci_outb(u16_t port, uint8_t value) {
|
||||
void pci_outb(uint16_t port, uint8_t value) {
|
||||
int s;
|
||||
if ((s=sys_outb(port, value)) !=OK)
|
||||
printf("%s: warning, sys_outb failed: %d\n", DRIVER_NAME, s);
|
||||
}
|
||||
|
||||
|
||||
void pci_outw(u16_t port, u16_t value) {
|
||||
void pci_outw(uint16_t port, uint16_t value) {
|
||||
int s;
|
||||
if ((s=sys_outw(port, value)) !=OK)
|
||||
printf("%s: warning, sys_outw failed: %d\n", DRIVER_NAME, s);
|
||||
}
|
||||
|
||||
|
||||
void pci_outl(u16_t port, u32_t value) {
|
||||
void pci_outl(uint16_t port, u32_t value) {
|
||||
int s;
|
||||
if ((s=sys_outl(port, value)) !=OK)
|
||||
printf("%s: warning, sys_outl failed: %d\n", DRIVER_NAME, s);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef PCI_HELPER
|
||||
#define PCI_HELPER
|
||||
|
||||
unsigned pci_inb(u16_t port);
|
||||
unsigned pci_inw(u16_t port);
|
||||
unsigned pci_inl(u16_t port);
|
||||
unsigned pci_inb(uint16_t port);
|
||||
unsigned pci_inw(uint16_t port);
|
||||
unsigned pci_inl(uint16_t port);
|
||||
|
||||
void pci_outb(u16_t port, uint8_t value);
|
||||
void pci_outw(u16_t port, u16_t value);
|
||||
void pci_outl(u16_t port, u32_t value);
|
||||
void pci_outb(uint16_t port, uint8_t value);
|
||||
void pci_outw(uint16_t port, uint16_t value);
|
||||
void pci_outl(uint16_t port, u32_t value);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
|
||||
|
||||
|
||||
static int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t
|
||||
static int src_reg_read(const DEV_STRUCT * DSP, uint16_t reg, uint16_t
|
||||
*data);
|
||||
static int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val);
|
||||
static int src_reg_write(const DEV_STRUCT * DSP, uint16_t reg, uint16_t val);
|
||||
|
||||
|
||||
int src_init ( DEV_STRUCT * DSP ) {
|
||||
@@ -53,7 +53,7 @@ int src_init ( DEV_STRUCT * DSP ) {
|
||||
/* from the opensound system driver, no idea where the specification is */
|
||||
/* there are indeed 7 bits for the addresses of the SRC */
|
||||
for( i = 0; i < 0x80; ++i ) {
|
||||
if (SRC_SUCCESS != (retVal = src_reg_write(DSP, (u16_t)i, 0U)))
|
||||
if (SRC_SUCCESS != (retVal = src_reg_write(DSP, (uint16_t)i, 0U)))
|
||||
return (retVal);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ int src_init ( DEV_STRUCT * DSP ) {
|
||||
}
|
||||
|
||||
|
||||
static int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data) {
|
||||
static int src_reg_read(const DEV_STRUCT * DSP, uint16_t reg, uint16_t *data) {
|
||||
u32_t dtemp;
|
||||
|
||||
/* wait for ready */
|
||||
@@ -123,13 +123,13 @@ static int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data) {
|
||||
return (SRC_ERR_NOT_BUSY_TIMEOUT);
|
||||
|
||||
if (NULL != data)
|
||||
*data = (u16_t) pci_inl(reg(SAMPLE_RATE_CONV));
|
||||
*data = (uint16_t) pci_inl(reg(SAMPLE_RATE_CONV));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val) {
|
||||
static int src_reg_write(const DEV_STRUCT * DSP, uint16_t reg, uint16_t val) {
|
||||
u32_t dtemp;
|
||||
|
||||
/* wait for ready */
|
||||
@@ -146,9 +146,9 @@ static int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val) {
|
||||
}
|
||||
|
||||
|
||||
void src_set_rate(const DEV_STRUCT * DSP, char base, u16_t rate) {
|
||||
void src_set_rate(const DEV_STRUCT * DSP, char base, uint16_t rate) {
|
||||
u32_t freq, dtemp, i;
|
||||
u16_t N, truncM, truncStart, wtemp;
|
||||
uint16_t N, truncM, truncStart, wtemp;
|
||||
|
||||
|
||||
if( base != SRC_ADC_BASE )
|
||||
@@ -169,9 +169,9 @@ void src_set_rate(const DEV_STRUCT * DSP, char base, u16_t rate) {
|
||||
|
||||
src_reg_write(DSP, base + SRC_INT_REGS_OFF,
|
||||
(wtemp & 0x00ffU) |
|
||||
((u16_t) (freq >> 6) & 0xfc00));
|
||||
((uint16_t) (freq >> 6) & 0xfc00));
|
||||
|
||||
src_reg_write(DSP, base + SRC_VFREQ_FRAC_OFF, (u16_t) freq >> 1);
|
||||
src_reg_write(DSP, base + SRC_VFREQ_FRAC_OFF, (uint16_t) freq >> 1);
|
||||
|
||||
/* un-freeze the channel */
|
||||
dtemp = base == SRC_SYNTH_BASE ? SRC_SYNTHFREEZE : SRC_DACFREEZE;
|
||||
@@ -225,8 +225,8 @@ void src_set_rate(const DEV_STRUCT * DSP, char base, u16_t rate) {
|
||||
src_reg_read(DSP, base + SRC_INT_REGS_OFF, &wtemp);
|
||||
src_reg_write(DSP, base + SRC_INT_REGS_OFF,
|
||||
(wtemp & 0x00ffU) |
|
||||
((u16_t) (freq >> 6) & 0xfc00));
|
||||
src_reg_write(DSP, base + SRC_VFREQ_FRAC_OFF, (u16_t) freq >> 1);
|
||||
((uint16_t) (freq >> 6) & 0xfc00));
|
||||
src_reg_write(DSP, base + SRC_VFREQ_FRAC_OFF, (uint16_t) freq >> 1);
|
||||
|
||||
/* un-freeze the channel */
|
||||
for( i = 0; i < SRC_IOPOLL_COUNT; ++i )
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "pci_helper.h"
|
||||
|
||||
int src_init(DEV_STRUCT * DSP);
|
||||
void src_set_rate(const DEV_STRUCT * DSP, char src_base, u16_t rate);
|
||||
void src_set_rate(const DEV_STRUCT * DSP, char src_base, uint16_t rate);
|
||||
|
||||
#define SRC_SYNTH_BASE 0x70
|
||||
#define SRC_DAC_BASE 0x74
|
||||
|
||||
@@ -19,16 +19,16 @@ static uint8_t my_inb(u32_t port) {
|
||||
}
|
||||
#define sdr_in8(port, offset) (my_inb((port) + (offset)))
|
||||
|
||||
static u16_t my_inw(u32_t port) {
|
||||
static uint16_t my_inw(u32_t port) {
|
||||
u32_t value;
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
value = *(volatile u16_t *)(port);
|
||||
value = *(volatile uint16_t *)(port);
|
||||
#else
|
||||
if ((r = sys_inw(port, &value)) != OK)
|
||||
printf("SDR: sys_inw failed: %d\n", r);
|
||||
#endif
|
||||
return (u16_t)value;
|
||||
return (uint16_t)value;
|
||||
}
|
||||
#define sdr_in16(port, offset) (my_inw((port) + (offset)))
|
||||
|
||||
@@ -60,9 +60,9 @@ static void my_outb(u32_t port, u32_t value) {
|
||||
static void my_outw(u32_t port, u32_t value) {
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
*(volatile u16_t *)(port) = value;
|
||||
*(volatile uint16_t *)(port) = value;
|
||||
#else
|
||||
if ((r = sys_outw(port, (u16_t)value)) != OK)
|
||||
if ((r = sys_outw(port, (uint16_t)value)) != OK)
|
||||
printf("SDR: sys_outw failed: %d\n", r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -205,8 +205,8 @@ int get_set_volume(u32_t *base, struct volume_level *level, int flag) {
|
||||
else {
|
||||
/* ### READ_MIXER_REG ### */
|
||||
data = dev_mixer_read(base, cmd);
|
||||
level->left = (u16_t)(data >> 8);
|
||||
level->right = (u16_t)(data & 0xff);
|
||||
level->left = (uint16_t)(data >> 8);
|
||||
level->right = (uint16_t)(data & 0xff);
|
||||
if (level->right < 0)
|
||||
level->right = 0;
|
||||
else if (level->right > max_level)
|
||||
|
||||
@@ -22,7 +22,7 @@ static int free_buf(u32_t *val, int *len, int num);
|
||||
static int dev_reset(u32_t *base);
|
||||
static void dev_configure(u32_t *base);
|
||||
static void dev_init_mixer(u32_t *base);
|
||||
static void dev_set_sample_rate(u32_t *base, u16_t sample_rate);
|
||||
static void dev_set_sample_rate(u32_t *base, uint16_t sample_rate);
|
||||
static void dev_set_format(u32_t *base, u32_t bits, u32_t sign,
|
||||
u32_t stereo, u32_t sample_count);
|
||||
static void dev_start_channel(u32_t *base, int sub_dev);
|
||||
@@ -101,7 +101,7 @@ static void dev_init_mixer(u32_t *base) {
|
||||
}
|
||||
|
||||
/* Set DAC and ADC sample rate (### SET_SAMPLE_RATE ###) */
|
||||
static void dev_set_sample_rate(u32_t *base, u16_t sample_rate) {
|
||||
static void dev_set_sample_rate(u32_t *base, uint16_t sample_rate) {
|
||||
u32_t base0 = base[0];
|
||||
my_chan.delta = (sample_rate << 12) / 48000;
|
||||
sdr_out16(base0, REG_SB_DELTA, (48000 << 12) / sample_rate);
|
||||
@@ -233,7 +233,7 @@ static void dev_intr_enable(u32_t *base, int flag) {
|
||||
static int dev_probe(void) {
|
||||
int devind, i, ioflag;
|
||||
u32_t device, bar, size, base;
|
||||
u16_t vid, did, temp;
|
||||
uint16_t vid, did, temp;
|
||||
uint8_t *reg;
|
||||
|
||||
pci_init();
|
||||
|
||||
@@ -78,7 +78,7 @@ static channel_info my_chan;
|
||||
/* Driver Data Structure */
|
||||
typedef struct aud_sub_dev_conf_t {
|
||||
u32_t stereo;
|
||||
u16_t sample_rate;
|
||||
uint16_t sample_rate;
|
||||
u32_t nr_of_bits;
|
||||
u32_t sign;
|
||||
u32_t busy;
|
||||
@@ -88,8 +88,8 @@ typedef struct aud_sub_dev_conf_t {
|
||||
|
||||
typedef struct DEV_STRUCT {
|
||||
char *name;
|
||||
u16_t vid;
|
||||
u16_t did;
|
||||
uint16_t vid;
|
||||
uint16_t did;
|
||||
u32_t devind;
|
||||
u32_t base[6];
|
||||
char irq;
|
||||
|
||||
@@ -62,7 +62,7 @@ static void
|
||||
do_first_dev(message *mp)
|
||||
{
|
||||
int r, devind;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
struct rs_pci *aclp;
|
||||
|
||||
aclp= find_acl(mp->m_source);
|
||||
@@ -91,7 +91,7 @@ static void
|
||||
do_next_dev(message *mp)
|
||||
{
|
||||
int r, devind;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
struct rs_pci *aclp;
|
||||
|
||||
devind= mp->m1_i1;
|
||||
@@ -139,7 +139,7 @@ static void
|
||||
do_ids(message *mp)
|
||||
{
|
||||
int r, devind;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
|
||||
devind= mp->m1_i1;
|
||||
|
||||
@@ -165,7 +165,7 @@ static void
|
||||
do_dev_name(message *mp)
|
||||
{
|
||||
int r, name_len, len;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
cp_grant_id_t name_gid;
|
||||
const char *name;
|
||||
|
||||
@@ -367,7 +367,7 @@ static void
|
||||
do_attr_r16(message *mp)
|
||||
{
|
||||
int r, devind, port;
|
||||
u16_t v;
|
||||
uint16_t v;
|
||||
|
||||
devind= mp->m2_i1;
|
||||
port= mp->m2_i2;
|
||||
@@ -439,7 +439,7 @@ static void
|
||||
do_attr_w16(message *mp)
|
||||
{
|
||||
int r, devind, port;
|
||||
u16_t v;
|
||||
uint16_t v;
|
||||
|
||||
devind= mp->m2_i1;
|
||||
port= mp->m2_i2;
|
||||
|
||||
@@ -49,13 +49,13 @@ static struct pcibus
|
||||
int pb_devind;
|
||||
int pb_busnr;
|
||||
uint8_t (*pb_rreg8)(int busind, int devind, int port);
|
||||
u16_t (*pb_rreg16)(int busind, int devind, int port);
|
||||
uint16_t (*pb_rreg16)(int busind, int devind, int port);
|
||||
u32_t (*pb_rreg32)(int busind, int devind, int port);
|
||||
void (*pb_wreg8)(int busind, int devind, int port, uint8_t value);
|
||||
void (*pb_wreg16)(int busind, int devind, int port, u16_t value);
|
||||
void (*pb_wreg16)(int busind, int devind, int port, uint16_t value);
|
||||
void (*pb_wreg32)(int busind, int devind, int port, u32_t value);
|
||||
u16_t (*pb_rsts)(int busind);
|
||||
void (*pb_wsts)(int busind, u16_t value);
|
||||
uint16_t (*pb_rsts)(int busind);
|
||||
void (*pb_wsts)(int busind, uint16_t value);
|
||||
} pcibus[NR_PCIBUS];
|
||||
static int nr_pcibus= 0;
|
||||
|
||||
@@ -67,10 +67,10 @@ static struct pcidev
|
||||
uint8_t pd_baseclass;
|
||||
uint8_t pd_subclass;
|
||||
uint8_t pd_infclass;
|
||||
u16_t pd_vid;
|
||||
u16_t pd_did;
|
||||
u16_t pd_sub_vid;
|
||||
u16_t pd_sub_did;
|
||||
uint16_t pd_vid;
|
||||
uint16_t pd_did;
|
||||
uint16_t pd_sub_vid;
|
||||
uint16_t pd_sub_did;
|
||||
uint8_t pd_ilr;
|
||||
|
||||
uint8_t pd_inuse;
|
||||
@@ -98,7 +98,7 @@ static struct machine machine;
|
||||
* helper functions for I/O *
|
||||
*===========================================================================*/
|
||||
static unsigned
|
||||
pci_inb(u16_t port) {
|
||||
pci_inb(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inb(port, &value)) !=OK)
|
||||
@@ -107,7 +107,7 @@ pci_inb(u16_t port) {
|
||||
}
|
||||
|
||||
static unsigned
|
||||
pci_inw(u16_t port) {
|
||||
pci_inw(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inw(port, &value)) !=OK)
|
||||
@@ -116,7 +116,7 @@ pci_inw(u16_t port) {
|
||||
}
|
||||
|
||||
static unsigned
|
||||
pci_inl(u16_t port) {
|
||||
pci_inl(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inl(port, &value)) !=OK)
|
||||
@@ -125,21 +125,21 @@ pci_inl(u16_t port) {
|
||||
}
|
||||
|
||||
static void
|
||||
pci_outb(u16_t port, uint8_t value) {
|
||||
pci_outb(uint16_t port, uint8_t value) {
|
||||
int s;
|
||||
if ((s=sys_outb(port, value)) !=OK)
|
||||
printf("PCI: warning, sys_outb failed: %d\n", s);
|
||||
}
|
||||
|
||||
static void
|
||||
pci_outw(u16_t port, u16_t value) {
|
||||
pci_outw(uint16_t port, uint16_t value) {
|
||||
int s;
|
||||
if ((s=sys_outw(port, value)) !=OK)
|
||||
printf("PCI: warning, sys_outw failed: %d\n", s);
|
||||
}
|
||||
|
||||
static void
|
||||
pci_outl(u16_t port, u32_t value) {
|
||||
pci_outl(uint16_t port, u32_t value) {
|
||||
int s;
|
||||
if ((s=sys_outl(port, value)) !=OK)
|
||||
printf("PCI: warning, sys_outl failed: %d\n", s);
|
||||
@@ -165,10 +165,10 @@ pcii_rreg8(int busind, int devind, int port)
|
||||
return v;
|
||||
}
|
||||
|
||||
static u16_t
|
||||
static uint16_t
|
||||
pcii_rreg16(int busind, int devind, int port)
|
||||
{
|
||||
u16_t v;
|
||||
uint16_t v;
|
||||
int s;
|
||||
|
||||
v= PCII_RREG16_(pcibus[busind].pb_busnr,
|
||||
@@ -223,7 +223,7 @@ pcii_wreg8(int busind, int devind, int port, uint8_t value)
|
||||
}
|
||||
|
||||
static void
|
||||
pcii_wreg16(int busind, int devind, int port, u16_t value)
|
||||
pcii_wreg16(int busind, int devind, int port, uint16_t value)
|
||||
{
|
||||
int s;
|
||||
#if 0
|
||||
@@ -322,7 +322,7 @@ __pci_attr_r8(int devind, int port)
|
||||
return pcibus[busind].pb_rreg8(busind, devind, port);
|
||||
}
|
||||
|
||||
static u16_t
|
||||
static uint16_t
|
||||
__pci_attr_r16(int devind, int port)
|
||||
{
|
||||
int busnr, busind;
|
||||
@@ -353,7 +353,7 @@ __pci_attr_w8(int devind, int port, uint8_t value)
|
||||
}
|
||||
|
||||
static void
|
||||
__pci_attr_w16(int devind, int port, u16_t value)
|
||||
__pci_attr_w16(int devind, int port, uint16_t value)
|
||||
{
|
||||
int busnr, busind;
|
||||
|
||||
@@ -375,7 +375,7 @@ __pci_attr_w32(int devind, int port, u32_t value)
|
||||
/*===========================================================================*
|
||||
* helpers *
|
||||
*===========================================================================*/
|
||||
static u16_t
|
||||
static uint16_t
|
||||
pci_attr_rsts(int devind)
|
||||
{
|
||||
int busnr, busind;
|
||||
@@ -386,7 +386,7 @@ pci_attr_rsts(int devind)
|
||||
}
|
||||
|
||||
static void
|
||||
pci_attr_wsts(int devind, u16_t value)
|
||||
pci_attr_wsts(int devind, uint16_t value)
|
||||
{
|
||||
int busnr, busind;
|
||||
|
||||
@@ -395,10 +395,10 @@ pci_attr_wsts(int devind, u16_t value)
|
||||
pcibus[busind].pb_wsts(busind, value);
|
||||
}
|
||||
|
||||
static u16_t
|
||||
static uint16_t
|
||||
pcii_rsts(int busind)
|
||||
{
|
||||
u16_t v;
|
||||
uint16_t v;
|
||||
int s;
|
||||
|
||||
v= PCII_RREG16_(pcibus[busind].pb_busnr, 0, 0, PCI_SR);
|
||||
@@ -408,7 +408,7 @@ pcii_rsts(int busind)
|
||||
}
|
||||
|
||||
static void
|
||||
pcii_wsts(int busind, u16_t value)
|
||||
pcii_wsts(int busind, uint16_t value)
|
||||
{
|
||||
int s;
|
||||
PCII_WREG16_(pcibus[busind].pb_busnr, 0, 0, PCI_SR, value);
|
||||
@@ -453,7 +453,7 @@ get_freebus(void)
|
||||
}
|
||||
|
||||
static const char *
|
||||
pci_vid_name(u16_t vid)
|
||||
pci_vid_name(uint16_t vid)
|
||||
{
|
||||
static char vendor[PCI_VENDORSTR_LEN];
|
||||
pci_findvendor(vendor, sizeof(vendor), vid);
|
||||
@@ -466,7 +466,7 @@ static void
|
||||
print_hyper_cap(int devind, uint8_t capptr)
|
||||
{
|
||||
u32_t v;
|
||||
u16_t cmd;
|
||||
uint16_t cmd;
|
||||
int type0, type1;
|
||||
|
||||
printf("\n");
|
||||
@@ -583,7 +583,7 @@ static void
|
||||
update_bridge4dev_io(int devind, u32_t io_base, u32_t io_size)
|
||||
{
|
||||
int busnr, busind, type, br_devind;
|
||||
u16_t v16;
|
||||
uint16_t v16;
|
||||
|
||||
busnr= pcidev[devind].pd_busnr;
|
||||
busind= get_busind(busnr);
|
||||
@@ -660,7 +660,7 @@ do_amd_isabr(int devind)
|
||||
{
|
||||
int i, busnr, dev, func, xdevind, irq, edge;
|
||||
uint8_t levmask;
|
||||
u16_t pciirq;
|
||||
uint16_t pciirq;
|
||||
|
||||
/* Find required function */
|
||||
func= AMD_ISABR_FUNC;
|
||||
@@ -788,7 +788,7 @@ static int
|
||||
do_isabridge(int busind)
|
||||
{
|
||||
int i, j, r, type, busnr, unknown_bridge, bridge_dev;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
u32_t t3;
|
||||
const char *dstr;
|
||||
|
||||
@@ -1010,7 +1010,7 @@ record_bar(int devind, int bar_nr, int last)
|
||||
{
|
||||
int reg, prefetch, type, dev_bar_nr, width;
|
||||
u32_t bar, bar2;
|
||||
u16_t cmd;
|
||||
uint16_t cmd;
|
||||
|
||||
/* Start by assuming that this is a 32-bit bar, taking up one DWORD. */
|
||||
width = 1;
|
||||
@@ -1522,7 +1522,7 @@ probe_bus(int busind)
|
||||
#if 0
|
||||
uint32_t t3;
|
||||
#endif
|
||||
u16_t vid, did, sts, sub_vid, sub_did;
|
||||
uint16_t vid, did, sts, sub_vid, sub_did;
|
||||
uint8_t headt;
|
||||
uint8_t baseclass, subclass, infclass;
|
||||
int devind, busnr;
|
||||
@@ -1678,7 +1678,7 @@ probe_bus(int busind)
|
||||
}
|
||||
|
||||
|
||||
static u16_t
|
||||
static uint16_t
|
||||
pcibr_std_rsts(int busind)
|
||||
{
|
||||
int devind;
|
||||
@@ -1688,7 +1688,7 @@ pcibr_std_rsts(int busind)
|
||||
}
|
||||
|
||||
static void
|
||||
pcibr_std_wsts(int busind, u16_t value)
|
||||
pcibr_std_wsts(int busind, uint16_t value)
|
||||
{
|
||||
int devind;
|
||||
devind= pcibus[busind].pb_devind;
|
||||
@@ -1700,7 +1700,7 @@ pcibr_std_wsts(int busind, u16_t value)
|
||||
__pci_attr_w16(devind, PPB_SSTS, value);
|
||||
}
|
||||
|
||||
static u16_t
|
||||
static uint16_t
|
||||
pcibr_cb_rsts(int busind)
|
||||
{
|
||||
int devind;
|
||||
@@ -1710,7 +1710,7 @@ pcibr_cb_rsts(int busind)
|
||||
}
|
||||
|
||||
static void
|
||||
pcibr_cb_wsts(int busind, u16_t value)
|
||||
pcibr_cb_wsts(int busind, uint16_t value)
|
||||
{
|
||||
int devind;
|
||||
devind= pcibus[busind].pb_devind;
|
||||
@@ -1722,14 +1722,14 @@ pcibr_cb_wsts(int busind, u16_t value)
|
||||
__pci_attr_w16(devind, CBB_SSTS, value);
|
||||
}
|
||||
|
||||
static u16_t
|
||||
static uint16_t
|
||||
pcibr_via_rsts(int busind)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
pcibr_via_wsts(int busind, u16_t value)
|
||||
pcibr_via_wsts(int busind, uint16_t value)
|
||||
{
|
||||
#if 0
|
||||
int devind;
|
||||
@@ -1784,7 +1784,7 @@ do_pcibridge(int busind)
|
||||
{
|
||||
int devind, busnr;
|
||||
int ind, type;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
uint8_t sbusn, baseclass, subclass, infclass, headt;
|
||||
u32_t t3;
|
||||
|
||||
@@ -1928,7 +1928,7 @@ pci_intel_init(void)
|
||||
* PCI controller.
|
||||
*/
|
||||
u32_t bus, dev, func;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
int s, i, r, busind, busnr;
|
||||
const char *dstr;
|
||||
|
||||
@@ -2038,7 +2038,7 @@ report_vga(int devind)
|
||||
static int
|
||||
visible(struct rs_pci *aclp, int devind)
|
||||
{
|
||||
u16_t acl_sub_vid, acl_sub_did;
|
||||
uint16_t acl_sub_vid, acl_sub_did;
|
||||
int i;
|
||||
u32_t class_id;
|
||||
|
||||
@@ -2210,8 +2210,8 @@ _pci_find_dev(uint8_t bus, uint8_t dev, uint8_t func, int *devindp)
|
||||
* _pci_first_dev *
|
||||
*===========================================================================*/
|
||||
int
|
||||
_pci_first_dev(struct rs_pci *aclp, int *devindp, u16_t *vidp,
|
||||
u16_t *didp)
|
||||
_pci_first_dev(struct rs_pci *aclp, int *devindp, uint16_t *vidp,
|
||||
uint16_t *didp)
|
||||
{
|
||||
int devind;
|
||||
|
||||
@@ -2233,7 +2233,7 @@ _pci_first_dev(struct rs_pci *aclp, int *devindp, u16_t *vidp,
|
||||
* _pci_next_dev *
|
||||
*===========================================================================*/
|
||||
int
|
||||
_pci_next_dev(struct rs_pci *aclp, int *devindp, u16_t *vidp, u16_t *didp)
|
||||
_pci_next_dev(struct rs_pci *aclp, int *devindp, uint16_t *vidp, uint16_t *didp)
|
||||
{
|
||||
int devind;
|
||||
|
||||
@@ -2365,7 +2365,7 @@ _pci_release(endpoint_t proc)
|
||||
* _pci_ids *
|
||||
*===========================================================================*/
|
||||
int
|
||||
_pci_ids(int devind, u16_t *vidp, u16_t *didp)
|
||||
_pci_ids(int devind, uint16_t *vidp, uint16_t *didp)
|
||||
{
|
||||
if (devind < 0 || devind >= nr_pcidev)
|
||||
return EINVAL;
|
||||
@@ -2430,7 +2430,7 @@ _pci_slot_name(int devind, char **cpp)
|
||||
* _pci_dev_name *
|
||||
*===========================================================================*/
|
||||
const char *
|
||||
_pci_dev_name(u16_t vid, u16_t did)
|
||||
_pci_dev_name(uint16_t vid, uint16_t did)
|
||||
{
|
||||
static char product[PCI_PRODUCTSTR_LEN];
|
||||
pci_findproduct(product, sizeof(product), vid, did);
|
||||
@@ -2487,7 +2487,7 @@ _pci_attr_r8(int devind, int port, uint8_t *vp)
|
||||
* _pci_attr_r16 *
|
||||
*===========================================================================*/
|
||||
int
|
||||
_pci_attr_r16(int devind, int port, u16_t *vp)
|
||||
_pci_attr_r16(int devind, int port, uint16_t *vp)
|
||||
{
|
||||
if (devind < 0 || devind >= nr_pcidev)
|
||||
return EINVAL;
|
||||
@@ -2532,7 +2532,7 @@ _pci_attr_w8(int devind, int port, uint8_t value)
|
||||
* _pci_attr_w16 *
|
||||
*===========================================================================*/
|
||||
int
|
||||
_pci_attr_w16(int devind, int port, u16_t value)
|
||||
_pci_attr_w16(int devind, int port, uint16_t value)
|
||||
{
|
||||
if (devind < 0 || devind >= nr_pcidev)
|
||||
return EINVAL;
|
||||
|
||||
@@ -6,8 +6,8 @@ Created: Jan 2000 by Philip Homburg <philip@cs.vu.nl>
|
||||
|
||||
struct pci_isabridge
|
||||
{
|
||||
u16_t vid;
|
||||
u16_t did;
|
||||
uint16_t vid;
|
||||
uint16_t did;
|
||||
int checkclass;
|
||||
int type;
|
||||
};
|
||||
@@ -43,29 +43,29 @@ int _pci_grant_access(int devind, endpoint_t proc);
|
||||
int _pci_reserve(int devind, endpoint_t proc, struct rs_pci *aclp);
|
||||
void _pci_release(endpoint_t proc);
|
||||
|
||||
int _pci_first_dev(struct rs_pci *aclp, int *devindp, u16_t *vidp,
|
||||
u16_t *didp);
|
||||
int _pci_next_dev(struct rs_pci *aclp, int *devindp, u16_t *vidp, u16_t
|
||||
int _pci_first_dev(struct rs_pci *aclp, int *devindp, uint16_t *vidp,
|
||||
uint16_t *didp);
|
||||
int _pci_next_dev(struct rs_pci *aclp, int *devindp, uint16_t *vidp, uint16_t
|
||||
*didp);
|
||||
int _pci_find_dev(uint8_t bus, uint8_t dev, uint8_t func, int *devindp);
|
||||
|
||||
void _pci_rescan_bus(uint8_t busnr);
|
||||
const char *_pci_dev_name(u16_t vid, u16_t did);
|
||||
const char *_pci_dev_name(uint16_t vid, uint16_t did);
|
||||
|
||||
|
||||
int _pci_get_bar(int devind, int port, u32_t *base, u32_t *size, int
|
||||
*ioflag);
|
||||
int _pci_slot_name(int devind, char **cpp);
|
||||
int _pci_ids(int devind, u16_t *vidp, u16_t *didp);
|
||||
int _pci_ids(int devind, uint16_t *vidp, uint16_t *didp);
|
||||
|
||||
/* PCI Config Read functions */
|
||||
int _pci_attr_r8(int devind, int port, uint8_t *vp);
|
||||
int _pci_attr_r16(int devind, int port, u16_t *vp);
|
||||
int _pci_attr_r16(int devind, int port, uint16_t *vp);
|
||||
int _pci_attr_r32(int devind, int port, u32_t *vp);
|
||||
|
||||
/* PCI Config Write functions */
|
||||
int _pci_attr_w8(int devind, int port, uint8_t value);
|
||||
int _pci_attr_w16(int devind, int port, u16_t value);
|
||||
int _pci_attr_w16(int devind, int port, uint16_t value);
|
||||
int _pci_attr_w32(int devind, int port, u32_t value);
|
||||
|
||||
/* minix hooks into NetBSD PCI IDS DB */
|
||||
|
||||
@@ -21,7 +21,7 @@ static struct port
|
||||
{
|
||||
int p_devind;
|
||||
uint8_t p_cb_busnr;
|
||||
u16_t p_exca_port;
|
||||
uint16_t p_exca_port;
|
||||
#if USE_INTS
|
||||
int p_irq;
|
||||
int p_hook;
|
||||
@@ -113,7 +113,7 @@ static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
*===========================================================================*/
|
||||
static int hw_probe(int skip)
|
||||
{
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
int devind;
|
||||
|
||||
pci_init();
|
||||
@@ -139,7 +139,7 @@ static int hw_probe(int skip)
|
||||
static void hw_init(struct port *pp, int devind)
|
||||
{
|
||||
uint8_t v8;
|
||||
u16_t v16;
|
||||
uint16_t v16;
|
||||
u32_t v32;
|
||||
#if USE_INTS
|
||||
int r, irq;
|
||||
@@ -251,7 +251,7 @@ static void do_int(struct port *pp)
|
||||
spin_t spin;
|
||||
u32_t csr_event, csr_present, csr_control;
|
||||
uint8_t v8;
|
||||
u16_t v16;
|
||||
uint16_t v16;
|
||||
#if USE_INTS
|
||||
int r;
|
||||
#endif
|
||||
|
||||
@@ -118,7 +118,7 @@ static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
{
|
||||
/* Initialize the amddev driver. */
|
||||
int r, n_maps, n_domains, revision;
|
||||
u16_t flags;
|
||||
uint16_t flags;
|
||||
u32_t bits;
|
||||
|
||||
printf("amddev: starting\n");
|
||||
@@ -204,7 +204,7 @@ uint8_t *capaddrp;
|
||||
{
|
||||
int r, devind, first;
|
||||
uint8_t capptr, type, next, subtype;
|
||||
u16_t vid, did, status;
|
||||
uint16_t vid, did, status;
|
||||
|
||||
pci_init();
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
#include "dec21140A.h"
|
||||
|
||||
static u32_t io_inl(u16_t);
|
||||
static void io_outl(u16_t, u32_t);
|
||||
static u32_t io_inl(uint16_t);
|
||||
static void io_outl(uint16_t, u32_t);
|
||||
|
||||
static int do_init(unsigned int, netdriver_addr_t *, uint32_t *,
|
||||
unsigned int *);
|
||||
@@ -34,7 +34,7 @@ static void de_reset(const dpeth_t *);
|
||||
static void de_hw_conf(const dpeth_t *);
|
||||
static void de_start(const dpeth_t *);
|
||||
static void de_setup_frame(const dpeth_t *, const netdriver_addr_t *);
|
||||
static u16_t de_read_rom(const dpeth_t *, uint8_t, uint8_t);
|
||||
static uint16_t de_read_rom(const dpeth_t *, uint8_t, uint8_t);
|
||||
|
||||
static dpeth_t de_state;
|
||||
|
||||
@@ -96,7 +96,7 @@ static int do_init(unsigned int instance, netdriver_addr_t *addr,
|
||||
static int de_probe(dpeth_t *dep, unsigned int skip)
|
||||
{
|
||||
int r, devind;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
|
||||
DEBUG(printf("PROBING..."));
|
||||
|
||||
@@ -137,9 +137,9 @@ static int de_probe(dpeth_t *dep, unsigned int skip)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static u16_t de_read_rom(const dpeth_t *dep, uint8_t addr, uint8_t nbAddrBits)
|
||||
static uint16_t de_read_rom(const dpeth_t *dep, uint8_t addr, uint8_t nbAddrBits)
|
||||
{
|
||||
u16_t retVal = 0;
|
||||
uint16_t retVal = 0;
|
||||
int i;
|
||||
u32_t csr = 0;
|
||||
u32_t csr2 = 0; /* csr2 is used to hold constant values that are
|
||||
@@ -256,7 +256,7 @@ static ssize_t do_recv(struct netdriver_data *data, size_t max)
|
||||
|
||||
static void de_conf_addr(dpeth_t *dep, netdriver_addr_t *addr)
|
||||
{
|
||||
u16_t temp16;
|
||||
uint16_t temp16;
|
||||
int i;
|
||||
|
||||
DEBUG(printf("Reading SROM...\n"));
|
||||
@@ -492,7 +492,7 @@ static int do_send(struct netdriver_data *data, size_t size)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static u32_t io_inl(u16_t port)
|
||||
static u32_t io_inl(uint16_t port)
|
||||
{
|
||||
u32_t value;
|
||||
int rc;
|
||||
@@ -501,7 +501,7 @@ static u32_t io_inl(u16_t port)
|
||||
return value;
|
||||
}
|
||||
|
||||
static void io_outl(u16_t port, u32_t value)
|
||||
static void io_outl(uint16_t port, u32_t value)
|
||||
{
|
||||
int rc;
|
||||
if ((rc = sys_outl(port, value)) != OK)
|
||||
|
||||
@@ -602,7 +602,7 @@ static ssize_t do_recv(struct netdriver_data *data, size_t max)
|
||||
unsigned pageno, curr, next;
|
||||
size_t length;
|
||||
int packet_processed;
|
||||
u16_t eth_type;
|
||||
uint16_t eth_type;
|
||||
|
||||
dep = &de_state;
|
||||
|
||||
@@ -946,7 +946,7 @@ uint8_t inb(port_t port)
|
||||
return value;
|
||||
}
|
||||
|
||||
u16_t inw(port_t port)
|
||||
uint16_t inw(port_t port)
|
||||
{
|
||||
int r;
|
||||
u32_t value;
|
||||
@@ -954,7 +954,7 @@ u16_t inw(port_t port)
|
||||
r= sys_inw(port, &value);
|
||||
if (r != OK)
|
||||
panic("sys_inw failed: %d", r);
|
||||
return (u16_t) value;
|
||||
return (uint16_t) value;
|
||||
}
|
||||
|
||||
void outb(port_t port, uint8_t value)
|
||||
@@ -966,7 +966,7 @@ void outb(port_t port, uint8_t value)
|
||||
panic("sys_outb failed: %d", r);
|
||||
}
|
||||
|
||||
void outw(port_t port, u16_t value)
|
||||
void outw(port_t port, uint16_t value)
|
||||
{
|
||||
int r;
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ int el2_probe(struct dpeth* dep);
|
||||
|
||||
/* dp8390.c */
|
||||
uint8_t inb(port_t port);
|
||||
u16_t inw(port_t port);
|
||||
uint16_t inw(port_t port);
|
||||
void outb(port_t port, uint8_t v);
|
||||
void outw(port_t port, u16_t v);
|
||||
void outw(port_t port, uint16_t v);
|
||||
|
||||
/* ne2000.c */
|
||||
int ne_probe(struct dpeth *dep);
|
||||
|
||||
@@ -267,7 +267,7 @@ uint8_t *pat;
|
||||
|
||||
for (i= 0; i<4; i += 2)
|
||||
{
|
||||
outw_ne(dep, NE_DATA, *(u16_t *)(pat+i));
|
||||
outw_ne(dep, NE_DATA, *(uint16_t *)(pat+i));
|
||||
}
|
||||
|
||||
for (i= 0; i<N; i++)
|
||||
@@ -293,7 +293,7 @@ uint8_t *pat;
|
||||
|
||||
for (i= 0; i<4; i += 2)
|
||||
{
|
||||
*(u16_t *)(buf+i)= inw_ne(dep, NE_DATA);
|
||||
*(uint16_t *)(buf+i)= inw_ne(dep, NE_DATA);
|
||||
}
|
||||
|
||||
r= (memcmp(buf, pat, 4) == 0);
|
||||
|
||||
@@ -21,9 +21,9 @@ Created: April 2000 by Philip Homburg <philip@f-mnx.phicoh.com>
|
||||
|
||||
static void rtl_init(struct dpeth *dep);
|
||||
#if 0
|
||||
static u16_t get_ee_word(dpeth_t *dep, int a);
|
||||
static uint16_t get_ee_word(dpeth_t *dep, int a);
|
||||
static void ee_wen(dpeth_t *dep);
|
||||
static void set_ee_word(dpeth_t *dep, int a, u16_t w);
|
||||
static void set_ee_word(dpeth_t *dep, int a, uint16_t w);
|
||||
static void ee_wds(dpeth_t *dep);
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@ struct dpeth *dep;
|
||||
int skip;
|
||||
{
|
||||
int r, devind;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
u32_t bar;
|
||||
uint8_t ilr;
|
||||
const char *dname;
|
||||
@@ -170,12 +170,12 @@ dpeth_t *dep;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static u16_t get_ee_word(dep, a)
|
||||
static uint16_t get_ee_word(dep, a)
|
||||
dpeth_t *dep;
|
||||
int a;
|
||||
{
|
||||
int b, i, cmd;
|
||||
u16_t w;
|
||||
uint16_t w;
|
||||
|
||||
outb_reg0(dep, DP_CR, CR_PS_P3); /* Bank 3 */
|
||||
|
||||
@@ -243,7 +243,7 @@ dpeth_t *dep;
|
||||
static void set_ee_word(dep, a, w)
|
||||
dpeth_t *dep;
|
||||
int a;
|
||||
u16_t w;
|
||||
uint16_t w;
|
||||
{
|
||||
int b, i, cmd;
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ static void el1_stop(dpeth_t * dep)
|
||||
*/
|
||||
static void el1_interrupt(dpeth_t * dep)
|
||||
{
|
||||
u16_t csr, isr;
|
||||
uint16_t csr, isr;
|
||||
int pktsize;
|
||||
buff_t *rxptr;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
** Name: ns_rw_setup
|
||||
** Function: Sets the board for reading/writing.
|
||||
*/
|
||||
static void ns_rw_setup(const dpeth_t *dep, int mode, int size, u16_t offset)
|
||||
static void ns_rw_setup(const dpeth_t *dep, int mode, int size, uint16_t offset)
|
||||
{
|
||||
|
||||
if (mode == CR_DM_RW) outb_reg0(dep, DP_ISR, ISR_RDC);
|
||||
@@ -52,7 +52,7 @@ static void ns_start_xmit(const dpeth_t * dep, int size, int pageno)
|
||||
** Name: mem_getblock
|
||||
** Function: Reads a block of packet from board (shared memory).
|
||||
*/
|
||||
static void mem_getblock(dpeth_t *dep, u16_t offset, int size, void *dst)
|
||||
static void mem_getblock(dpeth_t *dep, uint16_t offset, int size, void *dst)
|
||||
{
|
||||
|
||||
assert(size >= 0);
|
||||
@@ -101,7 +101,7 @@ static void mem_user2nic(dpeth_t *dep, int pageno, struct netdriver_data *data,
|
||||
** Name: pio_getblock
|
||||
** Function: Reads a block of packet from board (Prog. I/O).
|
||||
*/
|
||||
static void pio_getblock(dpeth_t *dep, u16_t offset, int size, void *dst)
|
||||
static void pio_getblock(dpeth_t *dep, uint16_t offset, int size, void *dst)
|
||||
{
|
||||
|
||||
/* Sets up board for reading */
|
||||
@@ -278,7 +278,7 @@ static ssize_t ns_recv(dpeth_t *dep, struct netdriver_data *data, size_t max)
|
||||
size_t length;
|
||||
int packet_processed = FALSE;
|
||||
#ifdef ETH_IGN_PROTO
|
||||
u16_t eth_type;
|
||||
uint16_t eth_type;
|
||||
#endif
|
||||
|
||||
pageno = inb_reg0(dep, DP_BNRY) + 1;
|
||||
|
||||
@@ -79,7 +79,7 @@ typedef void (*dp_user2nicf_t)(struct dpeth *, int, struct netdriver_data *,
|
||||
size_t);
|
||||
typedef void (*dp_nic2userf_t)(struct dpeth *, int, struct netdriver_data *,
|
||||
size_t);
|
||||
typedef void (*dp_getblock_t)(struct dpeth *, u16_t, int, void *);
|
||||
typedef void (*dp_getblock_t)(struct dpeth *, uint16_t, int, void *);
|
||||
#endif
|
||||
|
||||
#define SENDQ_NR 2 /* Size of the send queue */
|
||||
@@ -169,7 +169,7 @@ typedef struct dpeth {
|
||||
/* For use by 3Com Etherlink (3c501 and 3c509) driver */
|
||||
buff_t *de_recvq_head;
|
||||
buff_t *de_recvq_tail;
|
||||
u16_t de_recv_mode;
|
||||
uint16_t de_recv_mode;
|
||||
clock_t de_xmit_start;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ static uint32_t e1000_reg_read(e1000_t *e, uint32_t reg);
|
||||
static void e1000_reg_write(e1000_t *e, uint32_t reg, uint32_t value);
|
||||
static void e1000_reg_set(e1000_t *e, uint32_t reg, uint32_t value);
|
||||
static void e1000_reg_unset(e1000_t *e, uint32_t reg, uint32_t value);
|
||||
static u16_t eeprom_eerd(e1000_t *e, int reg);
|
||||
static u16_t eeprom_ich(e1000_t *e, int reg);
|
||||
static uint16_t eeprom_eerd(e1000_t *e, int reg);
|
||||
static uint16_t eeprom_ich(e1000_t *e, int reg);
|
||||
static int eeprom_ich_init(e1000_t *e);
|
||||
static int eeprom_ich_cycle(e1000_t *e, u32_t timeout);
|
||||
|
||||
@@ -145,7 +145,7 @@ static int
|
||||
e1000_probe(e1000_t * e, int skip)
|
||||
{
|
||||
int r, devind, ioflag;
|
||||
u16_t vid, did, cr;
|
||||
uint16_t vid, did, cr;
|
||||
u32_t status;
|
||||
u32_t base, size;
|
||||
const char *dname;
|
||||
@@ -250,7 +250,7 @@ e1000_init_addr(e1000_t * e, netdriver_addr_t * addr)
|
||||
{
|
||||
static char eakey[] = E1000_ENVVAR "#_EA";
|
||||
static char eafmt[] = "x:x:x:x:x:x";
|
||||
u16_t word;
|
||||
uint16_t word;
|
||||
int i;
|
||||
long v;
|
||||
|
||||
@@ -450,7 +450,7 @@ e1000_set_hwaddr(const netdriver_addr_t * hwaddr)
|
||||
e1000_reg_write(e, E1000_REG_RAL,
|
||||
*(const u32_t *)(&hwaddr->na_addr[0]));
|
||||
e1000_reg_write(e, E1000_REG_RAH,
|
||||
*(const u16_t *)(&hwaddr->na_addr[4]));
|
||||
*(const uint16_t *)(&hwaddr->na_addr[4]));
|
||||
e1000_reg_set(e, E1000_REG_RAH, E1000_REG_RAH_AV);
|
||||
}
|
||||
|
||||
@@ -723,7 +723,7 @@ e1000_reg_unset(e1000_t * e, uint32_t reg, uint32_t value)
|
||||
/*
|
||||
* Read from EEPROM.
|
||||
*/
|
||||
static u16_t
|
||||
static uint16_t
|
||||
eeprom_eerd(e1000_t * e, int reg)
|
||||
{
|
||||
u32_t data;
|
||||
@@ -846,7 +846,7 @@ eeprom_ich_cycle(e1000_t * e, u32_t timeout)
|
||||
/*
|
||||
* Read from ICH8 flash.
|
||||
*/
|
||||
static u16_t
|
||||
static uint16_t
|
||||
eeprom_ich(e1000_t * e, int reg)
|
||||
{
|
||||
union ich8_hws_flash_status hsfsts;
|
||||
@@ -855,14 +855,14 @@ eeprom_ich(e1000_t * e, int reg)
|
||||
u32_t flash_data = 0;
|
||||
int ret_val = -1;
|
||||
uint8_t count = 0;
|
||||
u16_t data = 0;
|
||||
uint16_t data = 0;
|
||||
|
||||
E1000_DEBUG(3, ("e1000_read_flash_data_ich8lan"));
|
||||
|
||||
if (reg > ICH_FLASH_LINEAR_ADDR_MASK)
|
||||
return data;
|
||||
|
||||
reg *= sizeof(u16_t);
|
||||
reg *= sizeof(uint16_t);
|
||||
flash_linear_addr = (ICH_FLASH_LINEAR_ADDR_MASK & reg) +
|
||||
e->flash_base_addr;
|
||||
|
||||
@@ -891,7 +891,7 @@ eeprom_ich(e1000_t * e, int reg)
|
||||
*/
|
||||
if (ret_val == 0) {
|
||||
flash_data = E1000_READ_FLASH_REG(e, ICH_FLASH_FDATA0);
|
||||
data = (u16_t)(flash_data & 0x0000FFFF);
|
||||
data = (uint16_t)(flash_data & 0x0000FFFF);
|
||||
break;
|
||||
} else {
|
||||
/*
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
* @param reg Register offset.
|
||||
*/
|
||||
#define E1000_READ_FLASH_REG16(e,reg) \
|
||||
*(u16_t *) (((e)->flash) + (reg))
|
||||
*(uint16_t *) (((e)->flash) + (reg))
|
||||
|
||||
/**
|
||||
* Write a 16-bit word to flash memory.
|
||||
@@ -101,7 +101,7 @@
|
||||
* @param value New value.
|
||||
*/
|
||||
#define E1000_WRITE_FLASH_REG16(e,reg,value) \
|
||||
*((u16_t *) (((e)->flash) + (reg))) = (value)
|
||||
*((uint16_t *) (((e)->flash) + (reg))) = (value)
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -117,7 +117,7 @@ typedef struct e1000
|
||||
uint8_t *regs; /**< Memory mapped hardware registers. */
|
||||
uint8_t *flash; /**< Optional flash memory. */
|
||||
u32_t flash_base_addr; /**< Flash base address. */
|
||||
u16_t (*eeprom_read)(struct e1000 *, int reg);
|
||||
uint16_t (*eeprom_read)(struct e1000 *, int reg);
|
||||
/**< Function to read the EEPROM. */
|
||||
int eeprom_done_bit; /**< Offset of the EERD.DONE bit. */
|
||||
int eeprom_addr_off; /**< Offset of the EERD.ADDR field. */
|
||||
|
||||
@@ -32,11 +32,11 @@ typedef struct e1000_rx_desc
|
||||
{
|
||||
u32_t buffer; /**< Address of the receive data buffer (64-bit). */
|
||||
u32_t buffer_h; /**< High 32-bits of the receive data buffer (unused). */
|
||||
u16_t length; /**< Size of the receive buffer. */
|
||||
u16_t checksum; /**< Packet checksum. */
|
||||
uint16_t length; /**< Size of the receive buffer. */
|
||||
uint16_t checksum; /**< Packet checksum. */
|
||||
uint8_t status; /**< Descriptor status. */
|
||||
uint8_t errors; /**< Descriptor errors. */
|
||||
u16_t special; /**< VLAN information. */
|
||||
uint16_t special; /**< VLAN information. */
|
||||
}
|
||||
e1000_rx_desc_t;
|
||||
|
||||
@@ -47,12 +47,12 @@ typedef struct e1000_tx_desc
|
||||
{
|
||||
u32_t buffer; /**< Address of the transmit buffer (64-bit). */
|
||||
u32_t buffer_h; /**< High 32-bits of the transmit buffer (unused). */
|
||||
u16_t length; /**< Size of the transmit buffer contents. */
|
||||
uint16_t length; /**< Size of the transmit buffer contents. */
|
||||
uint8_t checksum_off; /**< Checksum Offset. */
|
||||
uint8_t command; /**< Command field. */
|
||||
uint8_t status; /**< Status field. */
|
||||
uint8_t checksum_st; /**< Checksum Start. */
|
||||
u16_t special; /**< Optional special bits. */
|
||||
uint16_t special; /**< Optional special bits. */
|
||||
}
|
||||
e1000_tx_desc_t;
|
||||
|
||||
@@ -74,7 +74,7 @@ union ich8_hws_flash_status
|
||||
unsigned fldesvalid :1; /**< bit 14 Flash Descriptor Valid */
|
||||
unsigned flockdn :1; /**< bit 15 Flash Config Lock-Down */
|
||||
} hsf_status;
|
||||
u16_t regval;
|
||||
uint16_t regval;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -91,7 +91,7 @@ union ich8_hws_flash_ctrl
|
||||
unsigned fldbcount :2; /**< 9:8 Flash Data Byte Count */
|
||||
unsigned flockdn :6; /**< 15:10 Reserved */
|
||||
} hsf_ctrl;
|
||||
u16_t regval;
|
||||
uint16_t regval;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ union ich8_hws_flash_regacc
|
||||
unsigned gmrag :8; /**< 23:16 GbE Master Read Access Grant */
|
||||
unsigned gmwag :8; /**< 31:24 GbE Master Write Access Grant */
|
||||
} hsf_flregacc;
|
||||
u16_t regval;
|
||||
uint16_t regval;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,7 +71,7 @@ typedef struct fxp
|
||||
/* Link status */
|
||||
int fxp_report_link;
|
||||
int fxp_link_up;
|
||||
u16_t fxp_mii_scr;
|
||||
uint16_t fxp_mii_scr;
|
||||
|
||||
irq_hook_t fxp_hook;
|
||||
struct sc fxp_stat;
|
||||
@@ -120,9 +120,9 @@ static void fxp_tick(void);
|
||||
static int fxp_link_changed(fxp_t *fp);
|
||||
static unsigned int fxp_get_link(uint32_t *media);
|
||||
static void fxp_report_link(fxp_t *fp);
|
||||
static u16_t eeprom_read(fxp_t *fp, int reg);
|
||||
static uint16_t eeprom_read(fxp_t *fp, int reg);
|
||||
static void eeprom_addrsize(fxp_t *fp);
|
||||
static u16_t mii_read(fxp_t *fp, int reg);
|
||||
static uint16_t mii_read(fxp_t *fp, int reg);
|
||||
static uint8_t do_inb(port_t port);
|
||||
static u32_t do_inl(port_t port);
|
||||
static void do_outb(port_t port, uint8_t v);
|
||||
@@ -234,7 +234,7 @@ static int fxp_init(unsigned int instance, netdriver_addr_t *addr,
|
||||
static int fxp_probe(fxp_t *fp, int skip)
|
||||
{
|
||||
int r, devind;
|
||||
u16_t vid, did, cr;
|
||||
uint16_t vid, did, cr;
|
||||
u32_t bar;
|
||||
uint8_t ilr, rev;
|
||||
const char *str;
|
||||
@@ -726,7 +726,7 @@ static int fxp_send(struct netdriver_data *data, size_t size)
|
||||
{
|
||||
int prev_head;
|
||||
int fxp_tx_nbuf, fxp_tx_head;
|
||||
u16_t tx_command;
|
||||
uint16_t tx_command;
|
||||
fxp_t *fp;
|
||||
struct tx *txp, *prev_txp;
|
||||
|
||||
@@ -822,8 +822,8 @@ static ssize_t fxp_recv(struct netdriver_data *data, size_t max)
|
||||
int fxp_rx_head, fxp_rx_nbuf;
|
||||
port_t port;
|
||||
unsigned packlen;
|
||||
u16_t rfd_status;
|
||||
u16_t rfd_res;
|
||||
uint16_t rfd_status;
|
||||
uint16_t rfd_res;
|
||||
fxp_t *fp;
|
||||
struct rfd *rfdp, *prev_rfdp;
|
||||
|
||||
@@ -1079,7 +1079,7 @@ static void fxp_update_stats(void)
|
||||
static void fxp_handler(fxp_t *fp)
|
||||
{
|
||||
int port;
|
||||
u16_t isr;
|
||||
uint16_t isr;
|
||||
|
||||
port= fp->fxp_base_port;
|
||||
|
||||
@@ -1127,7 +1127,7 @@ static void fxp_check_ints(fxp_t *fp)
|
||||
int fxp_tx_tail, fxp_tx_nbuf, fxp_tx_threshold;
|
||||
port_t port;
|
||||
u32_t busaddr;
|
||||
u16_t tx_status;
|
||||
uint16_t tx_status;
|
||||
uint8_t scb_status;
|
||||
struct tx *txp;
|
||||
|
||||
@@ -1279,7 +1279,7 @@ static void fxp_tick(void)
|
||||
*===========================================================================*/
|
||||
static int fxp_link_changed(fxp_t *fp)
|
||||
{
|
||||
u16_t scr;
|
||||
uint16_t scr;
|
||||
|
||||
scr= mii_read(fp, MII_SCR);
|
||||
scr &= ~(MII_SCR_RES|MII_SCR_RES_1);
|
||||
@@ -1293,7 +1293,7 @@ static int fxp_link_changed(fxp_t *fp)
|
||||
static unsigned int fxp_get_link(uint32_t *media)
|
||||
{
|
||||
fxp_t *fp;
|
||||
u16_t mii_status, scr;
|
||||
uint16_t mii_status, scr;
|
||||
|
||||
fp = fxp_state;
|
||||
|
||||
@@ -1323,7 +1323,7 @@ static unsigned int fxp_get_link(uint32_t *media)
|
||||
*===========================================================================*/
|
||||
static void fxp_report_link(fxp_t *fp)
|
||||
{
|
||||
u16_t mii_ctrl, mii_status, mii_id1, mii_id2,
|
||||
uint16_t mii_ctrl, mii_status, mii_id1, mii_id2,
|
||||
mii_ana, mii_anlpa, mii_ane, mii_extstat,
|
||||
mii_ms_ctrl, mii_ms_status, scr;
|
||||
u32_t oui;
|
||||
@@ -1561,10 +1561,10 @@ resspeed:
|
||||
/*===========================================================================*
|
||||
* eeprom_read *
|
||||
*===========================================================================*/
|
||||
static u16_t eeprom_read(fxp_t *fp, int reg)
|
||||
static uint16_t eeprom_read(fxp_t *fp, int reg)
|
||||
{
|
||||
port_t port;
|
||||
u16_t v;
|
||||
uint16_t v;
|
||||
int b, i, alen;
|
||||
|
||||
alen= fp->fxp_ee_addrlen;
|
||||
@@ -1622,7 +1622,7 @@ static u16_t eeprom_read(fxp_t *fp, int reg)
|
||||
static void eeprom_addrsize(fxp_t *fp)
|
||||
{
|
||||
port_t port;
|
||||
u16_t v;
|
||||
uint16_t v;
|
||||
int b, i;
|
||||
|
||||
port= fp->fxp_base_port;
|
||||
@@ -1676,7 +1676,7 @@ static void eeprom_addrsize(fxp_t *fp)
|
||||
/*===========================================================================*
|
||||
* mii_read *
|
||||
*===========================================================================*/
|
||||
static u16_t mii_read(fxp_t *fp, int reg)
|
||||
static uint16_t mii_read(fxp_t *fp, int reg)
|
||||
{
|
||||
spin_t spin;
|
||||
port_t port;
|
||||
|
||||
@@ -167,8 +167,8 @@ Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
|
||||
/* Individual Address Setup (1) */
|
||||
struct ias
|
||||
{
|
||||
u16_t ias_status;
|
||||
u16_t ias_command;
|
||||
uint16_t ias_status;
|
||||
uint16_t ias_command;
|
||||
u32_t ias_linkaddr;
|
||||
uint8_t ias_ethaddr[6];
|
||||
uint8_t ias_reserved[2];
|
||||
@@ -178,8 +178,8 @@ struct ias
|
||||
#define CC_BYTES_NR 22 /* Number of configuration bytes */
|
||||
struct cbl_conf
|
||||
{
|
||||
u16_t cc_status;
|
||||
u16_t cc_command;
|
||||
uint16_t cc_status;
|
||||
uint16_t cc_command;
|
||||
u32_t cc_linkaddr;
|
||||
uint8_t cc_bytes[CC_BYTES_NR];
|
||||
};
|
||||
@@ -422,11 +422,11 @@ struct cbl_conf
|
||||
/* Transmit (4) */
|
||||
struct tx
|
||||
{
|
||||
u16_t tx_status;
|
||||
u16_t tx_command;
|
||||
uint16_t tx_status;
|
||||
uint16_t tx_command;
|
||||
u32_t tx_linkaddr;
|
||||
u32_t tx_tbda;
|
||||
u16_t tx_size;
|
||||
uint16_t tx_size;
|
||||
uint8_t tx_tthresh;
|
||||
uint8_t tx_ntbd;
|
||||
uint8_t tx_buf[NDEV_ETH_PACKET_MAX_TAGGED];
|
||||
@@ -500,12 +500,12 @@ struct sc
|
||||
/* Receive Frame Descriptor (RFD) */
|
||||
struct rfd
|
||||
{
|
||||
u16_t rfd_status;
|
||||
u16_t rfd_command;
|
||||
uint16_t rfd_status;
|
||||
uint16_t rfd_command;
|
||||
u32_t rfd_linkaddr;
|
||||
u32_t rfd_reserved;
|
||||
u16_t rfd_res;
|
||||
u16_t rfd_size;
|
||||
uint16_t rfd_res;
|
||||
uint16_t rfd_size;
|
||||
uint8_t rfd_buf[NDEV_ETH_PACKET_MAX_TAGGED];
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Media Independent (Ethernet) Interface functions
|
||||
/*===========================================================================*
|
||||
* mii_print_stat_speed *
|
||||
*===========================================================================*/
|
||||
void mii_print_stat_speed(u16_t stat, u16_t extstat)
|
||||
void mii_print_stat_speed(uint16_t stat, uint16_t extstat)
|
||||
{
|
||||
int fs, ft;
|
||||
|
||||
@@ -117,7 +117,7 @@ void mii_print_stat_speed(u16_t stat, u16_t extstat)
|
||||
/*===========================================================================*
|
||||
* mii_print_techab *
|
||||
*===========================================================================*/
|
||||
void mii_print_techab(u16_t techab)
|
||||
void mii_print_techab(uint16_t techab)
|
||||
{
|
||||
int fs, ft;
|
||||
|
||||
|
||||
@@ -111,8 +111,8 @@ Definitions for the Media Independent (Ethernet) Interface
|
||||
#define MII_ESTAT_RES 0x0FFF /* Reserved */
|
||||
/* 0x10 ... 0x1F */ /* Vendor Specific */
|
||||
|
||||
void mii_print_stat_speed(u16_t stat, u16_t extstat);
|
||||
void mii_print_techab(u16_t techab);
|
||||
void mii_print_stat_speed(uint16_t stat, uint16_t extstat);
|
||||
void mii_print_techab(uint16_t techab);
|
||||
|
||||
#endif
|
||||
/*
|
||||
|
||||
@@ -19,16 +19,16 @@ static uint8_t my_inb(u32_t port) {
|
||||
}
|
||||
#define ndr_in8(port, offset) (my_inb((port) + (offset)))
|
||||
|
||||
static u16_t my_inw(u32_t port) {
|
||||
static uint16_t my_inw(u32_t port) {
|
||||
u32_t value;
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
value = *(volatile u16_t *)(port);
|
||||
value = *(volatile uint16_t *)(port);
|
||||
#else
|
||||
if ((r = sys_inw(port, &value)) != OK)
|
||||
printf("NDR: sys_inw failed: %d\n", r);
|
||||
#endif
|
||||
return (u16_t)value;
|
||||
return (uint16_t)value;
|
||||
}
|
||||
#define ndr_in16(port, offset) (my_inw((port) + (offset)))
|
||||
|
||||
@@ -60,9 +60,9 @@ static void my_outb(u32_t port, u32_t value) {
|
||||
static void my_outw(u32_t port, u32_t value) {
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
*(volatile u16_t *)(port) = value;
|
||||
*(volatile uint16_t *)(port) = value;
|
||||
#else
|
||||
if ((r = sys_outw(port, (u16_t)value)) != OK)
|
||||
if ((r = sys_outw(port, (uint16_t)value)) != OK)
|
||||
printf("NDR: sys_outw failed: %d\n", r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ static void dev_set_tx_desc_done(u32_t *base, NDR_desc *desc, int index);
|
||||
|
||||
/* ======= Developer implemented function ======= */
|
||||
/* ====== Self-defined function ======*/
|
||||
static u16_t read_eeprom(u32_t base, int addr) {
|
||||
static uint16_t read_eeprom(u32_t base, int addr) {
|
||||
u32_t ret, data, val;
|
||||
int i;
|
||||
|
||||
@@ -74,7 +74,7 @@ static u16_t read_eeprom(u32_t base, int addr) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
static u16_t read_phy_reg(u32_t base, int phy_addr, int phy_reg) {
|
||||
static uint16_t read_phy_reg(u32_t base, int phy_addr, int phy_reg) {
|
||||
int i, j, fieldlen[8];
|
||||
u32_t field[8];
|
||||
uint8_t data, polar;
|
||||
@@ -127,7 +127,7 @@ static u16_t read_phy_reg(u32_t base, int phy_addr, int phy_reg) {
|
||||
return field[6];
|
||||
}
|
||||
|
||||
static void write_phy_reg(u32_t base, int phy_addr, int phy_reg, u16_t val) {
|
||||
static void write_phy_reg(u32_t base, int phy_addr, int phy_reg, uint16_t val) {
|
||||
int i, j, fieldlen[8];
|
||||
u32_t field[8];
|
||||
uint8_t data, polar;
|
||||
@@ -213,8 +213,8 @@ static int dev_init_io(u32_t *base) {
|
||||
static int dev_init_mii(u32_t *base) {
|
||||
int i, phyaddr;
|
||||
uint8_t revision;
|
||||
u16_t phyctrl, cr1000, length, address, value;
|
||||
u16_t *param;
|
||||
uint16_t phyctrl, cr1000, length, address, value;
|
||||
uint16_t *param;
|
||||
u32_t status, base0 = base[0];
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
@@ -653,7 +653,7 @@ static void NDR_intr(unsigned int mask) {
|
||||
/* Match the device and get base address */
|
||||
static int dev_probe(NDR_driver *pdev, int instance) {
|
||||
int devind, ioflag, i;
|
||||
u16_t cr, vid, did;
|
||||
uint16_t cr, vid, did;
|
||||
u32_t bar, size, base;
|
||||
uint8_t irq, rev;
|
||||
uint8_t *reg;
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
#define EC_READ 0x0200
|
||||
#define EC_BUSY 0x8000
|
||||
|
||||
static u16_t PhyParam[] = {
|
||||
static uint16_t PhyParam[] = {
|
||||
(0x4000|(07*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 0x0000,
|
||||
30, 0x005e, 9, 0x0700,
|
||||
(0x4100|(07*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 0x0000,
|
||||
@@ -146,7 +146,7 @@ typedef struct NDR_desc {
|
||||
/* Driver Data Structure */
|
||||
typedef struct NDR_driver {
|
||||
char *dev_name; /* Device name */
|
||||
u16_t vid, did; /* Vendor and device ID */
|
||||
uint16_t vid, did; /* Vendor and device ID */
|
||||
u32_t devind; /* Device index */
|
||||
u32_t base[6]; /* Base address */
|
||||
char irq; /* IRQ number */
|
||||
|
||||
@@ -397,8 +397,8 @@ lan8710a_dma_reset_init(void)
|
||||
|
||||
/*
|
||||
* Writing the address of the first buffer descriptor in the queue
|
||||
* (nonzero value)to the channel’s head descriptor pointer in the
|
||||
* channel’s Rx DMA state.
|
||||
* (nonzero value)to the channel's head descriptor pointer in the
|
||||
* channel's Rx DMA state.
|
||||
*/
|
||||
lan8710a_reg_write(CPDMA_STRAM_RX_HDP(0),
|
||||
(u32_t)lan8710a_state.rx_desc_phy);
|
||||
@@ -673,7 +673,7 @@ lan8710a_init_hw(netdriver_addr_t * addr, unsigned int instance)
|
||||
static void
|
||||
lan8710a_init_mdio(void)
|
||||
{
|
||||
u16_t address = 0;
|
||||
uint16_t address = 0;
|
||||
u32_t r;
|
||||
|
||||
/* Clearing MDIOCONTROL register */
|
||||
|
||||
@@ -73,8 +73,8 @@ typedef struct lan8710a_t
|
||||
uint8_t *p_rx_buf; /* pointer to the buffer with receive frames */
|
||||
uint8_t *p_tx_buf; /* pointer to the buffer with transmit frames */
|
||||
|
||||
u16_t tx_desc_idx; /* index of the next transmit desciptor */
|
||||
u16_t rx_desc_idx; /* index of the next receive desciptor */
|
||||
uint16_t tx_desc_idx; /* index of the next transmit desciptor */
|
||||
uint16_t rx_desc_idx; /* index of the next receive desciptor */
|
||||
|
||||
/* register mapping */
|
||||
vir_bytes regs_cp_per;
|
||||
|
||||
@@ -42,10 +42,10 @@ static void lance_init_hw(ether_card_t *ec, netdriver_addr_t *addr,
|
||||
|
||||
/* Accesses Lance Control and Status Registers */
|
||||
static uint8_t in_byte(port_t port);
|
||||
static u16_t in_word(port_t port);
|
||||
static void out_word(port_t port, u16_t value);
|
||||
static u16_t read_csr(port_t ioaddr, u16_t csrno);
|
||||
static void write_csr(port_t ioaddr, u16_t csrno, u16_t value);
|
||||
static uint16_t in_word(port_t port);
|
||||
static void out_word(port_t port, uint16_t value);
|
||||
static uint16_t read_csr(port_t ioaddr, uint16_t csrno);
|
||||
static void write_csr(port_t ioaddr, uint16_t csrno, uint16_t value);
|
||||
|
||||
static ether_card_t ec_state;
|
||||
|
||||
@@ -661,7 +661,7 @@ static int lance_probe(ether_card_t *ec, unsigned int skip)
|
||||
unsigned short ioaddr;
|
||||
int lance_version, chip_version;
|
||||
int devind, r;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
|
||||
pci_init();
|
||||
|
||||
@@ -852,7 +852,7 @@ static uint8_t in_byte(port_t port)
|
||||
/*===========================================================================*
|
||||
* in_word *
|
||||
*===========================================================================*/
|
||||
static u16_t in_word(port_t port)
|
||||
static uint16_t in_word(port_t port)
|
||||
{
|
||||
int r;
|
||||
u32_t value;
|
||||
@@ -867,7 +867,7 @@ static u16_t in_word(port_t port)
|
||||
/*===========================================================================*
|
||||
* out_word *
|
||||
*===========================================================================*/
|
||||
static void out_word(port_t port, u16_t value)
|
||||
static void out_word(port_t port, uint16_t value)
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -879,7 +879,7 @@ static void out_word(port_t port, u16_t value)
|
||||
/*===========================================================================*
|
||||
* read_csr *
|
||||
*===========================================================================*/
|
||||
static u16_t read_csr(port_t ioaddr, u16_t csrno)
|
||||
static uint16_t read_csr(port_t ioaddr, uint16_t csrno)
|
||||
{
|
||||
out_word(ioaddr+LANCE_ADDR, csrno);
|
||||
return in_word(ioaddr+LANCE_DATA);
|
||||
@@ -888,7 +888,7 @@ static u16_t read_csr(port_t ioaddr, u16_t csrno)
|
||||
/*===========================================================================*
|
||||
* write_csr *
|
||||
*===========================================================================*/
|
||||
static void write_csr(port_t ioaddr, u16_t csrno, u16_t value)
|
||||
static void write_csr(port_t ioaddr, uint16_t csrno, uint16_t value)
|
||||
{
|
||||
out_word(ioaddr+LANCE_ADDR, csrno);
|
||||
out_word(ioaddr+LANCE_DATA, value);
|
||||
|
||||
@@ -18,21 +18,21 @@
|
||||
|
||||
static re_t re_state;
|
||||
|
||||
static unsigned my_inb(u16_t port) {
|
||||
static unsigned my_inb(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inb(port, &value)) !=OK)
|
||||
printf("RTL8139: warning, sys_inb failed: %d\n", s);
|
||||
return value;
|
||||
}
|
||||
static unsigned my_inw(u16_t port) {
|
||||
static unsigned my_inw(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inw(port, &value)) !=OK)
|
||||
printf("RTL8139: warning, sys_inw failed: %d\n", s);
|
||||
return value;
|
||||
}
|
||||
static unsigned my_inl(u16_t port) {
|
||||
static unsigned my_inl(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inl(port, &value)) !=OK)
|
||||
@@ -43,17 +43,17 @@ static unsigned my_inl(u16_t port) {
|
||||
#define rl_inw(port, offset) (my_inw((port) + (offset)))
|
||||
#define rl_inl(port, offset) (my_inl((port) + (offset)))
|
||||
|
||||
static void my_outb(u16_t port, uint8_t value) {
|
||||
static void my_outb(uint16_t port, uint8_t value) {
|
||||
int s;
|
||||
if ((s=sys_outb(port, value)) !=OK)
|
||||
printf("RTL8139: warning, sys_outb failed: %d\n", s);
|
||||
}
|
||||
static void my_outw(u16_t port, u16_t value) {
|
||||
static void my_outw(uint16_t port, uint16_t value) {
|
||||
int s;
|
||||
if ((s=sys_outw(port, value)) !=OK)
|
||||
printf("RTL8139: warning, sys_outw failed: %d\n", s);
|
||||
}
|
||||
static void my_outl(u16_t port, u32_t value) {
|
||||
static void my_outl(uint16_t port, u32_t value) {
|
||||
int s;
|
||||
if ((s=sys_outl(port, value)) !=OK)
|
||||
printf("RTL8139: warning, sys_outl failed: %d\n", s);
|
||||
@@ -83,8 +83,8 @@ static void rl_intr(unsigned int mask);
|
||||
static void rl_check_ints(re_t *rep);
|
||||
#if VERBOSE
|
||||
static void rl_report_link(re_t *rep);
|
||||
static void mii_print_techab(u16_t techab);
|
||||
static void mii_print_stat_speed(u16_t stat, u16_t extstat);
|
||||
static void mii_print_techab(uint16_t techab);
|
||||
static void mii_print_stat_speed(uint16_t stat, uint16_t extstat);
|
||||
#endif
|
||||
static void rl_clear_rx(re_t *rep);
|
||||
static void rl_do_reset(re_t *rep);
|
||||
@@ -258,7 +258,7 @@ static int rl_init(unsigned int instance, netdriver_addr_t *addr,
|
||||
static int rl_probe(re_t *rep, unsigned int skip)
|
||||
{
|
||||
int r, devind;
|
||||
u16_t cr, vid, did;
|
||||
uint16_t cr, vid, did;
|
||||
u32_t bar;
|
||||
uint8_t ilr;
|
||||
#if VERBOSE
|
||||
@@ -598,7 +598,7 @@ static ssize_t rl_recv(struct netdriver_data *data, size_t max)
|
||||
int o, s;
|
||||
port_t port;
|
||||
unsigned amount, totlen, packlen;
|
||||
u16_t d_start, d_end;
|
||||
uint16_t d_start, d_end;
|
||||
u32_t l, rxstat;
|
||||
re_t *rep;
|
||||
|
||||
@@ -799,7 +799,7 @@ static unsigned int rl_get_link(uint32_t *media)
|
||||
{
|
||||
port_t port;
|
||||
uint8_t msr;
|
||||
u16_t mii_ctrl;
|
||||
uint16_t mii_ctrl;
|
||||
re_t *rep;
|
||||
|
||||
rep = &re_state;
|
||||
@@ -831,7 +831,7 @@ static unsigned int rl_get_link(uint32_t *media)
|
||||
static void rl_report_link(re_t *rep)
|
||||
{
|
||||
port_t port;
|
||||
u16_t mii_ctrl, mii_status, mii_ana, mii_anlpa, mii_ane, mii_extstat;
|
||||
uint16_t mii_ctrl, mii_status, mii_ana, mii_anlpa, mii_ane, mii_extstat;
|
||||
uint8_t msr;
|
||||
int f, link_up;
|
||||
|
||||
@@ -947,7 +947,7 @@ resspeed:
|
||||
|
||||
}
|
||||
|
||||
static void mii_print_techab(u16_t techab)
|
||||
static void mii_print_techab(uint16_t techab)
|
||||
{
|
||||
int fs, ft;
|
||||
if ((techab & MII_ANA_SEL_M) != MII_ANA_SEL_802_3)
|
||||
@@ -1019,7 +1019,7 @@ static void mii_print_techab(u16_t techab)
|
||||
}
|
||||
}
|
||||
|
||||
static void mii_print_stat_speed(u16_t stat, u16_t extstat)
|
||||
static void mii_print_stat_speed(uint16_t stat, uint16_t extstat)
|
||||
{
|
||||
int fs, ft;
|
||||
fs= 1;
|
||||
@@ -1272,7 +1272,7 @@ static void dump_phy(re_t *rep)
|
||||
static int rl_handler(re_t *rep)
|
||||
{
|
||||
int i, port, tx_head, tx_tail, link_up;
|
||||
u16_t isr, tsad;
|
||||
uint16_t isr, tsad;
|
||||
u32_t tsd, tcr, ertxth;
|
||||
|
||||
port= rep->re_base_port;
|
||||
|
||||
@@ -42,8 +42,8 @@ typedef struct re_dtcc
|
||||
u32_t TxEr_low; /* low 32-bits of Tx errors */
|
||||
u32_t TxEr_high; /* high 32-bits of Tx errors */
|
||||
u32_t RxEr; /* Rx errors */
|
||||
u16_t MissPkt; /* Missed packets */
|
||||
u16_t FAE; /* Frame Alignment Error packets (MII only) */
|
||||
uint16_t MissPkt; /* Missed packets */
|
||||
uint16_t FAE; /* Frame Alignment Error packets (MII only) */
|
||||
u32_t Tx1Col; /* Tx Ok packets with 1 collision before Tx */
|
||||
u32_t TxMCol; /* Tx Ok packets with 2..15 collisions */
|
||||
u32_t RxOkPhy_low; /* low 32-bits of Rx Ok packets for us */
|
||||
@@ -51,8 +51,8 @@ typedef struct re_dtcc
|
||||
u32_t RxOkBrd_low; /* low 32-bits of Rx Ok broadcast packets */
|
||||
u32_t RxOkBrd_high; /* high 32-bits of Rx Ok broadcast packets */
|
||||
u32_t RxOkMul; /* Rx Ok multicast packets */
|
||||
u16_t TxAbt; /* Tx abort packets */
|
||||
u16_t TxUndrn; /* Tx underrun packets */
|
||||
uint16_t TxAbt; /* Tx abort packets */
|
||||
uint16_t TxUndrn; /* Tx underrun packets */
|
||||
} re_dtcc;
|
||||
|
||||
typedef struct re {
|
||||
@@ -98,7 +98,7 @@ typedef struct re {
|
||||
|
||||
static re_t re_state;
|
||||
|
||||
static unsigned my_inb(u16_t port)
|
||||
static unsigned my_inb(uint16_t port)
|
||||
{
|
||||
u32_t value;
|
||||
int s;
|
||||
@@ -106,7 +106,7 @@ static unsigned my_inb(u16_t port)
|
||||
printf("RTL8169: warning, sys_inb failed: %d\n", s);
|
||||
return value;
|
||||
}
|
||||
static unsigned my_inw(u16_t port)
|
||||
static unsigned my_inw(uint16_t port)
|
||||
{
|
||||
u32_t value;
|
||||
int s;
|
||||
@@ -114,7 +114,7 @@ static unsigned my_inw(u16_t port)
|
||||
printf("RTL8169: warning, sys_inw failed: %d\n", s);
|
||||
return value;
|
||||
}
|
||||
static unsigned my_inl(u16_t port)
|
||||
static unsigned my_inl(uint16_t port)
|
||||
{
|
||||
u32_t value;
|
||||
int s;
|
||||
@@ -126,21 +126,21 @@ static unsigned my_inl(u16_t port)
|
||||
#define rl_inw(port, offset) (my_inw((port) + (offset)))
|
||||
#define rl_inl(port, offset) (my_inl((port) + (offset)))
|
||||
|
||||
static void my_outb(u16_t port, uint8_t value)
|
||||
static void my_outb(uint16_t port, uint8_t value)
|
||||
{
|
||||
int s;
|
||||
|
||||
if ((s = sys_outb(port, value)) != OK)
|
||||
printf("RTL8169: warning, sys_outb failed: %d\n", s);
|
||||
}
|
||||
static void my_outw(u16_t port, u16_t value)
|
||||
static void my_outw(uint16_t port, uint16_t value)
|
||||
{
|
||||
int s;
|
||||
|
||||
if ((s = sys_outw(port, value)) != OK)
|
||||
printf("RTL8169: warning, sys_outw failed: %d\n", s);
|
||||
}
|
||||
static void my_outl(u16_t port, u32_t value)
|
||||
static void my_outl(uint16_t port, u32_t value)
|
||||
{
|
||||
int s;
|
||||
|
||||
@@ -243,7 +243,7 @@ static void rl_stop(void)
|
||||
rl_outb(rep->re_base_port, RL_CR, RL_CR_RST);
|
||||
}
|
||||
|
||||
static void mdio_write(u16_t port, int regaddr, int value)
|
||||
static void mdio_write(uint16_t port, int regaddr, int value)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -262,7 +262,7 @@ static void mdio_write(u16_t port, int regaddr, int value)
|
||||
}
|
||||
}
|
||||
|
||||
static int mdio_read(u16_t port, int regaddr)
|
||||
static int mdio_read(uint16_t port, int regaddr)
|
||||
{
|
||||
int i, value = -1;
|
||||
|
||||
@@ -400,7 +400,7 @@ static void rl_set_mode(unsigned int mode,
|
||||
static int rl_probe(re_t *rep, unsigned int skip)
|
||||
{
|
||||
int r, devind;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
u32_t bar;
|
||||
uint8_t ilr;
|
||||
#if VERBOSE
|
||||
@@ -1344,7 +1344,7 @@ static void rl_intr(unsigned int __unused mask)
|
||||
static void rl_handler(re_t *rep)
|
||||
{
|
||||
int i, port, tx_head, tx_tail, link_up;
|
||||
u16_t isr;
|
||||
uint16_t isr;
|
||||
re_desc *desc;
|
||||
|
||||
port = rep->re_base_port;
|
||||
|
||||
@@ -61,7 +61,7 @@ struct virtio_net_config {
|
||||
/* The config defining mac address (if VIRTIO_NET_F_MAC) */
|
||||
uint8_t mac[6];
|
||||
/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
|
||||
u16_t status;
|
||||
uint16_t status;
|
||||
} __attribute__((packed));
|
||||
|
||||
/* This is the first element of the scatter-gather list. If you don't
|
||||
@@ -76,17 +76,17 @@ struct virtio_net_hdr {
|
||||
#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
|
||||
#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
|
||||
uint8_t gso_type;
|
||||
u16_t hdr_len; /* Ethernet + IP + tcp/udp hdrs */
|
||||
u16_t gso_size; /* Bytes to append to hdr_len per frame */
|
||||
u16_t csum_start; /* Position to start checksumming from */
|
||||
u16_t csum_offset; /* Offset after that to place checksum */
|
||||
uint16_t hdr_len; /* Ethernet + IP + tcp/udp hdrs */
|
||||
uint16_t gso_size; /* Bytes to append to hdr_len per frame */
|
||||
uint16_t csum_start; /* Position to start checksumming from */
|
||||
uint16_t csum_offset; /* Offset after that to place checksum */
|
||||
};
|
||||
|
||||
/* This is the version of the header to use when the MRG_RXBUF
|
||||
* feature has been negotiated. */
|
||||
struct virtio_net_hdr_mrg_rxbuf {
|
||||
struct virtio_net_hdr hdr;
|
||||
u16_t num_buffers; /* Number of merged rx buffers */
|
||||
uint16_t num_buffers; /* Number of merged rx buffers */
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -19,16 +19,16 @@ static uint8_t my_inb(u32_t port) {
|
||||
}
|
||||
#define ndr_in8(port, offset) (my_inb((port) + (offset)))
|
||||
|
||||
static u16_t my_inw(u32_t port) {
|
||||
static uint16_t my_inw(u32_t port) {
|
||||
u32_t value;
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
value = *(volatile u16_t *)(port);
|
||||
value = *(volatile uint16_t *)(port);
|
||||
#else
|
||||
if ((r = sys_inw(port, &value)) != OK)
|
||||
printf("NDR: sys_inw failed: %d\n", r);
|
||||
#endif
|
||||
return (u16_t)value;
|
||||
return (uint16_t)value;
|
||||
}
|
||||
#define ndr_in16(port, offset) (my_inw((port) + (offset)))
|
||||
|
||||
@@ -60,9 +60,9 @@ static void my_outb(u32_t port, u32_t value) {
|
||||
static void my_outw(u32_t port, u32_t value) {
|
||||
int r;
|
||||
#ifdef DMA_BASE_IOMAP
|
||||
*(volatile u16_t *)(port) = value;
|
||||
*(volatile uint16_t *)(port) = value;
|
||||
#else
|
||||
if ((r = sys_outw(port, (u16_t)value)) != OK)
|
||||
if ((r = sys_outw(port, (uint16_t)value)) != OK)
|
||||
printf("NDR: sys_outw failed: %d\n", r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ static void NDR_intr(unsigned int mask) {
|
||||
/* Match the device and get base address */
|
||||
static int dev_probe(NDR_driver *pdev, int instance) {
|
||||
int devind, ioflag, i;
|
||||
u16_t cr, vid, did;
|
||||
uint16_t cr, vid, did;
|
||||
u32_t bar, size, base;
|
||||
uint8_t irq, rev;
|
||||
uint8_t *reg;
|
||||
|
||||
@@ -94,7 +94,7 @@ typedef struct NDR_desc {
|
||||
/* Driver Data Structure */
|
||||
typedef struct NDR_driver {
|
||||
char *dev_name; /* Device name */
|
||||
u16_t vid, did; /* Vendor and device ID */
|
||||
uint16_t vid, did; /* Vendor and device ID */
|
||||
u32_t devind; /* Device index */
|
||||
u32_t base[6]; /* Base address */
|
||||
char irq; /* IRQ number */
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
extern struct machine machine;
|
||||
|
||||
|
||||
static u32_t pci_inb(u16_t port) {
|
||||
static u32_t pci_inb(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inb(port, &value)) !=OK)
|
||||
@@ -66,7 +66,7 @@ static u32_t pci_inb(u16_t port) {
|
||||
return value;
|
||||
}
|
||||
|
||||
static u32_t pci_inw(u16_t port) {
|
||||
static u32_t pci_inw(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inw(port, &value)) !=OK)
|
||||
@@ -74,7 +74,7 @@ static u32_t pci_inw(u16_t port) {
|
||||
return value;
|
||||
}
|
||||
|
||||
static u32_t pci_inl(u16_t port) {
|
||||
static u32_t pci_inl(uint16_t port) {
|
||||
u32_t value;
|
||||
int s;
|
||||
if ((s=sys_inl(port, &value)) !=OK)
|
||||
@@ -82,19 +82,19 @@ static u32_t pci_inl(u16_t port) {
|
||||
return value;
|
||||
}
|
||||
|
||||
static void pci_outb(u16_t port, uint8_t value) {
|
||||
static void pci_outb(uint16_t port, uint8_t value) {
|
||||
int s;
|
||||
if ((s=sys_outb(port, value)) !=OK)
|
||||
printf("ACPI: warning, sys_outb failed: %d\n", s);
|
||||
}
|
||||
|
||||
static void pci_outw(u16_t port, u16_t value) {
|
||||
static void pci_outw(uint16_t port, uint16_t value) {
|
||||
int s;
|
||||
if ((s=sys_outw(port, value)) !=OK)
|
||||
printf("ACPI: warning, sys_outw failed: %d\n", s);
|
||||
}
|
||||
|
||||
static void pci_outl(u16_t port, u32_t value) {
|
||||
static void pci_outl(uint16_t port, u32_t value) {
|
||||
int s;
|
||||
if ((s=sys_outl(port, value)) !=OK)
|
||||
printf("ACPI: warning, sys_outl failed: %d\n", s);
|
||||
@@ -962,7 +962,7 @@ AcpiOsReadPciConfiguration (
|
||||
PciId->Function, Register);
|
||||
break;
|
||||
case 16:
|
||||
*(u16_t *)Value = PCII_RREG16_(PciId->Bus, PciId->Device,
|
||||
*(uint16_t *)Value = PCII_RREG16_(PciId->Bus, PciId->Device,
|
||||
PciId->Function, Register);
|
||||
break;
|
||||
case 32:
|
||||
|
||||
@@ -434,7 +434,7 @@ static int atapi_check_medium(struct port_state *ps, int cmd)
|
||||
/*===========================================================================*
|
||||
* atapi_id_check *
|
||||
*===========================================================================*/
|
||||
static int atapi_id_check(struct port_state *ps, u16_t *buf)
|
||||
static int atapi_id_check(struct port_state *ps, uint16_t *buf)
|
||||
{
|
||||
/* Determine whether we support this ATAPI device based on the
|
||||
* identification data it returned, and store some of its properties.
|
||||
@@ -525,7 +525,7 @@ static int atapi_transfer(struct port_state *ps, int cmd, u64_t start_lba,
|
||||
/*===========================================================================*
|
||||
* ata_id_check *
|
||||
*===========================================================================*/
|
||||
static int ata_id_check(struct port_state *ps, u16_t *buf)
|
||||
static int ata_id_check(struct port_state *ps, uint16_t *buf)
|
||||
{
|
||||
/* Determine whether we support this ATA device based on the
|
||||
* identification data it returned, and store some of its properties.
|
||||
@@ -734,7 +734,7 @@ static int gen_get_wcache(struct port_state *ps, int *val)
|
||||
return r;
|
||||
|
||||
/* Return the current setting. */
|
||||
*val = !!(((u16_t *) ps->tmp_base)[ATA_ID_ENA0] & ATA_ID_ENA0_WCACHE);
|
||||
*val = !!(((uint16_t *) ps->tmp_base)[ATA_ID_ENA0] & ATA_ID_ENA0_WCACHE);
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -1332,7 +1332,7 @@ static void port_restart(struct port_state *ps)
|
||||
/*===========================================================================*
|
||||
* print_string *
|
||||
*===========================================================================*/
|
||||
static void print_string(u16_t *buf, int start, int end)
|
||||
static void print_string(uint16_t *buf, int start, int end)
|
||||
{
|
||||
/* Print a string that is stored as little-endian words and padded with
|
||||
* trailing spaces.
|
||||
@@ -1359,7 +1359,7 @@ static void port_id_check(struct port_state *ps, int success)
|
||||
* Decide whether this device is usable or not, and store some of its
|
||||
* properties.
|
||||
*/
|
||||
u16_t *buf;
|
||||
uint16_t *buf;
|
||||
|
||||
assert(ps->state == STATE_WAIT_ID);
|
||||
|
||||
@@ -1386,7 +1386,7 @@ static void port_id_check(struct port_state *ps, int success)
|
||||
* store some properties.
|
||||
*/
|
||||
if (success) {
|
||||
buf = (u16_t *) ps->tmp_base;
|
||||
buf = (uint16_t *) ps->tmp_base;
|
||||
|
||||
if (ps->flags & FLAG_ATAPI)
|
||||
success = atapi_id_check(ps, buf);
|
||||
@@ -2017,7 +2017,7 @@ static int ahci_probe(int skip)
|
||||
/* Find a matching PCI device.
|
||||
*/
|
||||
int r, devind;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
|
||||
pci_init();
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
#define ATA_SECTOR_SIZE 512 /* default sector size */
|
||||
#define ATA_MAX_SECTORS 0x10000 /* max sectors per transfer */
|
||||
|
||||
#define ATA_ID_SIZE (256 * sizeof(u16_t)) /* IDENTIFY result size */
|
||||
#define ATA_ID_SIZE (256 * sizeof(uint16_t)) /* IDENTIFY result size */
|
||||
|
||||
#define ATA_ID_GCAP 0 /* General capabililties */
|
||||
#define ATA_ID_GCAP_ATAPI_MASK 0xC000 /* ATAPI device mask */
|
||||
|
||||
@@ -97,7 +97,7 @@ static phys_bytes dma_buf_phys;
|
||||
struct prdte
|
||||
{
|
||||
phys_bytes prdte_base;
|
||||
u16_t prdte_count;
|
||||
uint16_t prdte_count;
|
||||
uint8_t prdte_reserved;
|
||||
uint8_t prdte_flags;
|
||||
};
|
||||
@@ -108,8 +108,8 @@ static phys_bytes prdt_phys;
|
||||
|
||||
#define PRDTE_FL_EOT 0x80 /* End of table */
|
||||
|
||||
static int w_probe(int skip, u16_t *vidp, u16_t *didp);
|
||||
static void w_init(int devind, u16_t vid, u16_t did);
|
||||
static int w_probe(int skip, uint16_t *vidp, uint16_t *didp);
|
||||
static void w_init(int devind, uint16_t vid, uint16_t did);
|
||||
static int init_params(void);
|
||||
static int w_do_open(devminor_t minor, int access);
|
||||
static struct device *w_prepare(devminor_t dev);
|
||||
@@ -199,7 +199,7 @@ static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
|
||||
{
|
||||
/* Initialize the at_wini driver. */
|
||||
int skip, devind;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
|
||||
system_hz = sys_hz();
|
||||
|
||||
@@ -311,7 +311,7 @@ static void init_drive(int drive, int base_cmd, int base_ctl, int base_dma,
|
||||
/*===========================================================================*
|
||||
* w_probe *
|
||||
*===========================================================================*/
|
||||
static int w_probe(int skip, u16_t *vidp, u16_t *didp)
|
||||
static int w_probe(int skip, uint16_t *vidp, uint16_t *didp)
|
||||
{
|
||||
/* Go through the PCI devices that have been made visible to us, skipping as
|
||||
* many as requested and then reserving the first one after that. We assume
|
||||
@@ -339,7 +339,7 @@ static int w_probe(int skip, u16_t *vidp, u16_t *didp)
|
||||
/*===========================================================================*
|
||||
* w_init *
|
||||
*===========================================================================*/
|
||||
static void w_init(int devind, u16_t vid, u16_t did)
|
||||
static void w_init(int devind, uint16_t vid, uint16_t did)
|
||||
{
|
||||
/* Initialize drives on the controller that we found and reserved. Each
|
||||
* controller has two channels, each of which may have up to two disks
|
||||
@@ -357,7 +357,7 @@ static void w_init(int devind, u16_t vid, u16_t did)
|
||||
*/
|
||||
int r, irq, native_hook, compat_hook, is_ide, nhooks;
|
||||
uint8_t bcr, scr, interface;
|
||||
u16_t cr;
|
||||
uint16_t cr;
|
||||
u32_t base_cmd, base_ctl, base_dma;
|
||||
|
||||
bcr= pci_attr_r8(devind, PCI_BCR);
|
||||
@@ -550,8 +550,8 @@ static struct device *w_part(devminor_t device)
|
||||
}
|
||||
|
||||
#define id_byte(n) (&tmp_buf[2 * (n)])
|
||||
#define id_word(n) (((u16_t) id_byte(n)[0] << 0) \
|
||||
|((u16_t) id_byte(n)[1] << 8))
|
||||
#define id_word(n) (((uint16_t) id_byte(n)[0] << 0) \
|
||||
|((uint16_t) id_byte(n)[1] << 8))
|
||||
#define id_longword(n) (((u32_t) id_byte(n)[0] << 0) \
|
||||
|((u32_t) id_byte(n)[1] << 8) \
|
||||
|((u32_t) id_byte(n)[2] << 16) \
|
||||
@@ -565,7 +565,7 @@ check_dma(struct wini *wn)
|
||||
{
|
||||
u32_t dma_status, dma_base;
|
||||
int id_dma, ultra_dma;
|
||||
u16_t w;
|
||||
uint16_t w;
|
||||
|
||||
wn->dma= 0;
|
||||
|
||||
@@ -652,7 +652,7 @@ static int w_identify(void)
|
||||
struct wini *wn = w_wn;
|
||||
struct command cmd;
|
||||
int s;
|
||||
u16_t w;
|
||||
uint16_t w;
|
||||
unsigned long size;
|
||||
int prev_wakeup;
|
||||
int r;
|
||||
|
||||
@@ -226,7 +226,7 @@ static struct floppy *f_fp; /* current drive */
|
||||
static struct density *f_dp; /* current density parameters */
|
||||
static struct density *prev_dp;/* previous density parameters */
|
||||
static unsigned f_sectors; /* equal to f_dp->secpt (needed a lot) */
|
||||
u16_t f_busy; /* BSY_IDLE, BSY_IO, BSY_WAKEN */
|
||||
uint16_t f_busy; /* BSY_IDLE, BSY_IO, BSY_WAKEN */
|
||||
static struct device *f_dv; /* device's base and size */
|
||||
static struct disk_parameter_s fmt_param; /* parameters for format */
|
||||
static uint8_t f_results[MAX_RESULTS];/* the controller can give lots of output */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "floppy.h"
|
||||
|
||||
/* State management variables. */
|
||||
EXTERN u16_t f_busy;
|
||||
EXTERN uint16_t f_busy;
|
||||
EXTERN int motor_status;
|
||||
EXTERN unsigned f_drive;
|
||||
EXTERN int last_was_write;
|
||||
|
||||
@@ -70,10 +70,10 @@ static phys_bytes hdrs_phys;
|
||||
/* Status bytes for requests.
|
||||
*
|
||||
* Usually a status is only one byte in length, but we need the lowest bit
|
||||
* to propagate writable. For this reason we take u16_t and use a mask for
|
||||
* to propagate writable. For this reason we take uint16_t and use a mask for
|
||||
* the lower byte later.
|
||||
*/
|
||||
static u16_t *status_vir;
|
||||
static uint16_t *status_vir;
|
||||
static phys_bytes status_phys;
|
||||
|
||||
/* Prototypes */
|
||||
|
||||
@@ -53,7 +53,7 @@ struct virtio_blk_config {
|
||||
u32_t seg_max;
|
||||
/* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */
|
||||
struct virtio_blk_geometry {
|
||||
u16_t cylinders;
|
||||
uint16_t cylinders;
|
||||
uint8_t heads;
|
||||
uint8_t sectors;
|
||||
} geometry;
|
||||
@@ -67,7 +67,7 @@ struct virtio_blk_config {
|
||||
/* alignment offset in logical blocks. */
|
||||
uint8_t alignment_offset;
|
||||
/* minimum I/O size without performance penalty in logical blocks. */
|
||||
u16_t min_io_size;
|
||||
uint16_t min_io_size;
|
||||
/* optimal sustained I/O size in logical blocks. */
|
||||
u32_t opt_io_size;
|
||||
|
||||
|
||||
@@ -977,7 +977,7 @@ static int back_over(tp)
|
||||
register tty_t *tp;
|
||||
{
|
||||
/* Backspace to previous character on screen and erase it. */
|
||||
u16_t *head;
|
||||
uint16_t *head;
|
||||
int len;
|
||||
|
||||
if (tp->tty_incount == 0) return(0); /* queue empty */
|
||||
@@ -1009,7 +1009,7 @@ register tty_t *tp; /* pointer to tty struct */
|
||||
* messed up by output, or if REPRINT (^R) is typed.
|
||||
*/
|
||||
int count;
|
||||
u16_t *head;
|
||||
uint16_t *head;
|
||||
|
||||
tp->tty_reprint = FALSE;
|
||||
|
||||
@@ -1156,7 +1156,7 @@ static void setattr(tp)
|
||||
tty_t *tp;
|
||||
{
|
||||
/* Apply the new line attributes (raw/canonical, line speed, etc.) */
|
||||
u16_t *inp;
|
||||
uint16_t *inp;
|
||||
int count;
|
||||
|
||||
if (!(tp->tty_termios.c_lflag & ICANON)) {
|
||||
|
||||
@@ -26,8 +26,8 @@ typedef struct tty {
|
||||
int tty_index; /* index into TTY table */
|
||||
|
||||
/* Input queue. Typed characters are stored here until read by a program. */
|
||||
u16_t *tty_inhead; /* pointer to place where next char goes */
|
||||
u16_t *tty_intail; /* pointer to next char to be given to prog */
|
||||
uint16_t *tty_inhead; /* pointer to place where next char goes */
|
||||
uint16_t *tty_intail; /* pointer to next char to be given to prog */
|
||||
int tty_incount; /* # chars in the input queue */
|
||||
int tty_eotct; /* number of "line breaks" in input queue */
|
||||
devfun_t tty_devread; /* routine to read from low level buffers */
|
||||
@@ -79,7 +79,7 @@ typedef struct tty {
|
||||
struct termios tty_termios; /* terminal attributes */
|
||||
struct winsize tty_winsize; /* window size (#lines and #columns) */
|
||||
|
||||
u16_t tty_inbuf[TTY_IN_BYTES];/* tty input buffer */
|
||||
uint16_t tty_inbuf[TTY_IN_BYTES];/* tty input buffer */
|
||||
|
||||
} tty_t;
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ typedef struct console {
|
||||
char c_esc_intro; /* Distinguishing character following ESC */
|
||||
int *c_esc_parmp; /* pointer to current escape parameter */
|
||||
int c_esc_parmv[MAX_ESC_PARMS]; /* list of escape parameters */
|
||||
u16_t c_ramqueue[CONS_RAM_WORDS]; /* buffer for video RAM */
|
||||
uint16_t c_ramqueue[CONS_RAM_WORDS]; /* buffer for video RAM */
|
||||
int c_line; /* line no */
|
||||
} console_t;
|
||||
|
||||
@@ -912,7 +912,7 @@ tty_t *tp;
|
||||
{
|
||||
/* Initialize the screen driver. */
|
||||
console_t *cons;
|
||||
u16_t bios_columns, bios_crtbase, bios_fontlines;
|
||||
uint16_t bios_columns, bios_crtbase, bios_fontlines;
|
||||
uint8_t bios_rows;
|
||||
int line;
|
||||
int s;
|
||||
@@ -1185,12 +1185,12 @@ static int cons_ioctl(tty_t *tp, int UNUSED(try))
|
||||
*===========================================================================*/
|
||||
static void mem_vid_copy(vir_bytes src, int dst_index, int count)
|
||||
{
|
||||
u16_t *src_mem = (u16_t *) src;
|
||||
uint16_t *src_mem = (uint16_t *) src;
|
||||
while(count > 0) {
|
||||
int i, subcount = count;
|
||||
u16_t *dst_mem;
|
||||
uint16_t *dst_mem;
|
||||
LIMITINDEX(vid_mask, dst_index, vid_size, subcount);
|
||||
dst_mem = (u16_t *) console_memory + dst_index;
|
||||
dst_mem = (uint16_t *) console_memory + dst_index;
|
||||
if(!src)
|
||||
for(i = 0; i < subcount; i++)
|
||||
*dst_mem++ = blank_color;
|
||||
@@ -1212,11 +1212,11 @@ static void vid_vid_copy(int src_index, int dst_index, int count)
|
||||
backwards = 1;
|
||||
while(count > 0) {
|
||||
int i, subcount = count;
|
||||
u16_t *dst_mem, *src_mem;
|
||||
uint16_t *dst_mem, *src_mem;
|
||||
LIMITINDEX(vid_mask, src_index, vid_size, subcount);
|
||||
LIMITINDEX(vid_mask, dst_index, vid_size, subcount);
|
||||
src_mem = (u16_t *) console_memory + src_index;
|
||||
dst_mem = (u16_t *) console_memory + dst_index;
|
||||
src_mem = (uint16_t *) console_memory + src_index;
|
||||
dst_mem = (uint16_t *) console_memory + dst_index;
|
||||
if(backwards) {
|
||||
src_mem += subcount - 1;
|
||||
dst_mem += subcount - 1;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <assert.h>
|
||||
#include "tty.h"
|
||||
|
||||
static u16_t keymap[NR_SCAN_CODES][MAP_COLS] = {
|
||||
static uint16_t keymap[NR_SCAN_CODES][MAP_COLS] = {
|
||||
#include "keymaps/us-std.src"
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ int scode;
|
||||
/* Map a scan code to an ASCII code. */
|
||||
|
||||
int caps, column, lk;
|
||||
u16_t *keyrow;
|
||||
uint16_t *keyrow;
|
||||
|
||||
keyrow = keymap[scode];
|
||||
|
||||
|
||||
@@ -1252,7 +1252,7 @@ static int back_over(tp)
|
||||
register tty_t *tp;
|
||||
{
|
||||
/* Backspace to previous character on screen and erase it. */
|
||||
u16_t *head;
|
||||
uint16_t *head;
|
||||
int len;
|
||||
|
||||
if (tp->tty_incount == 0) return(0); /* queue empty */
|
||||
@@ -1284,7 +1284,7 @@ register tty_t *tp; /* pointer to tty struct */
|
||||
* messed up by output, or if REPRINT (^R) is typed.
|
||||
*/
|
||||
int count;
|
||||
u16_t *head;
|
||||
uint16_t *head;
|
||||
|
||||
tp->tty_reprint = FALSE;
|
||||
|
||||
@@ -1431,7 +1431,7 @@ static void setattr(tp)
|
||||
tty_t *tp;
|
||||
{
|
||||
/* Apply the new line attributes (raw/canonical, line speed, etc.) */
|
||||
u16_t *inp;
|
||||
uint16_t *inp;
|
||||
int count;
|
||||
|
||||
if (!(tp->tty_termios.c_lflag & ICANON)) {
|
||||
|
||||
@@ -28,8 +28,8 @@ typedef struct tty {
|
||||
devminor_t tty_minor; /* device minor number */
|
||||
|
||||
/* Input queue. Typed characters are stored here until read by a program. */
|
||||
u16_t *tty_inhead; /* pointer to place where next char goes */
|
||||
u16_t *tty_intail; /* pointer to next char to be given to prog */
|
||||
uint16_t *tty_inhead; /* pointer to place where next char goes */
|
||||
uint16_t *tty_intail; /* pointer to next char to be given to prog */
|
||||
int tty_incount; /* # chars in the input queue */
|
||||
int tty_eotct; /* number of "line breaks" in input queue */
|
||||
devfun_t tty_devread; /* routine to read from low level buffers */
|
||||
@@ -81,7 +81,7 @@ typedef struct tty {
|
||||
struct termios tty_termios; /* terminal attributes */
|
||||
struct winsize tty_winsize; /* window size (#lines and #columns) */
|
||||
|
||||
u16_t tty_inbuf[TTY_IN_BYTES];/* tty input buffer */
|
||||
uint16_t tty_inbuf[TTY_IN_BYTES];/* tty input buffer */
|
||||
|
||||
} tty_t;
|
||||
|
||||
|
||||
@@ -605,8 +605,8 @@ hub_port_feature(int port_num, class_code code, class_feature feature)
|
||||
/* Standard get endpoint request */
|
||||
setup_buf.bRequestType = 0x23;
|
||||
setup_buf.bRequest = (uint8_t)code;
|
||||
setup_buf.wValue = (u16_t)feature;
|
||||
setup_buf.wIndex = (u16_t)port_num;
|
||||
setup_buf.wValue = (uint16_t)feature;
|
||||
setup_buf.wIndex = (uint16_t)port_num;
|
||||
setup_buf.wLength = 0;
|
||||
|
||||
/* Attach buffers to URB */
|
||||
@@ -661,7 +661,7 @@ hub_get_port_status(int port_num, hub_port_status * p)
|
||||
setup_buf.bRequestType = 0xA3;
|
||||
setup_buf.bRequest = (uint8_t)GET_STATUS;
|
||||
setup_buf.wValue = 0x00;
|
||||
setup_buf.wIndex = (u16_t)port_num;
|
||||
setup_buf.wIndex = (uint16_t)port_num;
|
||||
setup_buf.wLength = sizeof(*p);
|
||||
|
||||
/* Attach buffers to URB */
|
||||
|
||||
@@ -87,7 +87,7 @@ static int vbox_init(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
{
|
||||
/* Initialize the device. */
|
||||
int devind;
|
||||
u16_t vid, did;
|
||||
uint16_t vid, did;
|
||||
struct VMMDevReportGuestInfo *req;
|
||||
int r;
|
||||
|
||||
|
||||
@@ -82,8 +82,8 @@ struct VMMDevHGCMDisconnect {
|
||||
|
||||
struct VMMDevHGCMPageList {
|
||||
u32_t flags;
|
||||
u16_t offset;
|
||||
u16_t count;
|
||||
uint16_t offset;
|
||||
uint16_t count;
|
||||
u64_t addr[1];
|
||||
};
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ void free_inode(
|
||||
register struct super_block *sp;
|
||||
dev_t dev = rip->i_dev;
|
||||
bit_t b = rip->i_num;
|
||||
u16_t mode = rip->i_mode;
|
||||
uint16_t mode = rip->i_mode;
|
||||
|
||||
/* Locate the appropriate super_block. */
|
||||
sp = get_super(dev);
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
* linux/include/linux/ext2_fs.h.
|
||||
*/
|
||||
EXTERN struct inode {
|
||||
u16_t i_mode; /* File mode */
|
||||
u16_t i_uid; /* Low 16 bits of Owner Uid */
|
||||
uint16_t i_mode; /* File mode */
|
||||
uint16_t i_uid; /* Low 16 bits of Owner Uid */
|
||||
u32_t i_size; /* Size in bytes */
|
||||
u32_t i_atime; /* Access time */
|
||||
u32_t i_ctime; /* Creation time */
|
||||
u32_t i_mtime; /* Modification time */
|
||||
u32_t i_dtime; /* Deletion Time */
|
||||
u16_t i_gid; /* Low 16 bits of Group Id */
|
||||
u16_t i_links_count; /* Links count */
|
||||
uint16_t i_gid; /* Low 16 bits of Group Id */
|
||||
uint16_t i_links_count; /* Links count */
|
||||
u32_t i_blocks; /* 512-byte blocks count */
|
||||
u32_t i_flags; /* File flags */
|
||||
union {
|
||||
@@ -48,23 +48,23 @@ EXTERN struct inode {
|
||||
struct {
|
||||
uint8_t l_i_frag; /* Fragment number */
|
||||
uint8_t l_i_fsize; /* Fragment size */
|
||||
u16_t i_pad1;
|
||||
u16_t l_i_uid_high; /* these 2 fields */
|
||||
u16_t l_i_gid_high; /* were reserved2[0] */
|
||||
uint16_t i_pad1;
|
||||
uint16_t l_i_uid_high; /* these 2 fields */
|
||||
uint16_t l_i_gid_high; /* were reserved2[0] */
|
||||
u32_t l_i_reserved2;
|
||||
} linux2;
|
||||
struct {
|
||||
uint8_t h_i_frag; /* Fragment number */
|
||||
uint8_t h_i_fsize; /* Fragment size */
|
||||
u16_t h_i_mode_high;
|
||||
u16_t h_i_uid_high;
|
||||
u16_t h_i_gid_high;
|
||||
uint16_t h_i_mode_high;
|
||||
uint16_t h_i_uid_high;
|
||||
uint16_t h_i_gid_high;
|
||||
u32_t h_i_author;
|
||||
} hurd2;
|
||||
struct {
|
||||
uint8_t m_i_frag; /* Fragment number */
|
||||
uint8_t m_i_fsize; /* Fragment size */
|
||||
u16_t m_pad1;
|
||||
uint16_t m_pad1;
|
||||
u32_t m_i_reserved2[2];
|
||||
} masix2;
|
||||
} osd2; /* OS dependent 2 */
|
||||
|
||||
@@ -204,7 +204,7 @@ int ftype; /* used when ENTER and INCOMPAT_FILETYPE */
|
||||
* correct, there is no way to spann a data block.
|
||||
*/
|
||||
if (prev_dp) {
|
||||
u16_t temp = conv2(le_CPU,
|
||||
uint16_t temp = conv2(le_CPU,
|
||||
prev_dp->d_rec_len);
|
||||
temp += conv2(le_CPU,
|
||||
dp->d_rec_len);
|
||||
|
||||
@@ -24,18 +24,18 @@ EXTERN struct super_block {
|
||||
u32_t s_inodes_per_group; /* # Inodes per group */
|
||||
u32_t s_mtime; /* Mount time */
|
||||
u32_t s_wtime; /* Write time */
|
||||
u16_t s_mnt_count; /* Mount count */
|
||||
u16_t s_max_mnt_count; /* Maximal mount count */
|
||||
u16_t s_magic; /* Magic signature */
|
||||
u16_t s_state; /* File system state */
|
||||
u16_t s_errors; /* Behaviour when detecting errors */
|
||||
u16_t s_minor_rev_level; /* minor revision level */
|
||||
uint16_t s_mnt_count; /* Mount count */
|
||||
uint16_t s_max_mnt_count; /* Maximal mount count */
|
||||
uint16_t s_magic; /* Magic signature */
|
||||
uint16_t s_state; /* File system state */
|
||||
uint16_t s_errors; /* Behaviour when detecting errors */
|
||||
uint16_t s_minor_rev_level; /* minor revision level */
|
||||
u32_t s_lastcheck; /* time of last check */
|
||||
u32_t s_checkinterval; /* max. time between checks */
|
||||
u32_t s_creator_os; /* OS */
|
||||
u32_t s_rev_level; /* Revision level */
|
||||
u16_t s_def_resuid; /* Default uid for reserved blocks */
|
||||
u16_t s_def_resgid; /* Default gid for reserved blocks */
|
||||
uint16_t s_def_resuid; /* Default uid for reserved blocks */
|
||||
uint16_t s_def_resgid; /* Default gid for reserved blocks */
|
||||
/*
|
||||
* These fields are for EXT2_DYNAMIC_REV superblocks only.
|
||||
*
|
||||
@@ -50,8 +50,8 @@ EXTERN struct super_block {
|
||||
* things it doesn't understand...
|
||||
*/
|
||||
u32_t s_first_ino; /* First non-reserved inode */
|
||||
u16_t s_inode_size; /* size of inode structure */
|
||||
u16_t s_block_group_nr; /* block group # of this superblock */
|
||||
uint16_t s_inode_size; /* size of inode structure */
|
||||
uint16_t s_block_group_nr; /* block group # of this superblock */
|
||||
u32_t s_feature_compat; /* compatible feature set */
|
||||
u32_t s_feature_incompat; /* incompatible feature set */
|
||||
u32_t s_feature_ro_compat; /* readonly-compatible feature set */
|
||||
@@ -65,7 +65,7 @@ EXTERN struct super_block {
|
||||
*/
|
||||
uint8_t s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
|
||||
uint8_t s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
|
||||
u16_t s_padding1;
|
||||
uint16_t s_padding1;
|
||||
/*
|
||||
* Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set.
|
||||
*/
|
||||
@@ -76,7 +76,7 @@ EXTERN struct super_block {
|
||||
u32_t s_hash_seed[4]; /* HTREE hash seed */
|
||||
uint8_t s_def_hash_version; /* Default hash version to use */
|
||||
uint8_t s_reserved_char_pad;
|
||||
u16_t s_reserved_word_pad;
|
||||
uint16_t s_reserved_word_pad;
|
||||
u32_t s_default_mount_opts;
|
||||
u32_t s_first_meta_bg; /* First metablock block group */
|
||||
u32_t s_reserved[190]; /* Padding to the end of the block */
|
||||
@@ -93,8 +93,8 @@ EXTERN struct super_block {
|
||||
*/
|
||||
struct group_desc *s_group_desc; /* Group descriptors read into RAM */
|
||||
|
||||
u16_t s_block_size; /* block size in bytes. */
|
||||
u16_t s_sectors_in_block; /* s_block_size / 512 */
|
||||
uint16_t s_block_size; /* block size in bytes. */
|
||||
uint16_t s_sectors_in_block; /* s_block_size / 512 */
|
||||
u32_t s_max_size; /* maximum file size on this device */
|
||||
dev_t s_dev; /* whose super block is this? */
|
||||
int s_rd_only; /* set to 1 if file sys mounted read only */
|
||||
@@ -113,10 +113,10 @@ struct group_desc
|
||||
u32_t block_bitmap; /* Blocks bitmap block */
|
||||
u32_t inode_bitmap; /* Inodes bitmap block */
|
||||
u32_t inode_table; /* Inodes table block */
|
||||
u16_t free_blocks_count; /* Free blocks count */
|
||||
u16_t free_inodes_count; /* Free inodes count */
|
||||
u16_t used_dirs_count; /* Directories count */
|
||||
u16_t pad;
|
||||
uint16_t free_blocks_count; /* Free blocks count */
|
||||
uint16_t free_inodes_count; /* Free inodes count */
|
||||
uint16_t used_dirs_count; /* Directories count */
|
||||
uint16_t pad;
|
||||
u32_t reserved[3];
|
||||
};
|
||||
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
* Inode structure was taken from linux/include/linux/ext2_fs.h.
|
||||
*/
|
||||
typedef struct {
|
||||
u16_t i_mode; /* File mode */
|
||||
u16_t i_uid; /* Low 16 bits of Owner Uid */
|
||||
uint16_t i_mode; /* File mode */
|
||||
uint16_t i_uid; /* Low 16 bits of Owner Uid */
|
||||
u32_t i_size; /* Size in bytes */
|
||||
u32_t i_atime; /* Access time */
|
||||
u32_t i_ctime; /* Creation time */
|
||||
u32_t i_mtime; /* Modification time */
|
||||
u32_t i_dtime; /* Deletion Time */
|
||||
u16_t i_gid; /* Low 16 bits of Group Id */
|
||||
u16_t i_links_count; /* Links count */
|
||||
uint16_t i_gid; /* Low 16 bits of Group Id */
|
||||
uint16_t i_links_count; /* Links count */
|
||||
u32_t i_blocks; /* Blocks count */
|
||||
u32_t i_flags; /* File flags */
|
||||
union {
|
||||
@@ -38,23 +38,23 @@ typedef struct {
|
||||
struct {
|
||||
uint8_t l_i_frag; /* Fragment number */
|
||||
uint8_t l_i_fsize; /* Fragment size */
|
||||
u16_t i_pad1;
|
||||
u16_t l_i_uid_high; /* these 2 fields */
|
||||
u16_t l_i_gid_high; /* were reserved2[0] */
|
||||
uint16_t i_pad1;
|
||||
uint16_t l_i_uid_high; /* these 2 fields */
|
||||
uint16_t l_i_gid_high; /* were reserved2[0] */
|
||||
u32_t l_i_reserved2;
|
||||
} linux2;
|
||||
struct {
|
||||
uint8_t h_i_frag; /* Fragment number */
|
||||
uint8_t h_i_fsize; /* Fragment size */
|
||||
u16_t h_i_mode_high;
|
||||
u16_t h_i_uid_high;
|
||||
u16_t h_i_gid_high;
|
||||
uint16_t h_i_mode_high;
|
||||
uint16_t h_i_uid_high;
|
||||
uint16_t h_i_gid_high;
|
||||
u32_t h_i_author;
|
||||
} hurd2;
|
||||
struct {
|
||||
uint8_t m_i_frag; /* Fragment number */
|
||||
uint8_t m_i_fsize; /* Fragment size */
|
||||
u16_t m_pad1;
|
||||
uint16_t m_pad1;
|
||||
u32_t m_i_reserved2[2];
|
||||
} masix2;
|
||||
} osd2; /* OS dependent 2 */
|
||||
@@ -63,13 +63,13 @@ typedef struct {
|
||||
|
||||
/* Part of on disk directory (entry description).
|
||||
* It includes all fields except name (since size is unknown.
|
||||
* In revision 0 name_len is u16_t (here is structure of rev >= 0.5,
|
||||
* In revision 0 name_len is uint16_t (here is structure of rev >= 0.5,
|
||||
* where name_len was truncated with the upper 8 bit to add file_type).
|
||||
* MIN_DIR_ENTRY_SIZE depends on this structure.
|
||||
*/
|
||||
struct ext2_disk_dir_desc {
|
||||
u32_t d_ino;
|
||||
u16_t d_rec_len;
|
||||
uint16_t d_rec_len;
|
||||
uint8_t d_name_len;
|
||||
uint8_t d_file_type;
|
||||
char d_name[1];
|
||||
|
||||
@@ -26,12 +26,12 @@ struct iso9660_vol_pri_desc {
|
||||
u32_t volume_space_size_l;
|
||||
u32_t volume_space_size_m;
|
||||
uint8_t pad3[32];
|
||||
u16_t volume_set_size_l;
|
||||
u16_t volume_set_size_m;
|
||||
u16_t volume_sequence_number_l;
|
||||
u16_t volume_sequence_number_m;
|
||||
u16_t logical_block_size_l;
|
||||
u16_t logical_block_size_m;
|
||||
uint16_t volume_set_size_l;
|
||||
uint16_t volume_set_size_m;
|
||||
uint16_t volume_sequence_number_l;
|
||||
uint16_t volume_sequence_number_m;
|
||||
uint16_t logical_block_size_l;
|
||||
uint16_t logical_block_size_m;
|
||||
u32_t path_table_size_l;
|
||||
u32_t path_table_size_m;
|
||||
u32_t loc_l_occ_path_table;
|
||||
|
||||
@@ -435,10 +435,10 @@ int norm; /* TRUE = do not swap bytes; FALSE = swap */
|
||||
rip->i_zone[i] = (zone_t) conv4(norm, (long) dip->d2_zone[i]);
|
||||
} else {
|
||||
/* Copying V2.x inode to disk from the in-core table. */
|
||||
dip->d2_mode = (u16_t) conv2(norm,rip->i_mode);
|
||||
dip->d2_mode = (uint16_t) conv2(norm,rip->i_mode);
|
||||
dip->d2_uid = (i16_t) conv2(norm,rip->i_uid);
|
||||
dip->d2_nlinks = (u16_t) conv2(norm,rip->i_nlinks);
|
||||
dip->d2_gid = (u16_t) conv2(norm,rip->i_gid);
|
||||
dip->d2_nlinks = (uint16_t) conv2(norm,rip->i_nlinks);
|
||||
dip->d2_gid = (uint16_t) conv2(norm,rip->i_gid);
|
||||
dip->d2_size = (i32_t) conv4(norm,rip->i_size);
|
||||
dip->d2_atime = (i32_t) conv4(norm,rip->i_atime);
|
||||
dip->d2_ctime = (i32_t) conv4(norm,rip->i_ctime);
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
#include "super.h"
|
||||
|
||||
EXTERN struct inode {
|
||||
u16_t i_mode; /* file type, protection, etc. */
|
||||
u16_t i_nlinks; /* how many links to this file */
|
||||
u16_t i_uid; /* user id of the file's owner */
|
||||
u16_t i_gid; /* group number */
|
||||
uint16_t i_mode; /* file type, protection, etc. */
|
||||
uint16_t i_nlinks; /* how many links to this file */
|
||||
uint16_t i_uid; /* user id of the file's owner */
|
||||
uint16_t i_gid; /* group number */
|
||||
i32_t i_size; /* current file size in bytes */
|
||||
u32_t i_atime; /* time of last access (V2 only) */
|
||||
u32_t i_mtime; /* when was file data last changed */
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
|
||||
/* Declaration of the V2 inode as it is on the disk (not in core). */
|
||||
typedef struct { /* V2.x disk inode */
|
||||
u16_t d2_mode; /* file type, protection, etc. */
|
||||
u16_t d2_nlinks; /* how many links to this file. HACK! */
|
||||
uint16_t d2_mode; /* file type, protection, etc. */
|
||||
uint16_t d2_nlinks; /* how many links to this file. HACK! */
|
||||
i16_t d2_uid; /* user id of the file's owner. */
|
||||
u16_t d2_gid; /* group number HACK! */
|
||||
uint16_t d2_gid; /* group number HACK! */
|
||||
i32_t d2_size; /* current file size in bytes */
|
||||
i32_t d2_atime; /* when was file data last accessed */
|
||||
i32_t d2_mtime; /* when was file data last changed */
|
||||
|
||||
@@ -117,7 +117,7 @@ root_meminfo(void)
|
||||
static void
|
||||
root_pci(void)
|
||||
{
|
||||
u16_t vid, did, subvid, subdid;
|
||||
uint16_t vid, did, subvid, subdid;
|
||||
uint8_t bcr, scr, pifr, rev;
|
||||
char *slot_name, *dev_name;
|
||||
int r, devind;
|
||||
|
||||
@@ -314,10 +314,10 @@ struct multiboot_info
|
||||
/* Video */
|
||||
u32_t vbe_control_info;
|
||||
u32_t vbe_mode_info;
|
||||
u16_t vbe_mode;
|
||||
u16_t vbe_interface_seg;
|
||||
u16_t vbe_interface_off;
|
||||
u16_t vbe_interface_len;
|
||||
uint16_t vbe_mode;
|
||||
uint16_t vbe_interface_seg;
|
||||
uint16_t vbe_interface_off;
|
||||
uint16_t vbe_interface_len;
|
||||
};
|
||||
typedef struct multiboot_info multiboot_info_t;
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
struct segdesc_s { /* segment descriptor for protected mode */
|
||||
u16_t limit_low;
|
||||
u16_t base_low;
|
||||
uint16_t limit_low;
|
||||
uint16_t base_low;
|
||||
uint8_t base_middle;
|
||||
uint8_t access; /* |P|DL|1|X|E|R|A| */
|
||||
uint8_t granularity; /* |G|X|0|A|LIMT| */
|
||||
@@ -17,15 +17,15 @@ struct segdesc_s { /* segment descriptor for protected mode */
|
||||
} __attribute__((packed));
|
||||
|
||||
struct gatedesc_s {
|
||||
u16_t offset_low;
|
||||
u16_t selector;
|
||||
uint16_t offset_low;
|
||||
uint16_t selector;
|
||||
uint8_t pad; /* |000|XXXXX| ig & trpg, |XXXXXXXX| task g */
|
||||
uint8_t p_dpl_type; /* |P|DL|0|TYPE| */
|
||||
u16_t offset_high;
|
||||
uint16_t offset_high;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct desctableptr_s {
|
||||
u16_t limit;
|
||||
uint16_t limit;
|
||||
u32_t base;
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
@@ -4,37 +4,37 @@
|
||||
/* x87 FPU state, MMX Technolodgy.
|
||||
* 108 bytes.*/
|
||||
struct fpu_regs_s {
|
||||
u16_t fp_control; /* control */
|
||||
u16_t fp_unused_1;
|
||||
u16_t fp_status; /* status */
|
||||
u16_t fp_unused_2;
|
||||
u16_t fp_tag; /* register tags */
|
||||
u16_t fp_unused_3;
|
||||
uint16_t fp_control; /* control */
|
||||
uint16_t fp_unused_1;
|
||||
uint16_t fp_status; /* status */
|
||||
uint16_t fp_unused_2;
|
||||
uint16_t fp_tag; /* register tags */
|
||||
uint16_t fp_unused_3;
|
||||
u32_t fp_eip; /* eip at failed instruction */
|
||||
u16_t fp_cs; /* cs at failed instruction */
|
||||
u16_t fp_opcode; /* opcode of failed instruction */
|
||||
uint16_t fp_cs; /* cs at failed instruction */
|
||||
uint16_t fp_opcode; /* opcode of failed instruction */
|
||||
u32_t fp_dp; /* data address */
|
||||
u16_t fp_ds; /* data segment */
|
||||
u16_t fp_unused_4;
|
||||
u16_t fp_st_regs[8][5]; /* 8 80-bit FP registers */
|
||||
uint16_t fp_ds; /* data segment */
|
||||
uint16_t fp_unused_4;
|
||||
uint16_t fp_st_regs[8][5]; /* 8 80-bit FP registers */
|
||||
};
|
||||
|
||||
/* x87 FPU, MMX Technolodgy and SSE state.
|
||||
* 512 bytes (if you need size use FPU_XFP_SIZE). */
|
||||
struct xfp_save {
|
||||
u16_t fp_control; /* control */
|
||||
u16_t fp_status; /* status */
|
||||
u16_t fp_tag; /* register tags */
|
||||
u16_t fp_opcode; /* opcode of failed instruction */
|
||||
uint16_t fp_control; /* control */
|
||||
uint16_t fp_status; /* status */
|
||||
uint16_t fp_tag; /* register tags */
|
||||
uint16_t fp_opcode; /* opcode of failed instruction */
|
||||
u32_t fp_eip; /* eip at failed instruction */
|
||||
u16_t fp_cs; /* cs at failed instruction */
|
||||
u16_t fp_unused_1;
|
||||
uint16_t fp_cs; /* cs at failed instruction */
|
||||
uint16_t fp_unused_1;
|
||||
u32_t fp_dp; /* data address */
|
||||
u16_t fp_ds; /* data segment */
|
||||
u16_t fp_unused_2;
|
||||
uint16_t fp_ds; /* data segment */
|
||||
uint16_t fp_unused_2;
|
||||
u32_t fp_mxcsr; /* MXCSR */
|
||||
u32_t fp_mxcsr_mask; /* MXCSR_MASK */
|
||||
u16_t fp_st_regs[8][8]; /* 128 bytes for ST/MM regs */
|
||||
uint16_t fp_st_regs[8][8]; /* 128 bytes for ST/MM regs */
|
||||
u32_t fp_xreg_word[32]; /* space for 8 128-bit XMM registers */
|
||||
u32_t fp_padding[56];
|
||||
};
|
||||
|
||||
@@ -15,10 +15,10 @@ typedef reg_t segdesc_t;
|
||||
* used for the larger registers to avoid differences in the code.
|
||||
*/
|
||||
struct stackframe_s {
|
||||
u16_t gs; /* last item pushed by save */
|
||||
u16_t fs; /* ^ */
|
||||
u16_t es; /* | */
|
||||
u16_t ds; /* | */
|
||||
uint16_t gs; /* last item pushed by save */
|
||||
uint16_t fs; /* ^ */
|
||||
uint16_t es; /* | */
|
||||
uint16_t ds; /* | */
|
||||
reg_t di; /* di through cx are not accessed in C */
|
||||
reg_t si; /* order is to match pusha/popa */
|
||||
reg_t fp; /* bp */
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
#define _DEVIO_H
|
||||
|
||||
#include <minix/sys_config.h> /* needed to include <minix/type.h> */
|
||||
#include <sys/types.h> /* uint8_t, u16_t, u32_t needed */
|
||||
#include <sys/types.h> /* uint8_t, uint16_t, u32_t needed */
|
||||
|
||||
typedef u16_t port_t;
|
||||
typedef uint16_t port_t;
|
||||
|
||||
/* We have different granularities of port I/O: 8, 16, 32 bits.
|
||||
* Also see <ibm/portio.h>, which has functions for bytes, words,
|
||||
* and longs. Hence, we need different (port,value)-pair types.
|
||||
*/
|
||||
typedef struct { u16_t port; uint8_t value; } pvb_pair_t;
|
||||
typedef struct { u16_t port; u16_t value; } pvw_pair_t;
|
||||
typedef struct { u16_t port; u32_t value; } pvl_pair_t;
|
||||
typedef struct { uint16_t port; uint8_t value; } pvb_pair_t;
|
||||
typedef struct { uint16_t port; uint16_t value; } pvw_pair_t;
|
||||
typedef struct { uint16_t port; u32_t value; } pvl_pair_t;
|
||||
|
||||
/* Macro shorthand to set (port,value)-pair. */
|
||||
#define pv_set(pv, p, v) do { \
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user