ixgbe_fcoe.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*******************************************************************************
  2. Intel 10 Gigabit PCI Express Linux driver
  3. Copyright(c) 1999 - 2009 Intel Corporation.
  4. This program is free software; you can redistribute it and/or modify it
  5. under the terms and conditions of the GNU General Public License,
  6. version 2, as published by the Free Software Foundation.
  7. This program is distributed in the hope it will be useful, but WITHOUT
  8. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  10. more details.
  11. You should have received a copy of the GNU General Public License along with
  12. this program; if not, write to the Free Software Foundation, Inc.,
  13. 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  14. The full GNU General Public License is included in this distribution in
  15. the file called "COPYING".
  16. Contact Information:
  17. e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  18. Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  19. *******************************************************************************/
  20. #include "ixgbe.h"
  21. #include <linux/if_ether.h>
  22. #include <scsi/scsi_cmnd.h>
  23. #include <scsi/scsi_device.h>
  24. #include <scsi/fc/fc_fs.h>
  25. #include <scsi/fc/fc_fcoe.h>
  26. #include <scsi/libfc.h>
  27. #include <scsi/libfcoe.h>
  28. /**
  29. * ixgbe_configure_fcoe - configures registers for fcoe at start
  30. * @adapter: ptr to ixgbe adapter
  31. *
  32. * This sets up FCoE related registers
  33. *
  34. * Returns : none
  35. */
  36. void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
  37. {
  38. struct ixgbe_hw *hw = &adapter->hw;
  39. /* L2 filter for FCoE: default to queue 0 */
  40. IXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_FCOE),
  41. (ETH_P_FCOE | IXGBE_ETQF_FCOE | IXGBE_ETQF_FILTER_EN));
  42. IXGBE_WRITE_REG(hw, IXGBE_FCRECTL, 0);
  43. IXGBE_WRITE_REG(hw, IXGBE_ETQS(IXGBE_ETQF_FILTER_FCOE),
  44. IXGBE_ETQS_QUEUE_EN);
  45. IXGBE_WRITE_REG(hw, IXGBE_FCRXCTRL,
  46. IXGBE_FCRXCTRL_FCOELLI |
  47. IXGBE_FCRXCTRL_FCCRCBO |
  48. (FC_FCOE_VER << IXGBE_FCRXCTRL_FCOEVER_SHIFT));
  49. }