bfa_fcs_port.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. /**
  18. * bfa_fcs_pport.c BFA FCS PPORT ( physical port)
  19. */
  20. #include <fcs/bfa_fcs.h>
  21. #include <bfa_svc.h>
  22. #include <fcs/bfa_fcs_fabric.h>
  23. #include "fcs_trcmod.h"
  24. #include "fcs.h"
  25. #include "fcs_fabric.h"
  26. #include "fcs_port.h"
  27. BFA_TRC_FILE(FCS, PPORT);
  28. static void
  29. bfa_fcs_pport_event_handler(void *cbarg, bfa_pport_event_t event)
  30. {
  31. struct bfa_fcs_s *fcs = cbarg;
  32. bfa_trc(fcs, event);
  33. switch (event) {
  34. case BFA_PPORT_LINKUP:
  35. bfa_fcs_fabric_link_up(&fcs->fabric);
  36. break;
  37. case BFA_PPORT_LINKDOWN:
  38. bfa_fcs_fabric_link_down(&fcs->fabric);
  39. break;
  40. case BFA_PPORT_TRUNK_LINKDOWN:
  41. bfa_assert(0);
  42. break;
  43. default:
  44. bfa_assert(0);
  45. }
  46. }
  47. void
  48. bfa_fcs_pport_modinit(struct bfa_fcs_s *fcs)
  49. {
  50. bfa_pport_event_register(fcs->bfa, bfa_fcs_pport_event_handler,
  51. fcs);
  52. }
  53. void
  54. bfa_fcs_pport_modexit(struct bfa_fcs_s *fcs)
  55. {
  56. bfa_fcs_modexit_comp(fcs);
  57. }