static void fcp_request(struct hpsb_host *host, int nodeid, int direction,
			int cts, u8 *data, size_t length)
{
	struct firedtv *f, *fdtv = NULL;
	unsigned long flags;
	int su;

	if (length == 0 || (data[0] & 0xf0) != 0)
		return;

	su = data[1] & 0x7;

	spin_lock_irqsave(&node_list_lock, flags);
	list_for_each_entry(f, &node_list, list)
		if (node_of(f)->host == host &&
		    node_of(f)->nodeid == nodeid &&
		    (f->subunit == su || (f->subunit == 0 && su == 0x7))) {
			fdtv = f;
			break;
		}
	spin_unlock_irqrestore(&node_list_lock, flags);

	if (fdtv)
		avc_recv(fdtv, data, length);
}
Exemple #2
0
	inline void append_failure_impl(std::set<Node>& visited, const Node& lhs, const Edge& rhs)
	{
		if (visited.find(lhs) == visited.end())
		{
			visited.insert(lhs);
			
			if (valid_edge(lhs->on_failure)) {
				if (!overwrote_edge(lhs->on_failure, rhs))
					append_failure_impl(visited, node_of(lhs->on_failure), rhs);
			}
			else
				lhs->on_failure = rhs;
			
			if (valid_edge(lhs->on_success) && !overwrote_edge(lhs->on_success, rhs))
				append_success_impl(visited, node_of(lhs->on_success), rhs);
			
			if (valid_edge(lhs->on_invalid) && !overwrote_edge(lhs->on_invalid, rhs))
				append_success_impl(visited, node_of(lhs->on_invalid), rhs);
		}
	}
static int node_lock(struct firedtv *fdtv, u64 addr, void *data)
{
	quadlet_t *d = data;
	int ret;

	ret = hpsb_node_lock(node_of(fdtv), addr,
			     EXTCODE_COMPARE_SWAP, &d[1], d[0]);
	d[0] = d[1];

	return ret;
}
static int start_iso(struct firedtv *fdtv)
{
	struct hpsb_iso *iso_handle;
	int ret;

	iso_handle = hpsb_iso_recv_init(node_of(fdtv)->host,
				FDTV_ISO_BUFFER_SIZE, FDTV_ISO_BUFFER_PACKETS,
				fdtv->isochannel, HPSB_ISO_DMA_DEFAULT,
				-1, /* stat.config.irq_interval */
				rawiso_activity_cb);
	if (iso_handle == NULL) {
		dev_err(fdtv->device, "cannot initialize iso receive\n");
		return -ENOMEM;
	}
	fdtv->backend_data = iso_handle;

	ret = hpsb_iso_recv_start(iso_handle, -1, -1, 0);
	if (ret != 0) {
		dev_err(fdtv->device, "cannot start iso receive\n");
		hpsb_iso_shutdown(iso_handle);
		fdtv->backend_data = NULL;
	}
	return ret;
}
static int node_write(struct firedtv *fdtv, u64 addr, void *data, size_t len)
{
	return hpsb_node_write(node_of(fdtv), addr, data, len);
}
static int node_read(struct firedtv *fdtv, u64 addr, void *data)
{
	return hpsb_node_read(node_of(fdtv), addr, data, 4);
}
static int node_lock(struct firedtv *fdtv, u64 addr, void *data, __be32 arg)
{
	return hpsb_node_lock(node_of(fdtv), addr, EXTCODE_COMPARE_SWAP, data,
			      (__force quadlet_t)arg);
}