bfad_os.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. * bfad_os.c Linux driver OS specific calls.
  19. */
  20. #include "bfa_os_inc.h"
  21. #include "bfad_drv.h"
  22. void
  23. bfa_os_gettimeofday(struct bfa_timeval_s *tv)
  24. {
  25. struct timeval tmp_tv;
  26. do_gettimeofday(&tmp_tv);
  27. tv->tv_sec = (u32) tmp_tv.tv_sec;
  28. tv->tv_usec = (u32) tmp_tv.tv_usec;
  29. }
  30. void
  31. bfa_os_printf(struct bfa_log_mod_s *log_mod, u32 msg_id,
  32. const char *fmt, ...)
  33. {
  34. va_list ap;
  35. #define BFA_STRING_256 256
  36. char tmp[BFA_STRING_256];
  37. va_start(ap, fmt);
  38. vsprintf(tmp, fmt, ap);
  39. va_end(ap);
  40. printk(tmp);
  41. }