aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core-transaction.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-03 11:08:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-03 11:08:44 -0500
commitc1dcb4bb1e3e16e9baee578d9bb040e5fba1063e (patch)
tree1bba995740aed8ef9a47111c1ee6ceeda84af836 /drivers/firewire/core-transaction.c
parent60f8a8d4c6c46bb080e8e65d30be31b172a39a78 (diff)
parent6fdb2ee243404c7cbf530387bf904ad1841ebf5b (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (23 commits) firewire: ohci: extend initialization log message firewire: ohci: fix IR/IT context mask mixup firewire: ohci: add module parameter to activate quirk fixes firewire: ohci: use an ID table for quirks detection firewire: ohci: reorder struct fw_ohci for better cache efficiency firewire: ohci: remove unused dualbuffer IR code firewire: core: combine a bit of repeated code firewire: core: change type of a data buffer firewire: cdev: increment ABI version number firewire: cdev: add more flexible cycle timer ioctl firewire: core: rename an internal function firewire: core: fix an information leak firewire: core: increase stack size of config ROM reader firewire: core: don't fail device creation in case of too large config ROM blocks firewire: core: fix "giving up on config rom" with Panasonic AG-DV2500 firewire: remove incomplete Bus_Time CSR support firewire: get_cycle_timer optimization and cleanup firewire: ohci: enable cycle timer fix on ALi and NEC controllers firewire: ohci: work around cycle timer bugs on VIA controllers firewire: make PCI device id constant ...
Diffstat (limited to 'drivers/firewire/core-transaction.c')
-rw-r--r--drivers/firewire/core-transaction.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 495849eb13cc..673b03f8b4ec 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -921,23 +921,15 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
921 void *payload, size_t length, void *callback_data) 921 void *payload, size_t length, void *callback_data)
922{ 922{
923 int reg = offset & ~CSR_REGISTER_BASE; 923 int reg = offset & ~CSR_REGISTER_BASE;
924 unsigned long long bus_time;
925 __be32 *data = payload; 924 __be32 *data = payload;
926 int rcode = RCODE_COMPLETE; 925 int rcode = RCODE_COMPLETE;
927 926
928 switch (reg) { 927 switch (reg) {
929 case CSR_CYCLE_TIME: 928 case CSR_CYCLE_TIME:
930 case CSR_BUS_TIME: 929 if (TCODE_IS_READ_REQUEST(tcode) && length == 4)
931 if (!TCODE_IS_READ_REQUEST(tcode) || length != 4) { 930 *data = cpu_to_be32(card->driver->get_cycle_time(card));
932 rcode = RCODE_TYPE_ERROR;
933 break;
934 }
935
936 bus_time = card->driver->get_bus_time(card);
937 if (reg == CSR_CYCLE_TIME)
938 *data = cpu_to_be32(bus_time);
939 else 931 else
940 *data = cpu_to_be32(bus_time >> 25); 932 rcode = RCODE_TYPE_ERROR;
941 break; 933 break;
942 934
943 case CSR_BROADCAST_CHANNEL: 935 case CSR_BROADCAST_CHANNEL:
@@ -968,6 +960,9 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
968 case CSR_BUSY_TIMEOUT: 960 case CSR_BUSY_TIMEOUT:
969 /* FIXME: Implement this. */ 961 /* FIXME: Implement this. */
970 962
963 case CSR_BUS_TIME:
964 /* Useless without initialization by the bus manager. */
965
971 default: 966 default:
972 rcode = RCODE_ADDRESS_ERROR; 967 rcode = RCODE_ADDRESS_ERROR;
973 break; 968 break;