]> Git Repo - linux.git/commitdiff
Merge tag 'firewire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee139...
authorLinus Torvalds <[email protected]>
Tue, 4 Jul 2023 18:02:34 +0000 (11:02 -0700)
committerLinus Torvalds <[email protected]>
Tue, 4 Jul 2023 18:02:34 +0000 (11:02 -0700)
Pull firewire updates from Takashi Sakamoto:
 "This consist of three parts; UAPI update, OHCI driver update, and
  several bug fixes.

  Firstly, the 1394 OHCI specification defines method to retrieve
  hardware time stamps for asynchronous communication, which was
  previously unavailable in user space. This adds new events to the
  UAPI, allowing applications to retrieve the time when asynchronous
  packet are received and sent. The new events are tested in the
  bleeding edge of libhinawa and look to work well. The new version of
  libhinawa will be released after current merge window is closed:

    https://git.kernel.org/pub/scm/libs/ieee1394/libhinawa.git/

  Secondly, the FireWire stack includes a PCM device driver for 1394
  OHCI hardware, This change modernizes the driver by managed resource
  (devres) framework.

  Lastly, bug fixes for firewire-net and firewire-core"

* tag 'firewire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: (25 commits)
  firewire: net: fix use after free in fwnet_finish_incoming_packet()
  firewire: core: obsolete usage of GFP_ATOMIC at building node tree
  firewire: ohci: release buffer for AR req/resp contexts when managed resource is released
  firewire: ohci: use devres for content of configuration ROM
  firewire: ohci: use devres for IT, IR, AT/receive, and AT/request contexts
  firewire: ohci: use devres for list of isochronous contexts
  firewire: ohci: use devres for requested IRQ
  firewire: ohci: use devres for misc DMA buffer
  firewire: ohci: use devres for MMIO region mapping
  firewire: ohci: use devres for PCI-related resources
  firewire: ohci: use devres for memory object of ohci structure
  firewire: fix warnings to generate UAPI documentation
  firewire: fix build failure due to missing module license
  firewire: cdev: implement new event relevant to phy packet with time stamp
  firewire: cdev: add new event to notify phy packet with time stamp
  firewire: cdev: code refactoring to dispatch event for phy packet
  firewire: cdev: implement new event to notify response subaction with time stamp
  firewire: cdev: add new event to notify response subaction with time stamp
  firewire: cdev: code refactoring to operate event of response
  firewire: core: implement variations to send request and wait for response with time stamp
  ...

1  2 
include/linux/firewire.h

diff --combined include/linux/firewire.h
index efb6e2cf203439d3aaf759f3f80c1745c397b6ff,a7fd23d0010d25d998e01aee1a09858af7a1cb56..bd3fc75d4f14678a38b2e48891bbd45cdaa9fc8c
@@@ -261,6 -261,15 +261,15 @@@ typedef void (*fw_packet_callback_t)(st
  typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode,
                                          void *data, size_t length,
                                          void *callback_data);
+ typedef void (*fw_transaction_callback_with_tstamp_t)(struct fw_card *card, int rcode,
+                                       u32 request_tstamp, u32 response_tstamp, void *data,
+                                       size_t length, void *callback_data);
+ union fw_transaction_callback {
+       fw_transaction_callback_t without_tstamp;
+       fw_transaction_callback_with_tstamp_t with_tstamp;
+ };
  /*
   * This callback handles an inbound request subaction.  It is called in
   * RCU read-side context, therefore must not sleep.
@@@ -312,6 -321,7 +321,7 @@@ struct fw_transaction 
        struct fw_card *card;
        bool is_split_transaction;
        struct timer_list split_timeout_timer;
+       u32 split_timeout_cycle;
  
        struct fw_packet packet;
  
         * The data passed to the callback is valid only during the
         * callback.
         */
-       fw_transaction_callback_t callback;
+       union fw_transaction_callback callback;
+       bool with_tstamp;
        void *callback_data;
  };
  
@@@ -345,10 -356,71 +356,71 @@@ void fw_send_response(struct fw_card *c
                      struct fw_request *request, int rcode);
  int fw_get_request_speed(struct fw_request *request);
  u32 fw_request_get_timestamp(const struct fw_request *request);
- void fw_send_request(struct fw_card *card, struct fw_transaction *t,
-                    int tcode, int destination_id, int generation, int speed,
-                    unsigned long long offset, void *payload, size_t length,
-                    fw_transaction_callback_t callback, void *callback_data);
+ void __fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode,
+               int destination_id, int generation, int speed, unsigned long long offset,
+               void *payload, size_t length, union fw_transaction_callback callback,
+               bool with_tstamp, void *callback_data);
+ /**
+  * fw_send_request() - submit a request packet for transmission to generate callback for response
+  *                   subaction without time stamp.
+  * @card:             interface to send the request at
+  * @t:                        transaction instance to which the request belongs
+  * @tcode:            transaction code
+  * @destination_id:   destination node ID, consisting of bus_ID and phy_ID
+  * @generation:               bus generation in which request and response are valid
+  * @speed:            transmission speed
+  * @offset:           48bit wide offset into destination's address space
+  * @payload:          data payload for the request subaction
+  * @length:           length of the payload, in bytes
+  * @callback:         function to be called when the transaction is completed
+  * @callback_data:    data to be passed to the transaction completion callback
+  *
+  * A variation of __fw_send_request() to generate callback for response subaction without time
+  * stamp.
+  */
+ static inline void fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode,
+                                  int destination_id, int generation, int speed,
+                                  unsigned long long offset, void *payload, size_t length,
+                                  fw_transaction_callback_t callback, void *callback_data)
+ {
+       union fw_transaction_callback cb = {
+               .without_tstamp = callback,
+       };
+       __fw_send_request(card, t, tcode, destination_id, generation, speed, offset, payload,
+                         length, cb, false, callback_data);
+ }
+ /**
+  * fw_send_request_with_tstamp() - submit a request packet for transmission to generate callback for
+  *                               response with time stamp.
+  * @card:             interface to send the request at
+  * @t:                        transaction instance to which the request belongs
+  * @tcode:            transaction code
+  * @destination_id:   destination node ID, consisting of bus_ID and phy_ID
+  * @generation:               bus generation in which request and response are valid
+  * @speed:            transmission speed
+  * @offset:           48bit wide offset into destination's address space
+  * @payload:          data payload for the request subaction
+  * @length:           length of the payload, in bytes
+  * @callback:         function to be called when the transaction is completed
+  * @callback_data:    data to be passed to the transaction completion callback
+  *
+  * A variation of __fw_send_request() to generate callback for response subaction with time stamp.
+  */
+ static inline void fw_send_request_with_tstamp(struct fw_card *card, struct fw_transaction *t,
+       int tcode, int destination_id, int generation, int speed, unsigned long long offset,
+       void *payload, size_t length, fw_transaction_callback_with_tstamp_t callback,
+       void *callback_data)
+ {
+       union fw_transaction_callback cb = {
+               .with_tstamp = callback,
+       };
+       __fw_send_request(card, t, tcode, destination_id, generation, speed, offset, payload,
+                         length, cb, true, callback_data);
+ }
  int fw_cancel_transaction(struct fw_card *card,
                          struct fw_transaction *transaction);
  int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
@@@ -391,7 -463,7 +463,7 @@@ struct fw_iso_packet 
        u32 tag:2;              /* tx: Tag in packet header             */
        u32 sy:4;               /* tx: Sy in packet header              */
        u32 header_length:8;    /* Length of immediate header           */
 -      u32 header[0];          /* tx: Top of 1394 isoch. data_block    */
 +      u32 header[];           /* tx: Top of 1394 isoch. data_block    */
  };
  
  #define FW_ISO_CONTEXT_TRANSMIT                       0
This page took 0.082546 seconds and 4 git commands to generate.