/* * Thunderbolt Cactus Ridge driver - control channel and configuration commands * * Copyright (c) 2014 Andreas Noever <andreas.noever@gmail.com> */ #ifndef _TB_CFG #define _TB_CFG #include "nhi.h" /* control channel */ struct tb_ctl; typedef void (*hotplug_cb)(void *data, u64 route, u8 port, bool unplug); struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, hotplug_cb cb, void *cb_data); void tb_ctl_start(struct tb_ctl *ctl); void tb_ctl_stop(struct tb_ctl *ctl); void tb_ctl_free(struct tb_ctl *ctl); /* configuration commands */ #define TB_CFG_DEFAULT_TIMEOUT 5000 /* msec */ enum tb_cfg_space { TB_CFG_HOPS = 0, TB_CFG_PORT = 1, TB_CFG_SWITCH = 2, TB_CFG_COUNTERS = 3, }; enum tb_cfg_error { TB_CFG_ERROR_PORT_NOT_CONNECTED = 0, TB_CFG_ERROR_INVALID_CONFIG_SPACE = 2, TB_CFG_ERROR_NO_SUCH_PORT = 4, TB_CFG_ERROR_ACK_PLUG_EVENT = 7, /* send as reply to TB_CFG_PKG_EVENT */ TB_CFG_ERROR_LOOP = 8, }; struct tb_cfg_result { u64 response_route; u32 response_port; /* * If err = 1 then this is the port that send the * error. * If err = 0 and if this was a cfg_read/write then * this is the the upstream port of the responding * switch. * Otherwise the field is set to zero. */ int err; /* negative errors, 0 for success, 1 for tb errors */ enum tb_cfg_error tb_error; /* valid if err == 1 */ }; int tb_cfg_error(struct tb_ctl *ctl, u64 route, u32 port, enum tb_cfg_error error); struct tb_cfg_result tb_cfg_reset(struct tb_ctl *ctl, u64 route, int timeout_msec); struct tb_cfg_result tb_cfg_read_raw(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, enum tb_cfg_space space, u32 offset, u32 length, int timeout_msec); struct tb_cfg_result tb_cfg_write_raw(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, enum tb_cfg_space space, u32 offset, u32 length, int timeout_msec); int tb_cfg_read(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, enum tb_cfg_space space, u32 offset, u32 length); int tb_cfg_write(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, enum tb_cfg_space space, u32 offset, u32 length); int tb_cfg_get_upstream_port(struct tb_ctl *ctl, u64 route); #endif fb9a5ca000b83cacd13fcaeda51ac&id2=90f92c631b210c1e97080b53a9d863783281a932'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/tools/arch/mips/include/asm/barrier.h'> <input type='hidden' name='id' value='fa19a769f82fb9a5ca000b83cacd13fcaeda51ac'/><input type='hidden' name='id2' value='90f92c631b210c1e97080b53a9d863783281a932'/><select name='qt'> <option value='grep'>log msg</option> <option value='author'>author</option> <option value='committer'>committer</option> <option value='range'>range</option> </select> <input class='txt' type='search' size='10' name='q' value=''/> <input type='submit' value='search'/> </form> </td></tr></table> <div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/diff/?id=fa19a769f82fb9a5ca000b83cacd13fcaeda51ac&id2=90f92c631b210c1e97080b53a9d863783281a932'>root</a>/<a href='/cgit.cgi/linux/net-next.git/diff/tools?id=fa19a769f82fb9a5ca000b83cacd13fcaeda51ac&id2=90f92c631b210c1e97080b53a9d863783281a932'>tools</a>/<a href='/cgit.cgi/linux/net-next.git/diff/tools/arch?id=fa19a769f82fb9a5ca000b83cacd13fcaeda51ac&id2=90f92c631b210c1e97080b53a9d863783281a932'>arch</a>/<a href='/cgit.cgi/linux/net-next.git/diff/tools/arch/mips?id=fa19a769f82fb9a5ca000b83cacd13fcaeda51ac&id2=90f92c631b210c1e97080b53a9d863783281a932'>mips</a>/<a href='/cgit.cgi/linux/net-next.git/diff/tools/arch/mips/include?id=fa19a769f82fb9a5ca000b83cacd13fcaeda51ac&id2=90f92c631b210c1e97080b53a9d863783281a932'>include</a>/<a href='/cgit.cgi/linux/net-next.git/diff/tools/arch/mips/include/asm?id=fa19a769f82fb9a5ca000b83cacd13fcaeda51ac&id2=90f92c631b210c1e97080b53a9d863783281a932'>asm</a>/<a href='/cgit.cgi/linux/net-next.git/diff/tools/arch/mips/include/asm/barrier.h?id=fa19a769f82fb9a5ca000b83cacd13fcaeda51ac&id2=90f92c631b210c1e97080b53a9d863783281a932'>barrier.h</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='fa19a769f82fb9a5ca000b83cacd13fcaeda51ac'/><input type='hidden' name='id2' value='90f92c631b210c1e97080b53a9d863783281a932'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?id=fa19a769f82fb9a5ca000b83cacd13fcaeda51ac&id2=90f92c631b210c1e97080b53a9d863783281a932'>Diffstat</a> (limited to 'tools/arch/mips/include/asm/barrier.h')</div><table summary='diffstat' class='diffstat'>