Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185096
b: refs/heads/master
c: 168cf9a
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Feb 20, 2010
1 parent b03156b commit 6964ef0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a9bde9b8ab55a2bb51b57cad215a97bcf80bae2
refs/heads/master: 168cf9af699e87d5a6f44b684583714ecabb8e71
2 changes: 1 addition & 1 deletion trunk/drivers/firewire/core-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ static int ioctl_get_cycle_timer(struct client *client, void *buffer)

local_irq_disable();

cycle_time = card->driver->get_bus_time(card);
cycle_time = card->driver->get_cycle_time(card);
do_gettimeofday(&tv);

local_irq_enable();
Expand Down
17 changes: 6 additions & 11 deletions trunk/drivers/firewire/core-transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,23 +921,15 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
void *payload, size_t length, void *callback_data)
{
int reg = offset & ~CSR_REGISTER_BASE;
unsigned long long bus_time;
__be32 *data = payload;
int rcode = RCODE_COMPLETE;

switch (reg) {
case CSR_CYCLE_TIME:
case CSR_BUS_TIME:
if (!TCODE_IS_READ_REQUEST(tcode) || length != 4) {
rcode = RCODE_TYPE_ERROR;
break;
}

bus_time = card->driver->get_bus_time(card);
if (reg == CSR_CYCLE_TIME)
*data = cpu_to_be32(bus_time);
if (TCODE_IS_READ_REQUEST(tcode) && length == 4)
*data = cpu_to_be32(card->driver->get_cycle_time(card));
else
*data = cpu_to_be32(bus_time >> 25);
rcode = RCODE_TYPE_ERROR;
break;

case CSR_BROADCAST_CHANNEL:
Expand Down Expand Up @@ -968,6 +960,9 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
case CSR_BUSY_TIMEOUT:
/* FIXME: Implement this. */

case CSR_BUS_TIME:
/* Useless without initialization by the bus manager. */

default:
rcode = RCODE_ADDRESS_ERROR;
break;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/firewire/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct fw_card_driver {
int (*enable_phys_dma)(struct fw_card *card,
int node_id, int generation);

u64 (*get_bus_time)(struct fw_card *card);
u32 (*get_cycle_time)(struct fw_card *card);

struct fw_iso_context *
(*allocate_iso_context)(struct fw_card *card,
Expand Down
25 changes: 7 additions & 18 deletions trunk/drivers/firewire/ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <linux/spinlock.h>
#include <linux/string.h>

#include <asm/atomic.h>
#include <asm/byteorder.h>
#include <asm/page.h>
#include <asm/system.h>
Expand Down Expand Up @@ -187,7 +186,6 @@ struct fw_ohci {
int node_id;
int generation;
int request_generation; /* for timestamping incoming requests */
atomic_t bus_seconds;

bool use_dualbuffer;
bool old_uninorth;
Expand Down Expand Up @@ -276,7 +274,7 @@ static void log_irqs(u32 evt)
!(evt & OHCI1394_busReset))
return;

fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt,
fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt,
evt & OHCI1394_selfIDComplete ? " selfID" : "",
evt & OHCI1394_RQPkt ? " AR_req" : "",
evt & OHCI1394_RSPkt ? " AR_resp" : "",
Expand All @@ -286,16 +284,14 @@ static void log_irqs(u32 evt)
evt & OHCI1394_isochTx ? " IT" : "",
evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "",
evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "",
evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "",
evt & OHCI1394_cycleInconsistent ? " cycleInconsistent" : "",
evt & OHCI1394_regAccessFail ? " regAccessFail" : "",
evt & OHCI1394_busReset ? " busReset" : "",
evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt |
OHCI1394_RSPkt | OHCI1394_reqTxComplete |
OHCI1394_respTxComplete | OHCI1394_isochRx |
OHCI1394_isochTx | OHCI1394_postedWriteErr |
OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds |
OHCI1394_cycleInconsistent |
OHCI1394_cycleTooLong | OHCI1394_cycleInconsistent |
OHCI1394_regAccessFail | OHCI1394_busReset)
? " ?" : "");
}
Expand Down Expand Up @@ -1385,7 +1381,7 @@ static void bus_reset_tasklet(unsigned long data)
static irqreturn_t irq_handler(int irq, void *data)
{
struct fw_ohci *ohci = data;
u32 event, iso_event, cycle_time;
u32 event, iso_event;
int i;

event = reg_read(ohci, OHCI1394_IntEventClear);
Expand Down Expand Up @@ -1455,12 +1451,6 @@ static irqreturn_t irq_handler(int irq, void *data)
fw_notify("isochronous cycle inconsistent\n");
}

if (event & OHCI1394_cycle64Seconds) {
cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer);
if ((cycle_time & 0x80000000) == 0)
atomic_inc(&ohci->bus_seconds);
}

return IRQ_HANDLED;
}

Expand Down Expand Up @@ -1554,8 +1544,7 @@ static int ohci_enable(struct fw_card *card,
OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
OHCI1394_isochRx | OHCI1394_isochTx |
OHCI1394_postedWriteErr | OHCI1394_cycleTooLong |
OHCI1394_cycleInconsistent |
OHCI1394_cycle64Seconds | OHCI1394_regAccessFail |
OHCI1394_cycleInconsistent | OHCI1394_regAccessFail |
OHCI1394_masterIntEnable);
if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS)
reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);
Expand Down Expand Up @@ -1821,7 +1810,7 @@ static u32 cycle_timer_ticks(u32 cycle_timer)
* error. (A PCI read should take at least 20 ticks of the 24.576 MHz timer to
* execute, so we have enough precision to compute the ratio of the differences.)
*/
static u64 ohci_get_bus_time(struct fw_card *card)
static u32 ohci_get_cycle_time(struct fw_card *card)
{
struct fw_ohci *ohci = fw_ohci(card);
u32 c0, c1, c2;
Expand Down Expand Up @@ -1849,7 +1838,7 @@ static u64 ohci_get_bus_time(struct fw_card *card)
&& i++ < 20);
}

return ((u64)atomic_read(&ohci->bus_seconds) << 32) | c2;
return c2;
}

static void copy_iso_headers(struct iso_context *ctx, void *p)
Expand Down Expand Up @@ -2426,7 +2415,7 @@ static const struct fw_card_driver ohci_driver = {
.send_response = ohci_send_response,
.cancel_packet = ohci_cancel_packet,
.enable_phys_dma = ohci_enable_phys_dma,
.get_bus_time = ohci_get_bus_time,
.get_cycle_time = ohci_get_cycle_time,

.allocate_iso_context = ohci_allocate_iso_context,
.free_iso_context = ohci_free_iso_context,
Expand Down

0 comments on commit 6964ef0

Please sign in to comment.