mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
ieee1394: replace CSR_SET_BUS_INFO_GENERATION macro
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This commit is contained in:
parent
c816015860
commit
a5e6f64dda
2 changed files with 8 additions and 8 deletions
|
@ -50,11 +50,11 @@
|
||||||
#define CSR_MAX_ROM_SHIFT 8
|
#define CSR_MAX_ROM_SHIFT 8
|
||||||
#define CSR_GENERATION_SHIFT 4
|
#define CSR_GENERATION_SHIFT 4
|
||||||
|
|
||||||
#define CSR_SET_BUS_INFO_GENERATION(csr, gen) \
|
static inline void csr_set_bus_info_generation(struct csr1212_csr *csr, u8 gen)
|
||||||
((csr)->bus_info_data[2] = \
|
{
|
||||||
cpu_to_be32((be32_to_cpu((csr)->bus_info_data[2]) & \
|
csr->bus_info_data[2] &= ~cpu_to_be32(0xf << CSR_GENERATION_SHIFT);
|
||||||
~(0xf << CSR_GENERATION_SHIFT)) | \
|
csr->bus_info_data[2] |= cpu_to_be32((u32)gen << CSR_GENERATION_SHIFT);
|
||||||
(gen) << CSR_GENERATION_SHIFT))
|
}
|
||||||
|
|
||||||
struct csr_control {
|
struct csr_control {
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
|
|
|
@ -34,18 +34,18 @@ static void delayed_reset_bus(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct hpsb_host *host =
|
struct hpsb_host *host =
|
||||||
container_of(work, struct hpsb_host, delayed_reset.work);
|
container_of(work, struct hpsb_host, delayed_reset.work);
|
||||||
int generation = host->csr.generation + 1;
|
u8 generation = host->csr.generation + 1;
|
||||||
|
|
||||||
/* The generation field rolls over to 2 rather than 0 per IEEE
|
/* The generation field rolls over to 2 rather than 0 per IEEE
|
||||||
* 1394a-2000. */
|
* 1394a-2000. */
|
||||||
if (generation > 0xf || generation < 2)
|
if (generation > 0xf || generation < 2)
|
||||||
generation = 2;
|
generation = 2;
|
||||||
|
|
||||||
CSR_SET_BUS_INFO_GENERATION(host->csr.rom, generation);
|
csr_set_bus_info_generation(host->csr.rom, generation);
|
||||||
if (csr1212_generate_csr_image(host->csr.rom) != CSR1212_SUCCESS) {
|
if (csr1212_generate_csr_image(host->csr.rom) != CSR1212_SUCCESS) {
|
||||||
/* CSR image creation failed.
|
/* CSR image creation failed.
|
||||||
* Reset generation field and do not issue a bus reset. */
|
* Reset generation field and do not issue a bus reset. */
|
||||||
CSR_SET_BUS_INFO_GENERATION(host->csr.rom,
|
csr_set_bus_info_generation(host->csr.rom,
|
||||||
host->csr.generation);
|
host->csr.generation);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue