Fixed warnings and license stuff

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10274 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2004-11-27 18:17:15 +00:00
parent ef948c3cc7
commit 25d65010fc
7 changed files with 36 additions and 24 deletions
@@ -1,3 +1,7 @@
/* Copyright (c) 2003-2004
* Stefano Ceccherini <[email protected]>. All rights reserved.
* This file is released under the MIT license
*/
#include <KernelExport.h>
#include <Errors.h>
#include <stdlib.h>
@@ -65,7 +69,7 @@ wb840_open(const char *name, uint32 flags, void** cookie)
data->wb_cachesize = gPci->read_pci_config(data->pciInfo->bus, data->pciInfo->device,
data->pciInfo->function, PCI_line_size, sizeof (PCI_line_size)) & 0xff;
wb_read_eeprom(data, &data->MAC_Address, 0, 3, 0);
wb_read_eeprom(data, &data->MAC_Address, 0, 3, false);
status = wb_create_semaphores(data);
if (status < B_OK) {
@@ -1,3 +1,8 @@
/* Copyright (c) 2003-2004
* Stefano Ceccherini <[email protected]>. All rights reserved.
* This file is released under the MIT license
*/
#ifndef __WB_DRIVER_H
#define __WB_DRIVER_H
@@ -1,3 +1,7 @@
/* Copyright (c) 2003-2004
* Stefano Ceccherini <[email protected]>. All rights reserved.
* This file is released under the MIT license
*/
#ifndef __DRIVER_H
#define __DRIVER_H
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2003-2004 Stefano Ceccherini ([email protected])
* Copyright (c) 1997, 1998
* Bill Paul <[email protected]>. All rights reserved.
*
@@ -31,9 +32,6 @@
*
*/
/* Adapted for BeOS by Stefano Ceccherini <[email protected]> */
#include "wb840.h"
#include "device.h"
#include "interface.h"
@@ -51,6 +49,7 @@
#define MII_DELAY(x) read32(x->reg_base + WB_SIO)
static void
mii_sync(struct wb_device *device)
{
@@ -90,7 +89,7 @@ mii_send(wb_device *device, uint32 bits, int count)
/*
* Read an PHY register through the MII.
*/
int
static int
wb_mii_readreg(wb_device *device, wb_mii_frame *frame)
{
int i, ack;
@@ -180,7 +179,7 @@ fail:
/*
* Write to a PHY register through the MII.
*/
int
static int
wb_mii_writereg(wb_device *device, wb_mii_frame *frame)
{
/*
@@ -252,16 +251,10 @@ wb_miibus_writereg(wb_device *device, int phy, int reg, int data)
}
void
wb_miibus_statchg(wb_device *device)
{
//wb_setcfg(device, device->sc_mii.mii_media_active);
}
#define EEPROM_DELAY(x) read32(x->reg_base + WB_SIO)
void
#if 0
static void
wb_eeprom_putbyte(wb_device *device, int addr)
{
int d, i;
@@ -295,6 +288,7 @@ wb_eeprom_putbyte(wb_device *device, int addr)
return;
}
#endif
static void
@@ -353,14 +347,14 @@ wb_eeprom_getword(wb_device *device, int addr, uint16 *dest)
void
wb_read_eeprom(wb_device *device, void* dest,
int offset, int count, int swap)
int offset, int count, bool swap)
{
int i;
uint16 word = 0, *ptr;
for (i = 0; i < count; i++) {
wb_eeprom_getword(device, offset + i, &word);
ptr = (uint16*)(dest + (i * 2));
ptr = (uint16 *)((uint8 *)dest + (i * 2));
if (swap)
*ptr = ntohs(word);
else
@@ -1,9 +1,14 @@
/* Copyright (c) 2003-2004
* Stefano Ceccherini <[email protected]>. All rights reserved.
* This file is released under the MIT license
*/
#ifndef __WB_INTERFACE_H
#define __WB_INTERFACE_H
#include "wb840.h"
extern void wb_read_eeprom(struct wb_device *, void* dest, int offset, int count, int swap);
extern int wb_miibus_readreg(struct wb_device *, int phy_id, int location);
extern void wb_miibus_writereg(struct wb_device *, int phy, int location, int data);
extern void wb_read_eeprom(wb_device *, void* dest, int offset, int count, bool swap);
extern int wb_miibus_readreg(wb_device *, int phy_id, int location);
extern void wb_miibus_writereg(wb_device *, int phy, int location, int data);
#endif
@@ -1,7 +1,7 @@
/* Copyright (c) 2003-2004
* Stefano Ceccherini <[email protected]>. All rights reserved.
* This file is released under the MIT license
*/
#include "device.h"
#include "driver.h"
#include "debug.h"
@@ -42,10 +42,10 @@ gMIIChips[] = {
static int
mii_readstatus(wb_device *device)
{
// status bit has to be retrieved 2 times
int i = 0;
int status;
// status bit has to be retrieved 2 times
while (i++ < 2)
status = wb_miibus_readreg(device, device->phy, MII_STATUS);
@@ -89,7 +89,7 @@ wb_disable_interrupts(struct wb_device *device)
}
void
static void
wb_selectPHY(wb_device *device)
{
uint16 status;
@@ -245,7 +245,7 @@ wb_stop(wb_device *device)
}
void
static void
wb_updateLink(struct wb_device *device)
{
if (!device->autoNegotiationComplete) {
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2003-2004 Stefano Ceccherini ([email protected])
* Copyright (c) 1997, 1998
* Bill Paul <[email protected]>. All rights reserved.
*
@@ -29,7 +30,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* This file has been adapted for BeOS by Stefano Ceccherini
*/
#ifndef __WB840_H