bfa_port.h 2.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
/*
 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
 * All rights reserved
 * www.brocade.com
 *
 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License (GPL) Version 2 as
 * published by the Free Software Foundation
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */

#ifndef __BFA_PORT_H__
#define __BFA_PORT_H__

#include <defs/bfa_defs_port.h>
#include <bfa_ioc.h>
#include <cs/bfa_trc.h>
#include <cs/bfa_log.h>

typedef void    (*bfa_port_stats_cbfn_t) (void *dev, bfa_status_t status);
typedef void    (*bfa_port_endis_cbfn_t) (void *dev, bfa_status_t status);

struct bfa_port_s {
	void           *dev;
	struct bfa_ioc_s *ioc;
	struct bfa_trc_mod_s *trcmod;
	struct bfa_log_mod_s *logmod;
	u32        msgtag;
	bfa_boolean_t   stats_busy;
	struct bfa_mbox_cmd_s stats_mb;
	bfa_port_stats_cbfn_t stats_cbfn;
	void           *stats_cbarg;
	bfa_status_t    stats_status;
	union bfa_pport_stats_u *stats;
	struct bfa_dma_s stats_dma;
	bfa_boolean_t   endis_pending;
	struct bfa_mbox_cmd_s endis_mb;
	bfa_port_endis_cbfn_t endis_cbfn;
	void           *endis_cbarg;
	bfa_status_t    endis_status;
	struct bfa_ioc_hbfail_notify_s hbfail;
};

void            bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
				void *dev, struct bfa_trc_mod_s *trcmod,
				struct bfa_log_mod_s *logmod);
void            bfa_port_detach(struct bfa_port_s *port);
void            bfa_port_hbfail(void *arg);

bfa_status_t    bfa_port_get_stats(struct bfa_port_s *port,
				   union bfa_pport_stats_u *stats,
				   bfa_port_stats_cbfn_t cbfn, void *cbarg);
bfa_status_t    bfa_port_clear_stats(struct bfa_port_s *port,
				     bfa_port_stats_cbfn_t cbfn, void *cbarg);
bfa_status_t    bfa_port_enable(struct bfa_port_s *port,
				bfa_port_endis_cbfn_t cbfn, void *cbarg);
bfa_status_t    bfa_port_disable(struct bfa_port_s *port,
				 bfa_port_endis_cbfn_t cbfn, void *cbarg);
u32        bfa_port_meminfo(void);
void            bfa_port_mem_claim(struct bfa_port_s *port, u8 *dma_kva,
				   u64 dma_pa);

#endif /* __BFA_PORT_H__ */