/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2004
* Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice unmodified, this list of conditions, and the following
* disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Intel Wireless PRO/2100 mini-PCI adapter driver
* ipw2100_hw.c is used to handle hardware operation and firmware operations.
*/
#include <sys/byteorder.h>
#include "ipw2100.h"
#include "ipw2100_impl.h"
/*
* Hardware related operations
*/
{
}
{
}
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
{
}
{
}
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
}
void
{
}
}
void
{
}
{
}
{
}
void
{
}
int
{
"ipw2100_table2_getbuf(): invalid table offset = 0x%08x\n",
off));
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
{
int n;
/*
* According to i2c bus protocol to set them.
*/
/* clock */
ipw2100_rom_control(sc, 0);
/* start bit */
/* read opcode */
/*
* address, totally 8 bits, defined by hardware, push from MSB to LSB
*/
for (n = 7; n >= 0; n--) {
| IPW2100_EEPROM_C);
}
/*
* data, totally 16 bits, defined by hardware, push from MSB to LSB
*/
val = 0;
for (n = 15; n >= 0; n--) {
>> IPW2100_EEPROM_SHIFT_Q) << n;
}
ipw2100_rom_control(sc, 0);
/* clear chip select and clock */
ipw2100_rom_control(sc, 0);
}
/*
* Firmware related operations
*/
/*
* The firware was issued by Intel as binary which need to be loaded
* to hardware when card is initiated, or when fatal error happened,
* or when the chip need be reset.
*/
#include "fw-ipw2100/ipw2100-1.3.fw.hex"
};
int
{
"ipw2100_cache_firmwares(): enter\n"));
"ipw2100_cache_firmware(): image not compatible, %u\n",
h->version));
return (DDI_FAILURE);
}
"ipw2100_cache_firmware(): exit\n"));
return (DDI_SUCCESS);
}
/*
* If user-land firmware loading is supported, this routine
* free kmemory if sc->sc_fw.bin_base & sc->sc_fw.bin_size are
* not empty.
*/
int
{
return (DDI_SUCCESS);
}
/*
* the following routines load code onto ipw2100 hardware
*/
int
{
int ntries;
/* try many times */
break;
}
if (ntries == 5000)
return (DDI_FAILURE);
return (DDI_SUCCESS);
}
int
{
uint8_t *p, *e;
"ipw2100_load_fw(): enter\n"));
while (p < e) {
/*
* each block is organized as <DST,LEN,DATA>
*/
"ipw2100_load_fw(): invalid firmware image\n"));
return (DDI_FAILURE);
}
if ((p + len) > e) {
"ipw2100_load_fw(): invalid firmware image\n"));
return (DDI_FAILURE);
}
p += len;
}
/*
* enable all interrupts
*/
/*
* wait for interrupt to notify fw initialization is done
*/
/*
* wait longer for the fw initialized
*/
TR_CLOCK_TICK) < 0)
break;
}
"ipw2100_load_fw(): exit, init failed\n"));
return (DDI_FAILURE);
}
"ipw2100_load_fw(): exit\n"));
return (DDI_SUCCESS);
}