~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/greybus/hd.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Greybus Host Device
  4  *
  5  * Copyright 2014-2015 Google Inc.
  6  * Copyright 2014-2015 Linaro Ltd.
  7  */
  8 
  9 #ifndef __HD_H
 10 #define __HD_H
 11 
 12 #include <linux/types.h>
 13 #include <linux/device.h>
 14 
 15 struct gb_host_device;
 16 struct gb_message;
 17 
 18 struct gb_hd_driver {
 19         size_t  hd_priv_size;
 20 
 21         int (*cport_allocate)(struct gb_host_device *hd, int cport_id,
 22                                 unsigned long flags);
 23         void (*cport_release)(struct gb_host_device *hd, u16 cport_id);
 24         int (*cport_enable)(struct gb_host_device *hd, u16 cport_id,
 25                                 unsigned long flags);
 26         int (*cport_disable)(struct gb_host_device *hd, u16 cport_id);
 27         int (*cport_connected)(struct gb_host_device *hd, u16 cport_id);
 28         int (*cport_flush)(struct gb_host_device *hd, u16 cport_id);
 29         int (*cport_shutdown)(struct gb_host_device *hd, u16 cport_id,
 30                                 u8 phase, unsigned int timeout);
 31         int (*cport_quiesce)(struct gb_host_device *hd, u16 cport_id,
 32                                 size_t peer_space, unsigned int timeout);
 33         int (*cport_clear)(struct gb_host_device *hd, u16 cport_id);
 34 
 35         int (*message_send)(struct gb_host_device *hd, u16 dest_cport_id,
 36                         struct gb_message *message, gfp_t gfp_mask);
 37         void (*message_cancel)(struct gb_message *message);
 38         int (*latency_tag_enable)(struct gb_host_device *hd, u16 cport_id);
 39         int (*latency_tag_disable)(struct gb_host_device *hd, u16 cport_id);
 40         int (*output)(struct gb_host_device *hd, void *req, u16 size, u8 cmd,
 41                       bool async);
 42 };
 43 
 44 struct gb_host_device {
 45         struct device dev;
 46         int bus_id;
 47         const struct gb_hd_driver *driver;
 48 
 49         struct list_head modules;
 50         struct list_head connections;
 51         struct ida cport_id_map;
 52 
 53         /* Number of CPorts supported by the UniPro IP */
 54         size_t num_cports;
 55 
 56         /* Host device buffer constraints */
 57         size_t buffer_size_max;
 58 
 59         struct gb_svc *svc;
 60         /* Private data for the host driver */
 61         unsigned long hd_priv[] __aligned(sizeof(s64));
 62 };
 63 #define to_gb_host_device(d) container_of(d, struct gb_host_device, dev)
 64 
 65 int gb_hd_cport_reserve(struct gb_host_device *hd, u16 cport_id);
 66 void gb_hd_cport_release_reserved(struct gb_host_device *hd, u16 cport_id);
 67 int gb_hd_cport_allocate(struct gb_host_device *hd, int cport_id,
 68                                         unsigned long flags);
 69 void gb_hd_cport_release(struct gb_host_device *hd, u16 cport_id);
 70 
 71 struct gb_host_device *gb_hd_create(struct gb_hd_driver *driver,
 72                                         struct device *parent,
 73                                         size_t buffer_size_max,
 74                                         size_t num_cports);
 75 int gb_hd_add(struct gb_host_device *hd);
 76 void gb_hd_del(struct gb_host_device *hd);
 77 void gb_hd_shutdown(struct gb_host_device *hd);
 78 void gb_hd_put(struct gb_host_device *hd);
 79 int gb_hd_output(struct gb_host_device *hd, void *req, u16 size, u8 cmd,
 80                  bool in_irq);
 81 
 82 int gb_hd_init(void);
 83 void gb_hd_exit(void);
 84 
 85 #endif  /* __HD_H */
 86 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php