Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
sprom.c File Reference
#include "bcma_private.h"
#include <linux/bcma/bcma.h>
#include <linux/bcma/bcma_regs.h>
#include <linux/pci.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>

Go to the source code of this file.

Macros

#define SPOFF(offset)   ((offset) / sizeof(u16))
 
#define SPEX(_field, _offset, _mask, _shift)   bus->sprom._field = ((sprom[SPOFF(_offset)] & (_mask)) >> (_shift))
 
#define SPEX32(_field, _offset, _mask, _shift)
 
#define SPEX_ARRAY8(_field, _offset, _mask, _shift)
 

Functions

int bcma_arch_register_fallback_sprom (int(*sprom_callback)(struct bcma_bus *bus, struct ssb_sprom *out))
 
int bcma_sprom_get (struct bcma_bus *bus)
 

Macro Definition Documentation

#define SPEX (   _field,
  _offset,
  _mask,
  _shift 
)    bus->sprom._field = ((sprom[SPOFF(_offset)] & (_mask)) >> (_shift))

Definition at line 181 of file sprom.c.

#define SPEX32 (   _field,
  _offset,
  _mask,
  _shift 
)
Value:
bus->sprom._field = ((((u32)sprom[SPOFF((_offset)+2)] << 16 | \
sprom[SPOFF(_offset)]) & (_mask)) >> (_shift))

Definition at line 184 of file sprom.c.

#define SPEX_ARRAY8 (   _field,
  _offset,
  _mask,
  _shift 
)
Value:
do { \
SPEX(_field[0], _offset + 0, _mask, _shift); \
SPEX(_field[1], _offset + 2, _mask, _shift); \
SPEX(_field[2], _offset + 4, _mask, _shift); \
SPEX(_field[3], _offset + 6, _mask, _shift); \
SPEX(_field[4], _offset + 8, _mask, _shift); \
SPEX(_field[5], _offset + 10, _mask, _shift); \
SPEX(_field[6], _offset + 12, _mask, _shift); \
SPEX(_field[7], _offset + 14, _mask, _shift); \
} while (0)

Definition at line 188 of file sprom.c.

#define SPOFF (   offset)    ((offset) / sizeof(u16))

Definition at line 179 of file sprom.c.

Function Documentation

int bcma_arch_register_fallback_sprom ( int(*)(struct bcma_bus *bus, struct ssb_sprom *out sprom_callback)

bcma_arch_register_fallback_sprom - Registers a method providing a fallback SPROM if no SPROM is found.

: The callback function.

With this function the architecture implementation may register a callback handler which fills the SPROM data structure. The fallback is used for PCI based BCMA devices, where no valid SPROM can be found in the shadow registers and to provide the SPROM for SoCs where BCMA is to controll the system bus.

This function is useful for weird architectures that have a half-assed BCMA device hardwired to their PCI bus.

This function is available for architecture code, only. So it is not exported.

Definition at line 39 of file sprom.c.

int bcma_sprom_get ( struct bcma_bus bus)

Definition at line 548 of file sprom.c.